My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 26: 2 Pass Encoding for Linux WinFF
2 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----
Type-Enhancement
Priority-Medium
Performance


Sign in to add a comment
 
Reported by cpt_mo...@yahoo.com, Dec 03, 2008
This is a feature request to get 2 pass mode working on the Linux version
of WinFF.

CURRENTLY, Linux WinFF's command line for 2 pass when selecting the "2
pass" checkbox look like this:

PASS 1:  ffmpeg -y -i INPUT <numerous options here> -passlogfile
logfile.log -pass 1 /dev/null
PASS 2:  ffmpeg -y -i INPUT <numerous options here> -passlogfile
logfile.log -pass 2  OUTPUT

A proper example of doing a manual 2 pass encoding under Linux, this works
with the latest SVN ffmpeg builds at least back to 13xxx:

PASS 1:  ffmpeg -y -i INPUT -pass 1 -an <numerous options here> -f FMT
/dev/null
PASS 2:  ffmpeg -y -i INPUT -pass 2 <numerous options here> -f FMT OUTPUT

A summary of the differences: 

1)  Don't encode audio on the first pass, add the switch "-an" to the first
pass command line, and put the audio encoding parameters on the second pass
command line only.

2)  Both passes need to have the output format specified with "-f FMT".  A
list of valid "FMT"s can be obtained by running "ffmpeg -formats".  For the
presets in WinFF there won't be very many to consider;  mp4, mp3, avi, aac,
ogg, etc..


Comment 1 by poipodec...@hotmail.com, Dec 04, 2008
Thanks for the input, I have several questions:
1) I guess we could leave the -passlogfile in there, or does it really need to go?
2) Do we need to remove the options for audio from the first line, or are they
ignored by the -an option anyway. I tested this and the latter seems the case.
3) I guess it makes sense that you have to specify the file format on the first line,
but is it really necessary on the second? Anyway, that would be the same as the
extension that you want to get, right?

Basically I think the only real change that needs implementing is the added "-an"
option, as you can add the "-f" option to the presets. If you can find the
appropriate formats for the presets I will add them to the presets file.

In the mean time I have build a test package with the -an option. Are you willing to
test? You can find it at my PPA (you need to use the jaunty repository): 
https://launchpad.net/~paul-climbing/+archive

Thanks.
10_Fix2Pass.dpatch
1.0 KB   Download
Status: Started
Owner: poipodec...@hotmail.com
Labels: -Type-Defect Type-Enhancement Performance
Comment 2 by cpt_mo...@yahoo.com, Dec 05, 2008
Hi,

Thanks for looking into this!  I downloaded the file 
"winff_0.43-2ubuntu2~ppa2j_i386.deb" from your PPA.  I extracted the WinFF binary 
from it to test it.

I put the appropriate "-f xxx" in the "additional command line parameters" box, 
checked the "2 pass" box, and then I made tests by encoding to xvid, h264, dvd, and 
flash.  All of them worked!  So you have implemented this correctly as far as I can 
see.  Please put this in an official release!  Thanks!
Comment 3 by poipodec...@hotmail.com, Dec 06, 2008
Can you confirm that it NEEDS the -f to work? Or does that depend on the presence of
a -vcodec line (what I would expect)? Of course, when no -vcodec or -f is present,
ffmpeg does not know which codec to use in the first pass.

Can you also please specify which format you used, ie a list with the codec and
corresponding format. I expect something like "codec libxvid format xvid", or am I wrong?
Comment 4 by cpt_mo...@yahoo.com, Dec 06, 2008
It needs the -f xxx on the first pass only, but adding it to both passes is OK.  If 
you don't use the -f there's an error saying that the format needs to be specified, 
even if the -vcodec is specified.

I encoded with libx264/mp4, mpeg2video/mpg, and libxvid/avi, as well as testing some 
wmv and flv for fun.
Comment 5 by poipodec...@hotmail.com, Dec 06, 2008
Ok, thanks for the feedback. I have the impression that in principle the extension
should be the same as this format right? You can also convert libxvid/mp4 (a lot of
the presets do).

I propose that I add the extension with the -f option to the beginning of the preset
line for 2pass, then any -f option in the preset will overwrite my additional option,
while it should work for most other presets. Does anybody see a problem with that
approach?
Comment 6 by poipodec...@hotmail.com, Dec 06, 2008
I have created a new package again, could you try it? It seems to work for me.

You can find it at my PPA (you need to use the jaunty repository): 
https://launchpad.net/~paul-climbing/+archive

Comment 7 by cpt_mo...@yahoo.com, Dec 06, 2008
Hello,

I just tried the new one.  I tried some Ipod/h264, h264/mp4, xvid/avi and they all 
worked fine.  However, when I tried NTSC DVD, the -f mpg didn't work because it is 
expecting -f dvd, however when I put -f dvd in the additional command line 
parameters box it didn't update the -f mpg, it just added another -f dvd to the end 
of the line.

Then I went into my presets file and put a -f dvd in the NTSC DVD profile, and again 
this didn't work, it just adds to the -f mpg.  So basically there is some problem 
where the -f xxx in the preset does NOT overwrite your -f xxx, it just adds to it.
Comment 8 by bggmtt, Dec 17, 2008
No, only the options that have their own inputs on the main window get replace. The
additional command line params just get added on. You can remove the '-f mpg' from
the preset's command line though.

The -f fmt should be set in the presets. I will have to start updating them. Each one
is different according ffmpeg version and author's intent. Automatically coding them
would be a major nightmare with new ffmpeg revisions.
Comment 9 by cpt_mo...@yahoo.com, Dec 17, 2008
Hi BiggMatt,

The issue I was trying to point out is that when using the 2 pass checkbox with
Paul's latest test version, it adds a "-f mpg" to the DVD preset, and there is no way
to override it.  Therefore, there is some problem with the way this test version was
implemented because Paul's added "-f xxx" are not getting overridden by what is
specified in my presets file or the additional command line parameters box.

In comment 6, Paul states:  "I propose that I add the extension with the -f option to
the beginning of the preset line for 2 pass, then any -f option in the preset will
overwrite my additional option"

Okay, that's great and should work, but when I tested it my presets.xml "-f xxx" are
NOT overwriting his "-f xxx", so there is some bug in this latest test implementation.
Comment 10 by cpt_mo...@yahoo.com, Dec 17, 2008
If it is easier, may I propose that a "format" input box be added to the main
interface and appear when the 2 pass checkbox is ticked?  Then the user can put in
his 3 letter format into the box and the "-f xxx" can be passed to both first and
second passes.

You also shouldn't change any of the presets, since -f xxx is only needed for 2 pass
encoding.
Comment 11 by cpt_mo...@yahoo.com, Mar 05, 2009
Hey all,

I was just wondering what happened to this issue.  What about my suggestion to make 
a "format" box.
Comment 12 by poipodec...@hotmail.com, Jul 11, 2009
As I won't do any coding that is not trivial fixing bugs again, I remove myself as
owner of this bug. The problem is too involved at the moment.
Status: Accepted
Owner: ---
Comment 13 by hungryhungryhobos, Sep 29, 2009
I usually just use "-f rawvideo" no matter the output format for the first pass as in:

ffmpeg -i INPUT -pass 1 -an <numerous options here> -f rawvideo -y /dev/null

I admit it needs some more through testing, but it has always worked for me just fine
with H.264 MP4 files.  No need for an extra "format" box.  I also moved the "-y" past
the input options so you know it refers to the output.  I doubt it makes a difference
but seems more of a standard way of doing things.
Sign in to add a comment

Hosted by Google Code