I want to generate a video with the exact same settings as an existing video.  I can run:ffmpeg -i original.mp4To get human-readable info about the contents:Duration: 00:05:32.32, start: 0.000000, bitrate: 474 kb/s  Stream #0.0(und): Video: h264, yuv420p, 480x360, 25 tbr, 25 tbn, 50 tbc  Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16But what I'd like is to get the command-line I'd need to convert another video into the exact same format, so something like:ffmpeg -i source.mp4 -vcodec h264 - ....Any ideas if such a thing is possible?
Can I get the ffmpeg command-line from an existing video?
ffmpeg
There is no built-in option to do this, so you would need to write a program to do it.You need to parse the output of ffmpeg -i. Then you need to build a string containing all of the relevant information, formatted as a command line. It would need to know how to handle any properties that concern you. As Graeme noted, some format options are reported differently from the command you need to make them (and these often depend on the specific component that you have installed). Occasionally the completed script would need to be updated because of changes in ffmpeg.It's definitely possible, but it would be difficult and time-consuming. It might not be worth doing. If you still want to try it, you'll probably need experience in these areas:regular expressionsmedia encoding in generalffmpeg options and components (I recommend compiling it yourself if you haven't already)(probably) a good dynamic programming language (PERL seems like a logical candidate, if you can understand it)By the time you finish, you might find that you prefer to type in your own command lines anyway.