Log in

View Full Version : x264 64bit=shorter video


Bob65536
1st July 2009, 19:53
I am creating a process to start converting my DVD library to files. This is the process I have developed so far.

1. Rip with DVDFab. Main title, remove subtitles, only 5.1 eng audio.
2. DGIndex. Demux audio and create project file.
3. AVS template.

LoadPlugin("DGDecode.dll")
MPEG2Source("tempdir\video.d2v")
TFM().TDecimate()
colormatrix()

4. x264 pass 1. Options based on Sharktooth's Unrestricted 2pass HQ profile.

32bit
x264-32 --pass 1 --bitrate 1500 --stats "tempdir\stats.txt"
--ref 5 --mixed-refs --bframes 3 --b-adapt 2 --b-pyramid
--weightb --direct auto --deblock -1:-1 --subme 7 --trellis 2
--partitions all --8x8dct --me umh --threads auto
--thread-input --progress --no-psnr --no-ssim --output NUL
video.avs

64bit
pipebuf.exe avs2yuv.exe video.avs -raw - : x264-64 --pass 1
--bitrate 1500 --stats "tempdir\stats.txt" --ref 5 --mixed-refs
--bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto
--deblock -1:-1 --subme 7 --trellis 2 --partitions all --8x8dct
--me umh --threads auto --thread-input --progress --no-psnr
--no-ssim --output NUL - 720x480 : 4

5. x264 pass 2. Same as pass 1 except for the pass and output parameters.
6. mkvmerge -o tempdir\final.mkv --aspect-ratio 1:16/9 tempdir\video.mkv tempdir\audio.ac3

I was experimenting with this process and I successfully encoded some video files on a P4 running WinXP SP3. Long story short I got a new i7 running Vista64 SP2 a couple days ago. I added the 64bit step because the 64bit version of x264 seemed to run about 15% faster and I have about 250 DVDs to encode.

The problem is that when I encode the movies with the 64bit version the movies are about 5 minutes shorter for a 2 hour movie. When I remux the audio I get a 1.5GB piece of crap.

I'm not sure if the problem is in the 64bit build of x264 or if its the way I'm serving it frames. I noticed that if I demux the audio and video with DGIndex the video is always shorter than the audio. Since the 32bit version works I assume that isn't a problem.

Also, if anyone has any modifications to my process I would appreciate it. The reason I'm not using a GUI is because I'm going to write my own when I get everything finalized so that I can queue movies and serve them to several computers on my LAN. Thanks for any help.

LoRd_MuldeR
1st July 2009, 20:24
Does it also happen if you don't use pipebuf.exe ???

Bob65536
1st July 2009, 21:34
I just encoded a clip using:

avs2yuv.exe video.avs -raw - | x264-64.exe --pass 1 --bitrate
1500 --stats "C:\Users\Bob\Desktop\TempDVD\stats.txt" --ref 5
--mixed-refs --bframes 3 --b-adapt 2 --b-pyramid --weightb
--direct auto --deblock -1:-1 --subme 7 --trellis 2 --partitions all
--8x8dct --me umh --threads auto --thread-input --progress
--no-psnr --no-ssim --output NUL - 720x480

Same problem, video shorter than the audio. Thanks for the suggestion though I didn't think of that.

Sude
1st July 2009, 22:44
when piping raw with avs2yuv to x264, it doesn't know the input fps
IIRC x264 assumes 25fps
I'm assuming you have 23.976fps input
2 hour movie at 23.976fps played at 25fps: (23.976fps/25fps)*120min=115min

mux with mkvmerge -o tempdir\final.mkv --aspect-ratio 1:16/9 --default-duration 1:24000/1001fps tempdir\video.mkv tempdir\audio.ac3
or add --fps 24000/1001 to your x264 commandline

Bob65536
1st July 2009, 23:48
That did it. Thanks for your help. Is it safe to assume that every US store bought DVD will be 24000/1001 fps?

DGIndex records the fps in the d2v file, but it doesn't record the correct fps. For the video I am testing d2v says 30000/1001. If it is necessary to determine the fps for every DVD is there an easy way to find it?

LoRd_MuldeR
2nd July 2009, 00:18
That did it. Thanks for your help. Is it safe to assume that every US store bought DVD will be 24000/1001 fps?

All cinema movies should be 24.0 fps, respectively 23.976 fps. TV productions should be 29.97 (NTSC/US) or 25.0 fps (PAL/Europe).