[FFmpeg-user] Transcode only if current codec does not meet my requirements

Michael Bradshaw mbradshaw at sorensonmedia.com
Mon Jun 4 20:09:36 CEST 2012


On Mon, Jun 4, 2012 at 11:55 AM,  <jimenaescolulle at terra.es> wrote:
> I want to transcode a video only if it does not currently meet my requirements.
>
> For example, if the video is already H.264 Constrained Baseline with less than 480x320 resolution I do not want the video transcoded. And also if the audio is already AAC I do not want it transcoded.
>
> How may I transcode a video only if it does not meet my requirements?
>
> I want it to be automatic to be able to do many files in a batch.

You can use ffmpeg -i originalVideoFileName.mp4 and ffmpeg will spit
out the stats about the video. You can then parse these results with a
python script or something and determine if it meets your
requirements. If not, transcode away. Or you can use mediainfo to get
the videos stats (which prints them out in a more easily parsable
manner).

--Michael


More information about the ffmpeg-user mailing list