4

I have two videos from different sources.

I want to convert one of them so that its format, codec, framerate are the same as the other one.

Is there a one-liner for it (where I can give the "reference" video as option) or what is the best way?

I can use ffmpeg or mencoder or any Linux command line tool.

Clarification: I am after a general approach that is going to work everytime: without knowing anything about video1, I would like video2 to be converted into the same format, codec, framerate as video1

Addition Some background: I need that because I am trying to concatenate two videos. I am using mencoder but it requires the videos to be of the same codec, same framerate and other things. So I need to convert one of the same to be of the same "type" as the other one but I wouldn't want to dive in the "codecs realm".

Dan
  • 267
  • 2
  • 4
  • 9

1 Answers1

1

I don't know of a tool that could do it. The only solution I can think of is to write a shell script that finds the necessary information about video1 and then converts video2 to that format using ffmpeg. Roughly, it would be

ffmpeg -i video1 > props.txt
#lots of string parsing here. Sorry, but I don't have the time to work it all out now.
ffmpeg -i video2 [options you dug out earlier] video2.out

Obviously not a complete solution, but a rough idea. Hope this helps.

Yitzchak
  • 4,474
  • 7
  • 28
  • 44