Quantcast

2 pass encoding?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

2 pass encoding?

john passmore
Hi All,

I was hoping for some help.  I think I'm doing this correctly, but I'm
not sure.  Can someone confirm for me that I am indeed doing 2 pass
encoding with the following ffmpeg command?

ffmpeg -i video.avi  -pass 1 -ab 320k -acodec libfaac -vcodec libx264
-vpre fast_firstpass -vf  "crop=1440:1080:240:0,scale=640:480"  -b
2000k -bt 2000k -threads 0 video.mp4

Thanks!
John
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 2 pass encoding?

James Darnley
If you only have 1 command, you are not doing 2 pass.  The second pass
would be almost the same command but you would change "fast_firstpass"
to "fast"

On 22/10/2010, john passmore <[hidden email]> wrote:

> Hi All,
>
> I was hoping for some help.  I think I'm doing this correctly, but I'm
> not sure.  Can someone confirm for me that I am indeed doing 2 pass
> encoding with the following ffmpeg command?
>
> ffmpeg -i video.avi  -pass 1 -ab 320k -acodec libfaac -vcodec libx264
> -vpre fast_firstpass -vf  "crop=1440:1080:240:0,scale=640:480"  -b
> 2000k -bt 2000k -threads 0 video.mp4
>
> Thanks!
> John
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 2 pass encoding?

Andy Civil
In reply to this post by john passmore
On 2010-10-22 2:27 PM, john passmore wrote:
> Hi All,
>
> I was hoping for some help.  I think I'm doing this correctly, but I'm
> not sure.  Can someone confirm for me that I am indeed doing 2 pass
> encoding with the following ffmpeg command?
>
> ffmpeg -i video.avi  -pass 1 -ab 320k -acodec libfaac -vcodec libx264
> -vpre fast_firstpass -vf  "crop=1440:1080:240:0,scale=640:480"  -b
> 2000k -bt 2000k -threads 0 video.mp4

No, that's only doing the first pass. Something that confuses newbies is, you
need to run the program twice to do two passes. Unfortunately, the developers
don't see this as a problem because it's been like that from day one, so it
seems obvious to them.

You need to do it once with "- pass 1" and it creates a logfile; then you run it
again with "- pass 2" to actually do the coding. Now you know what you're
expecting, search for some examples on the 'net. You can cut corners on the
first pass, since the output will be thrown away.

--
Andy
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 2 pass encoding?

Jason Garrett-Glaser
On Fri, Oct 22, 2010 at 11:35 AM, Andy Civil <[hidden email]> wrote:

> On 2010-10-22 2:27 PM, john passmore wrote:
>>
>> Hi All,
>>
>> I was hoping for some help.  I think I'm doing this correctly, but I'm
>> not sure.  Can someone confirm for me that I am indeed doing 2 pass
>> encoding with the following ffmpeg command?
>>
>> ffmpeg -i video.avi  -pass 1 -ab 320k -acodec libfaac -vcodec libx264
>> -vpre fast_firstpass -vf  "crop=1440:1080:240:0,scale=640:480"  -b
>> 2000k -bt 2000k -threads 0 video.mp4
>
> No, that's only doing the first pass. Something that confuses newbies is,
> you need to run the program twice to do two passes. Unfortunately, the
> developers don't see this as a problem because it's been like that from day
> one, so it seems obvious to them.
>
> You can cut corners
> on the first pass, since the output will be thrown away.

That's done automatically when you select a preset with _firstpass in the name.

Dark Shikari
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 2 pass encoding?

Frederik Dam Sunne
> That's done automatically when you select a preset with _firstpass in the name.
>
> Dark Shikari

But shouldn't you still apply this trick?

-an -f rawvideo -y NUL (on Windows builds)
or
-an -f rawvideo -y /dev/null

Regards,

Frederik
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 2 pass encoding?

James Darnley
On 25/10/2010, Frederik Dam Sunne <[hidden email]> wrote:

>> That's done automatically when you select a preset with _firstpass in the
>> name.
>>
>> Dark Shikari
>
> But shouldn't you still apply this trick?
>
> -an -f rawvideo -y NUL (on Windows builds)
> or
> -an -f rawvideo -y /dev/null

This doesn't have much of an effect.  The only thing you gain is not
spending cpu time on audio encoding and muxing.  This is usually
insignificant next to video enoding.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 2 pass encoding?

Frederik Dam Sunne
> This doesn't have much of an effect.  The only thing you gain is not
> spending cpu time on audio encoding and muxing.  This is usually
> insignificant next to video enoding.

On Windows at least, FFMPEG actually builds an output file during the first pass
sidelongs with the stat file if you don't use the following:
-f rawvideo -y NUL (on Windows builds)
or
-f rawvideo -y /dev/null

This, together with not transcoding the sound using the -an switch,
can speed up the first
pass stage a few procent - which I think is worth mentioning.

Regards,

Frederik
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re : 2 pass encoding?

Guillaume Lafargue
In reply to this post by john passmore
Hi !

You're not doing 2 pass encoding. The parameter -vpre toto tells the libx264 to
use a list of parameter set for the "fast_firstpass", in the text file toto.
You can edit the file ffmpeg/ffpresets/libx264-fast_firstpass.ffpreset file in
your favorite text editor to see what are the values of these parameters.

If it can help you, the first pass of an encoding is done mainly to get
informations about the best way to encode a video. It analyses you video (pixel
by blocks, motion estimations for exemple) and records the results data in two
.x264.log files in the directory your ran ffmpeg. In the second pass, ffmpeg
reopens your video, but open the log files too and use it data the improve the
performances of the encoding process, that's why the second pass is often longer
than the first one.

So if you want to do two pass encoding, you can use :

ffmpeg -i video.avi  -pass 1 -ab 320k -acodec libfaac -vcodec libx264
-vpre fast_firstpass -vf  "crop=1440:1080:240:0,scale=640:480"  -b
2000k -bt 2000k -threads 0 video.mp4


(for the first pass, you can even substitute the outfile video.mp4 by /dev/null
cause this file is unuseful

for the second pass)

ffmpeg -i video.avi  -pass 2 -ab 320k -acodec libfaac -vcodec libx264
-vpre fast -vf  "crop=1440:1080:240:0,scale=640:480"  -b
2000k -bt 2000k -threads 0 video.mp4

Guillaume, bye.




________________________________





________________________________
De : john passmore <[hidden email]>
À : [hidden email]
Envoyé le : Ven 22 octobre 2010, 20h 27min 06s
Objet : [FFmpeg-user] 2 pass encoding?

Hi All,

I was hoping for some help.  I think I'm doing this correctly, but I'm
not sure.  Can someone confirm for me that I am indeed doing 2 pass
encoding with the following ffmpeg command?

ffmpeg -i video.avi  -pass 1 -ab 320k -acodec libfaac -vcodec libx264
-vpre fast_firstpass -vf  "crop=1440:1080:240:0,scale=640:480"  -b
2000k -bt 2000k -threads 0 video.mp4

Thanks!
John
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user



     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Loading...