How to decode one frame and encode one jpg if using qscale

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to decode one frame and encode one jpg if using qscale

penguin flying
using this cmd
ffmpeg -i in.mp4  -copyts -f image2 -vframes 5   -y %03d.jpg
will decode one frame and then encode it to one jpg at the same time,
AND the picture will be encoded in default quality.

BUT when I want to improve the quality of the image after adding the param
"qscale",
ffmpeg -i in.mp4  -copyts -f image2 -vframes 5 -qscale:v 2   -y %03d.jpg

I found that three or more frames must be send to the encoder before the
first jpg comes out.

How to send one frame and then one picture out when using "qscale"

PS: the source file  in.mp4 has B frames
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to decode one frame and encode one jpg if using qscale

Carl Eugen Hoyos-2
Am Di., 17. März 2020 um 16:04 Uhr schrieb penguin flying
<[hidden email]>:

>
> using this cmd
> ffmpeg -i in.mp4  -copyts -f image2 -vframes 5   -y %03d.jpg
> will decode one frame and then encode it to one jpg at the same time,
> AND the picture will be encoded in default quality.
>
> BUT when I want to improve the quality of the image after adding the param
> "qscale",
> ffmpeg -i in.mp4  -copyts -f image2 -vframes 5 -qscale:v 2   -y %03d.jpg
>
> I found that three or more frames must be send to the encoder before the
> first jpg comes out.
>
> How to send one frame and then one picture out when using "qscale"

The output option -threads 1 should ensure this...

> PS: the source file  in.mp4 has B frames

... but this may not be possible for streams with B frames.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to decode one frame and encode one jpg if using qscale

penguin flying
but if we DID NOT add qscale,  we can get one picture after sending one
frame the the encoder at the same time; even if the src file having B frames



Carl Eugen Hoyos <[hidden email]> 于2020年3月17日周二 下午11:13写道:

> Am Di., 17. März 2020 um 16:04 Uhr schrieb penguin flying
> <[hidden email]>:
> >
> > using this cmd
> > ffmpeg -i in.mp4  -copyts -f image2 -vframes 5   -y %03d.jpg
> > will decode one frame and then encode it to one jpg at the same time,
> > AND the picture will be encoded in default quality.
> >
> > BUT when I want to improve the quality of the image after adding the
> param
> > "qscale",
> > ffmpeg -i in.mp4  -copyts -f image2 -vframes 5 -qscale:v 2   -y %03d.jpg
> >
> > I found that three or more frames must be send to the encoder before the
> > first jpg comes out.
> >
> > How to send one frame and then one picture out when using "qscale"
>
> The output option -threads 1 should ensure this...
>
> > PS: the source file  in.mp4 has B frames
>
> ... but this may not be possible for streams with B frames.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to decode one frame and encode one jpg if using qscale

penguin flying
aftering adding  -threads 1 in the cmd, IT WORKS.
thanks.

penguin flying <[hidden email]> 于2020年3月17日周二 下午11:25写道:

> but if we DID NOT add qscale,  we can get one picture after sending one
> frame the the encoder at the same time; even if the src file having B frames
>
>
>
> Carl Eugen Hoyos <[hidden email]> 于2020年3月17日周二 下午11:13写道:
>
>> Am Di., 17. März 2020 um 16:04 Uhr schrieb penguin flying
>> <[hidden email]>:
>> >
>> > using this cmd
>> > ffmpeg -i in.mp4  -copyts -f image2 -vframes 5   -y %03d.jpg
>> > will decode one frame and then encode it to one jpg at the same time,
>> > AND the picture will be encoded in default quality.
>> >
>> > BUT when I want to improve the quality of the image after adding the
>> param
>> > "qscale",
>> > ffmpeg -i in.mp4  -copyts -f image2 -vframes 5 -qscale:v 2   -y %03d.jpg
>> >
>> > I found that three or more frames must be send to the encoder before the
>> > first jpg comes out.
>> >
>> > How to send one frame and then one picture out when using "qscale"
>>
>> The output option -threads 1 should ensure this...
>>
>> > PS: the source file  in.mp4 has B frames
>>
>> ... but this may not be possible for streams with B frames.
>>
>> Carl Eugen
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".