View Full Version : Problem with 2 pass encoding / x264
acdarc
2nd November 2009, 09:57
I have an issue with two pass encoding using ffdshow filter x264
I have a ~32GB raw video which i want to pack. Usually I've chosen the one pass - average bitrate, and it shrinks the file pretty well. However there is much movement and smooth surfaces so I see a lot of tiling. Even at high bitrates (I use around 2000k rate).
I tried the two-pass thingy, but the result is either a crash or a very very big file with no compression at all. Here's what I do:
I open the raw file, select the audio to 192kbit mp3, and video as so:
http://acd.ydinsota.net/vdub2.png
And from there I choose:
http://acd.ydinsota.net/vdub3.png
And Save as AVI...
It creates a massive file, and the e:\stats file. Then I choose:
http://acd.ydinsota.net/vdub1.png
Now firstly, what does that Size (kbytes) there mean? (Just below the Encoder-line)
Moving that doesnt seem to affect anything.
Then I click Ok and Save as AVI...
But it creates the exact same file as it did on the first pass, and its also a very large file. When I encode the same clip with one pass it makes a 5 meg file. On that two pass its 108megs. (I'm making tests on a small clip from the raw vid).
What am I doing wrong here? The video.stats-file is updated everytime I do the first pass.
Thank you for any assistance.
Vdub version is 1.9.6 and ffdshow is the latest stable.
Dark Shikari
2nd November 2009, 10:00
Start by using x264 proper and not that bastardized, outdated, broken VfW version. Use a fancy GUI if you have to (Staxrip, Ripbot264, etc).
acdarc
2nd November 2009, 10:04
Start by using x264 proper and not that bastardized, outdated, broken VfW version. Use a fancy GUI if you have to (Staxrip, Ripbot264, etc).
Ookay, how do I do that? When I follow the link to the x264 binaries from the 'start here'-post, I only get the x264.exe which I need to run from the windows prompt, and it doesn't read the raw file.
It just says its not a proper source file.
My source file is a raw output from Sony Vegas with PCM unpacked sound and raw video in .avi
Dark Shikari
2nd November 2009, 10:06
Ookay, how do I do that? When I follow the link to the x264 binaries from the 'start here'-post, I only get the x264.exe which I need to run from the windows prompt, and it doesn't read the raw file.
It just says its not a proper source file.
My source file is a raw output from Sony Vegas with PCM unpacked sound and raw video in .avix264 takes Avisynth input. Make an Avisynth script to source the file, e.g:
AviSource("file.avi").ConvertToYV12()
and use that script as input:
x264 input.avs -o output.mkv
Or just use one of the aforementioned GUIs.
acdarc
2nd November 2009, 10:15
x264 takes Avisynth input. Make an Avisynth script to source the file, e.g:
AviSource("file.avi").ConvertToYV12()
and use that script as input:
x264 input.avs -o output.mkv
Or just use one of the aforementioned GUIs.
Okay, thanks for the very quick reply :)
I'll try that, and after the smoke clears I'll come and ask for more help :).
acdarc
2nd November 2009, 16:57
x264 takes Avisynth input. Make an Avisynth script to source the file, e.g:
AviSource("file.avi").ConvertToYV12()
and use that script as input:
x264 input.avs -o output.mkv
Or just use one of the aforementioned GUIs.
.\x264.exe video.avs -o test.avi
Says:
x264 [error]: could not open input file 'video.avs'
The video.avs is in the same directory and consists one line:
AviSource("source1.avi").ConvertToYV12()
and source1.avi is in the same directory.
I got a 32bit XP Pro, and AviSynth says version 2.5 in the add/rem programs list.
poisondeathray
2nd November 2009, 17:06
Does your avs script preview ok in vdub, avsp or a media player?
Did you enable the appropriate decoder in the ffdshow vfw configuration? (If it's raw video, enable raw video, etc...)
acdarc
2nd November 2009, 17:34
Does your avs script preview ok in vdub, avsp or a media player?
Did you enable the appropriate decoder in the ffdshow vfw configuration? (If it's raw video, enable raw video, etc...)
No, VDub says Avisynth Script Open Failed.
But what's wrong with its? I checked from The Avisynth pages and it should be like:
AviSource("X:\...")
ConvertToYu12()
poisondeathray
2nd November 2009, 17:37
No, VDub says Avisynth Script Open Failed.
But what's wrong with its? I checked from The Avisynth pages and it should be like:
AviSource("X:\...")
ConvertToYu12()
Should be ConvertToYV12() not "Yu12()"
Use mediainfo on your source file, identify the format
Enable it in the ffdshow vfw configuration (gold icon)
Snowknight26
2nd November 2009, 17:39
Uh, you shouldn't be needing to touch the VfW config. Isn't that the point of the replies?
acdarc
2nd November 2009, 17:41
Should be ConvertToYV12() not "Yu12()"
Use mediainfo on your source file, identify the format
Enable it in the ffdshow vfw configuration (gold icon)
Yeah noticed, was just typoed here.
Now x264 says:
avis [error]: unsupported input format (DIB )
x264 [error]: could not open...
Mediainfo says:
AVI (OpenDML)
1 video stream: RGB
1 audio stream: PCM (Microsoft)
nurbs
2nd November 2009, 17:47
Open the script in a media player and tell us what it says.
acdarc
2nd November 2009, 17:50
Open the script in a media player and tell us what it says.
Script error: there is no function named "ConvertToYV12"
I re-installed AviSynth 2.08 and tried again, same msg.
poisondeathray
2nd November 2009, 17:52
Uh, you shouldn't be needing to touch the VfW config. Isn't that the point of the replies?
Why not? x264 won't accept RGB, and non planar YUY formats
You need a decoder for AVISource() which relies on VFW
OP has suggested that this is a raw format from Vegas, so you need an appropriate decoder
http://img509.imageshack.us/img509/7778/19436850.th.jpg (http://img509.imageshack.us/i/19436850.jpg/)
poisondeathray
2nd November 2009, 17:52
Script error: there is no function named "ConvertToYV12"
I re-installed AviSynth 2.08 and tried again, same msg.
Use a recent stable build i.e. v2.57
BTW You could have used a lossless format to export from vegas e.g. lagarith, huffyuv, and save lots of disc space
or even debugmode frameserver from vegas
kemuri-_9
2nd November 2009, 18:05
YV12 colorspace support was not added until 2.5.0,
you need to use a 2.5.x or later version to be able to use avisynth input with x264.
acdarc
2nd November 2009, 18:08
Use a recent stable build i.e. v2.57
BTW You could have used a lossless format to export from vegas e.g. lagarith, huffyuv, and save lots of disc space
or even debugmode frameserver from vegas
I tried with that huffyuv and it worked fine :). The second problem is sound. It seems to lose that when encoding. It needs another option to avisynth?
Dark Shikari
2nd November 2009, 18:11
I tried with that huffyuv and it worked fine :). The second problem is sound. It seems to lose that when encoding. It needs another option to avisynth?x264 is a video encoder; you need to use an audio encoder to encode the sound ;)
Though I might note that x264 may Soon support audio encoding natively...
acdarc
2nd November 2009, 18:12
x264 is a video encoder; you need to use an audio encoder to encode the sound ;)
Though I might note that x264 may Soon support audio encoding natively...
I mean if I use Vegas to crunch the sound to mp3, is there a way to just copy it along compressing with x264? Or do I need to like export the .wav file and use vdub with direct stream copy etc?
Dark Shikari
2nd November 2009, 18:14
I mean if I use Vegas to crunch the sound to mp3, is there a way to just copy it along compressing with x264? Or do I need to like export the .wav file and use vdub with direct stream copy etc?For MKV, you can just use mkvmerge; drop your video and audio streams in, mux, and you're good to go. For MP4, use YAMB.
poisondeathray
2nd November 2009, 18:15
If you exported the audio separately , you can multiplex the exported audio track with the video at a later stage
e.g. mp4box (yamb) for .mp4
e.g. mkvmerge for .mkv
If you exported WAV from vegas along with the huffyuv AVI, some gui's allow will do this all for you (encode video, audio and multiplex)
EDIT: DS too quick :)
acdarc
2nd November 2009, 18:23
For MKV, you can just use mkvmerge; drop your video and audio streams in, mux, and you're good to go. For MP4, use YAMB.
Yeh, the problem is that I need to edit the sounds a bit. Different tracks mixed, multiple sound effects etc. I guess I need to first export the video and audio to different tracks, then process the video with x264 and add the sound with YAMB :).
Well, the quality vs size is so awesome its worth the manual labour.
Thanks for your assistance :).
acdarc
2nd November 2009, 19:01
x264 is a video encoder; you need to use an audio encoder to encode the sound ;)
Though I might note that x264 may Soon support audio encoding natively...
Btw just as a PS, a direct stream copy of the audio track for starters would be like .. very nice :).
And thanks again for your (and everyone else's aswell) assistance, record quick replys and an awesome job on this project :).
LoRd_MuldeR
2nd November 2009, 19:32
Though I might note that x264 may Soon support audio encoding natively...
More info please :)
smok3
2nd November 2009, 19:44
More info please :)
well, its november, so it must be real? more info!
J_Darnley
2nd November 2009, 23:50
More info please :)
well, its november, so it must be real? more info!
From what I understand, the idea is to use libav to read any video, encode the video and encode the audio and finally to produce a finished, muxed video that can be played without further work.
Think of the x264 equivalent of ffmpeg2theora, an improved/simpler way to encode using the library in question.
But that is way off, the initial plan is to use libav to decode the video from a file and use that instead of avisynth or a pipe.
tl;dr LURK MOAR
kypec
3rd November 2009, 06:48
Reading input video+audio files directly is not very appealing to me. :( I hoped DS had something like AAC (LC/HEv1/HEv2) encoder engine on his mind when talking about x264 audio abilities!
Dark Shikari
3rd November 2009, 08:58
Reading input video+audio files directly is not very appealing to me. :( I hoped DS had something like AAC (LC/HEv1/HEv2) encoder engine on his mind when talking about x264 audio abilities!libavcodec will be used for AAC, Vorbis, and possibly MP3 audio encoding.
buzzqw
3rd November 2009, 10:27
Though I might note that x264 may Soon support audio encoding natively...
:eek: :eek: any ETA ?
BHH
juGGaKNot
3rd November 2009, 10:46
He just loves messing with us ... first weightp now aac/mp3/no avisynth and muxing.
JEEB
3rd November 2009, 11:07
All of those things have been under work, though. Weightp had a long road but it's certainly coming to one of its final stations soon. And you can guess why the muxing etc. code was separated, right?
Also, although I lately mostly use 64bit x264 and 32bit avs via avs2yuv, I'm still happy about the plans of making x264 support avisynth input via something else than the current vfw implementation.
smok3
3rd November 2009, 20:57
From what I understand, the idea is to use libav to read any video, encode the video and encode the audio and finally to produce a finished, muxed video that can be played without further work.
Think of the x264 equivalent of ffmpeg2theora, an improved/simpler way to encode using the library in question.
But that is way off, the initial plan is to use libav to decode the video from a file and use that instead of avisynth or a pipe.
tl;dr LURK MOAR
:thanks: sounds more than just good (still making avisynth-like syntax platform in-depended would be really interesting)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.