Sitron
20th May 2008, 22:18
I am trying to convert a range of DVDs to MP4 so I can play it on my PS3. However, since the PS3 sees everything as media-files (not DVD's) it will not deinterlace and such, so I need to do it.
Now I have a file ($FILE.vob) which is NTSC and telecined. (I checked following step 14.2.2.2 on http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-telecine.html)
I encode it (3-pass) with this line: mencoder $FILE.vob -vf pullup,softskip -ovc x264 -x264encopts $X264PASS3 -passlogfile $FILE.log -oac pcm -ofps 24000/1001 -o $FILE.avi (For 1st and 2nd pass the line is the same except -o is /dev/null)
When I play this movie, everything seems fine. The video is H.264, running at 23.976 FPS and the audio is in sync. However, it's in an AVI-container, so I need encode the sound to aac and mux this into an mp4.
Extract the video: mencoder $FILE.avi -ovc copy -oac copy -of rawvideo -o $FILE.h264
Extract the audio: mplayer $FILE.avi -ao pcm:file=$FILE.wav -vc dummy -vo null -channels 2
Encode the audio: neroAacEnc -q 0.8 -lc -if $FILE.wav -of $FILE.aac
Mux them to a MP4: MP4Box -add $FILE.h264#video -add $FILE.aac#audio -fps 23.976 -new $FILE.mp4
However, when playing this new .mp4-file the audio and video start off in sync, but the video seems to have a faster speed. So at the end the video is finished before the audio.
But why? Is there any obvious errors with my commands, have I overlooked something? Or is there a different way of doing this (without ditching NeroAacEnc)?
Some additional info: $FILE.avi is 254.2 seconds (6094 frames), $FILE.mp4 is 252.6 seconds (6057 frames) according to MPlayer. Both are at 23.976 fps. MPlayer also states that the $FILE.avi is [h264], but the .mp4 is [avc1]
Now I have a file ($FILE.vob) which is NTSC and telecined. (I checked following step 14.2.2.2 on http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-telecine.html)
I encode it (3-pass) with this line: mencoder $FILE.vob -vf pullup,softskip -ovc x264 -x264encopts $X264PASS3 -passlogfile $FILE.log -oac pcm -ofps 24000/1001 -o $FILE.avi (For 1st and 2nd pass the line is the same except -o is /dev/null)
When I play this movie, everything seems fine. The video is H.264, running at 23.976 FPS and the audio is in sync. However, it's in an AVI-container, so I need encode the sound to aac and mux this into an mp4.
Extract the video: mencoder $FILE.avi -ovc copy -oac copy -of rawvideo -o $FILE.h264
Extract the audio: mplayer $FILE.avi -ao pcm:file=$FILE.wav -vc dummy -vo null -channels 2
Encode the audio: neroAacEnc -q 0.8 -lc -if $FILE.wav -of $FILE.aac
Mux them to a MP4: MP4Box -add $FILE.h264#video -add $FILE.aac#audio -fps 23.976 -new $FILE.mp4
However, when playing this new .mp4-file the audio and video start off in sync, but the video seems to have a faster speed. So at the end the video is finished before the audio.
But why? Is there any obvious errors with my commands, have I overlooked something? Or is there a different way of doing this (without ditching NeroAacEnc)?
Some additional info: $FILE.avi is 254.2 seconds (6094 frames), $FILE.mp4 is 252.6 seconds (6057 frames) according to MPlayer. Both are at 23.976 fps. MPlayer also states that the $FILE.avi is [h264], but the .mp4 is [avc1]