Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
4th November 2010, 20:02 | #1 | Link |
Registered User
Join Date: Sep 2010
Posts: 46
|
FFmpeg : 2-Pass encoding - Xvid vs h264
Hi all !
I think I once saw this kind of question asked once on this forum, but I couldn't find it back. And anyways I believe no clear answer had been given on this particular subject, so I prefer to ask it again. So I'm trying to test 2-pass encoding, and I'm having a hard time juste making my command lines work in FFmpeg. First, here are the command lines I use. The first ones were to encode to Xvid : Code:
ffmpeg.exe -y -i "C:/Documents and Settings/user/Desktop/video test/big_buck_bunny.avi" -pass 1 -passlogfile 2passtry.log -threads 2 -vcodec libxvid -vtag XVID -f mp4 -aspect 16:9 -r 25 -s 1280x720 -b 2000kb -minrate 2000kb -maxrate 2000kb -bufsize 2048k -an "C:/Documents and Settings/user/Desktop/video test results/bbb_2pass_tryr2_1.mp4" ffmpeg.exe -y -i "C:/Documents and Settings/user/Desktop/video test/big_buck_bunny.avi" -pass 2 -passlogfile 2passtry.log -threads 2 -vcodec libxvid -vtag XVID -f mp4 -aspect 16:9 -r 25 -s 1280x720 -b 2000kb -minrate 2000kb -maxrate 2000kb -bufsize 2048k -acodec libfaac -ac 2 -ab 128kb -ar 44100 "C:/Documents and Settings/user/Desktop/video test results/bbb_2pass_tryr2_1.mp4" Code:
ffmpeg.exe -y -i "C:/Documents and Settings/user/Desktop/video test/big_buck_bunny.avi" -pass 1 -passlogfile 2passtry.log -threads 2 -vcodec libx264 -f mp4 -aspect 16:9 -r 25 -s 1280x720 -b 512kb -minrate 512kb -maxrate 512kb -bufsize 2048k -an "C:/Documents and Settings/user/Desktop/video test results/bbb_2pass_tryr2_1.mp4" ffmpeg.exe -y -i "C:/Documents and Settings/user/Desktop/video test/big_buck_bunny.avi" -pass 2 -passlogfile 2passtry.log -threads 2 -vcodec libx264 -f mp4 -aspect 16:9 -r 25 -s 1280x720 -b 512kb -minrate 512kb -maxrate 512kb -bufsize 2048k -acodec libfaac -ac 2 -ab 128kb -ar 44100 "C:/Documents and Settings/user/Desktop/video test results/bbb_2pass_tryr2_1.mp4" As you can see, both sets are fairly similar, except for the -vcodec. When I run the Xvid lines, it works perfectly. But when I run the h264 lines, it won't process the 2nd pass. Instead the command prompt will give me : [libx264 @ 0x1725010]using SAR=1/1 [libx264 @ 0x1725010]using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.2 And then stop and prevent me from writing anything more in the window. Also, my .log file is empty (don't know if it's normal)... Any idea why it would do that ? Note that I only use Windows' command prompt. I don't know if some GUIs are made to circumvent this problem, but I don't use any and don't really intend to... Last edited by Klagar; 4th November 2010 at 20:03. Reason: Error in the code |
4th November 2010, 20:35 | #3 | Link |
Registered User
Join Date: Sep 2010
Posts: 46
|
In fact I did follow the guide. At first.
First the -vpre parameter didn't work for me because I don't know where the .ffpreset files are supposed to be. I found people with the same problem, tried their solutions, but they didn't work in my particular build, and right now I don't have either the time or the skill to rebuild my FFmpeg and retry. So I simply tested the lines without the -vpre : Code:
ffmpeg -y -i INPUT -an -pass 1 -vcodec libx264 -b 15000kb -bt 15000kb -threads 0 OUTPUT ffmpeg -y -i INPUT -acodec libfaac -ab 128k -pass 2 -vcodec libx264 -b 15000kb -bt 15000kb -threads 0 OUTPUT Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height I asked around for explanations/solutions, and the best I came up with is this guy who gave me his lines, which I presented in my last post, pretending they worked for him, and I decided to give it a try. So maybe you can help me demystify what goes wrong with Swain's lines ? That would be at the very least as good as figuring out the first lines I presented. Though I would also appreciate if someone could clarify why my first commands worked with Xvid but didn't with h264. BTW, sorry if I give a lot of code and write large messages, but I want to give as much detail as possible so nobody has to ask me for more, and I don't always know exactly what info you might need to better understand where my errors lie... |
4th November 2010, 20:38 | #4 | Link | ||
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
Quote:
[libx264 @ 01891220] broken ffmpeg default settings detected [libx264 @ 01891220] use an encoding preset (vpre) |
||
4th November 2010, 21:05 | #5 | Link | ||
Registered User
Join Date: Sep 2010
Posts: 46
|
Quote:
I use version 0.5. Has there been such a major update since ? I'll look up if I can update to the latest version. But in the environment I'm in, it's just not the most optimal solution at the present time, because the group I work for uses version 0.5 and it would be very time- and resource-consuming to change it. So I'll see what arguments I can find (other than "being up to date") to convince them to update. But in the meantime, if a solution can be found that doesn't require it, that'd be the best. Quote:
[libx264 @ 0x177d010]using SAR=1/1 [libx264 @ 0x177d010]using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.2 [libx264 @ 0x177d010]ratecontrol_init: can't open stats file Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height I found nowhere the warning you mention... |
||
4th November 2010, 21:09 | #6 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
|
|
4th November 2010, 22:22 | #8 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
Latest can be current SVN if you build it yourself. But r25669 is recent enough.
Quote:
|
|
4th November 2010, 22:37 | #9 | Link |
Registered User
Join Date: Sep 2010
Posts: 46
|
Thought so, it's just that I am currently greatly misled by developpers who used FFmpeg without knowing really what they were doing, and someone assured me that SVN version were for Windows, and others were made for Linux.
So thank you for removing yet one more doubt from my mind ! Also, thanks so much Dark Shikari, thanks for your patience, I downloaded (what I believe is) the latest version and it worked just fine... Except for some details, but I'll figure it out. I will still have many questions in the future, but I think much of the info I'll dig out by myself from the web will make much more sense. Much of my concern was that the SVN version would not work on Linux. That being clear, I will proceed to encouraging my department to update to the latest version possible. |
4th November 2010, 22:52 | #10 | Link |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
I'm guessing that the admins like to use a distribution-packaged version, which is usually 1 to 3 years old. It saves them trouble, but since FFmpeg is critical for your work, a newer version is definitely necessary.
|
Tags |
2-pass, ffmpeg, h264, x264, xvid |
Thread Tools | Search this Thread |
Display Modes | |
|
|