jdratlif
26th August 2010, 23:11
I'm trying to reencode videos from my TiVo to reduce filesize using h.264 video and ogg/vorbis audio. I would also like to cut the commercials out.
I've been using comskip to find the commercials. It creates edl files, which can be used with mplayer or mencoder.
I would like to use x264 and oggenc with audio/video piped from mplayer (to take advantage of scaling, deinterlacing, edl list). So I've been trying this:
mkfifo audio_fifo.wav video_fifo.y4m
oggenc -q 4 audio_fifo.wav -o audio.ogg &
x264 --crf 25 --threads auto video_fifo.y4m -o video.264 &
mplayer hd1080i_ntsc.mpg -ao pcm:file=audio_fifo.wav -vo yuv4mpeg:file=video_fifo.y4m -edl commercials.edl -vf pp=lb,scale=960:540
MP4Box -fps 29.97 -add video.264 -add audio.ogg hd1080i_ntsc.mp4
I got the idea from http://sites.google.com/site/linuxencoding/x264-encoding-guide
But the audio/video isn't quite in sync. It's just a little off.
I don't know what options to pass to mencoder to use it. Maybe someone could tell me what to fill in the x264encopts for the x264 High Profile Level 3.1 from the most recent x264. If I just used crf=25:threads=auto, would that work? Is it the same or am I leaving out things?
I'm open to other suggestions as well. I was thinking I could use mencoder to cut the video, and then something else to encode it.
I tried to use ffmpeg without cutting the commercials, but it gave me a broken file. It worked for the first 35 minutes, but was unplayable after that. I wasn't sure if it was because the video dimensions changed (comcast digital cable seems to do that a lot during the commercials) or if there was another reason.
I've been using comskip to find the commercials. It creates edl files, which can be used with mplayer or mencoder.
I would like to use x264 and oggenc with audio/video piped from mplayer (to take advantage of scaling, deinterlacing, edl list). So I've been trying this:
mkfifo audio_fifo.wav video_fifo.y4m
oggenc -q 4 audio_fifo.wav -o audio.ogg &
x264 --crf 25 --threads auto video_fifo.y4m -o video.264 &
mplayer hd1080i_ntsc.mpg -ao pcm:file=audio_fifo.wav -vo yuv4mpeg:file=video_fifo.y4m -edl commercials.edl -vf pp=lb,scale=960:540
MP4Box -fps 29.97 -add video.264 -add audio.ogg hd1080i_ntsc.mp4
I got the idea from http://sites.google.com/site/linuxencoding/x264-encoding-guide
But the audio/video isn't quite in sync. It's just a little off.
I don't know what options to pass to mencoder to use it. Maybe someone could tell me what to fill in the x264encopts for the x264 High Profile Level 3.1 from the most recent x264. If I just used crf=25:threads=auto, would that work? Is it the same or am I leaving out things?
I'm open to other suggestions as well. I was thinking I could use mencoder to cut the video, and then something else to encode it.
I tried to use ffmpeg without cutting the commercials, but it gave me a broken file. It worked for the first 35 minutes, but was unplayable after that. I wasn't sure if it was because the video dimensions changed (comcast digital cable seems to do that a lot during the commercials) or if there was another reason.