[FFmpeg-user] Re "Help please using FFprobe to find duration..."

batguano999 batguano999 at zoho.com
Wed Aug 3 23:36:00 EEST 2016



There's something wrong with my email service, it won't let me reply!

Moritz Barsnick said
This command prints the (container) duration in seconds:
$ ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 foo.ts

----------------------------------------------------------------------
That's OK for my needs.
@Xubuntu:~$ ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 foo.ts
914.901333

So to convert files < 30 minutes as flac and files >= 30 minutes as ogg I need to test for 1800.

And my bash script would need to be such as...
if [something] < 1800 then ffmpeg -i foo.ts foo.flac else ffmpeg -i foo.ts foo.ogg




More information about the ffmpeg-user mailing list