[FFmpeg-user] FFprobe scripting question

Stefano Sabatini stefasab at gmail.com
Sat Jun 16 01:03:11 CEST 2012


On date Friday 2012-06-15 17:47:39 +0200, Clément Bœsch encoded:
> On Fri, Jun 15, 2012 at 05:05:11PM +0930, Rodney Baker wrote:
> > Hi all. Is there an easy way to use FFprobe in a script to get just the size 
> > or bitrate of a video stream? I have a video conversion script using FFmpeg 
> > and I want to make a decision on encoding bitrate based on whether or not the 
> > original stream is a HD (1440x1080) or SD (720x576) stream (as recorded from a 
> > dvb-t card). 
> > 
> > I know I could probably do it using something like 
> > 
> > ffprobe -show_streams 2>/dev/null  |  grep 'width' 
> > 
> > and then strip off the "width=" string but I was kind of hoping there might be 
> > an easier way to do it.
> > 
> 
> ffprobe -v 0 -show_streams | grep width

Another variant:
ffprobe INPUT -show_streams -print_format default=nk=1:nw=1 | sed -n 9p
-- 
ffmpeg-user random tip #23
FFmpeg FAQs (and answers):
http://ffmpeg.org/faq.html


More information about the ffmpeg-user mailing list