[FFmpeg-user] set image width only?

Tim Nicholson tim.nicholson at bbc.co.uk
Fri Sep 9 08:39:41 CEST 2011


On 09/09/11 07:20, Tim Nicholson wrote:
> On 09/09/11 03:35, lovelove wrote:
>>
>> lovelove wrote:
>>>
>>> I don't really understand the difference between
>>> *-s 400x300*
>>> and
>>> *-vf "scale=400:300"*
>>>
>>
>> Aside from the difference from the -s parameter being unclear,
>> the -vf scale parameter you suggested to me somehow interferes with key
>> frame detection.
>>
>> This extracts all key frames of a video as single images:
>> *ffmpeg.exe -i inputfile.avi -vf select="eq(pict_type\,PICT_TYPE_I)"
>> -vsync
>> 0 -f image2 outputfile.AVI-%03d.tif**
>>
>> But when adding -vf scale, *ALL* images are extracted, not just
>> keyframes:
>> *ffmpeg.exe -i inputfile.avi -vf select="eq(pict_type\,PICT_TYPE_I)"
>> -vsync
>> 0 -vf "scale=400:-1" -f image2 outputfile.AVI-%03d.tif**
>>
>> What's going wrong? thank you.
>>
>
> At a guess, because you haven't ordered the filters the resize is
> happening first and therefore all frames become keyframes...
>
> You need to take the ouptut of the select and feed it into the scale...
>
> Try:-
>
> ffmpeg.exe -i inputfile.avi -vsync 0 -vf
> "select=eq(pict_type\,PICT_TYPE_I) [select]; [select] scale=400:-1
> [out]" -f image2 outputfile.AVI-%03d.tif
>
>

And before someone else points it out, this can be simplified to:-

ffmpeg.exe -i inputfile.avi -vsync 0 -vf 
"select=eq(pict_type\,PICT_TYPE_I), scale=400:-1" -f image2 
outputfile.AVI-%03d.tif

Read up on http://ffmpeg.org/ffmpeg.html#SEC113 about the filtergraph 
syntax.

-- 
Tim

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					


More information about the ffmpeg-user mailing list