[mythtv-users] Problems ripping "RV" - how to transcode once it is ripped with another program?

Scott Alfter mythtv at salfter.dyndns.org
Mon Feb 19 18:49:57 UTC 2007


Jack Madison wrote:
> My problem is I am unable to transcode them for one reason or another.
> I've tried vlc, avidemux, mencoder, transcode, etc. and have yet to find
> a combination of options on any software that will produce a video in
> which the audio and video are in sync.

Try this...it works for me:

#!/bin/sh
nice -n 18 mencoder \
  -vf harddup \
  -ovc copy \
  -oac copy \
  -of rawaudio \
  -o "${2}.ac3" \
  "${1}" && \
nice -n 18 mencoder \
  -vf pullup,softskip,${3},harddup \
  -ofps 24000/1001 \
  -ovc x264 \
  -x264encopts \
    bitrate=1400:pass=1:turbo=2:keyint=240:bframes=3:direct_pred=auto \
  -oac copy \
  -o /dev/null \
  "${1}" && \
nice -n 18 mencoder \
  -vf pullup,softskip,${3},harddup \
  -ofps 24000/1001 \
  -ovc x264 \
  -x264encopts \
    bitrate=1400:pass=2:turbo=2:keyint=240:bframes=3:direct_pred=auto \
  -oac copy \
  -of rawvideo \
  -o "${2}.264" \
  "${1}" && \
nice -n 18 MP4Box "${2}.mp4" -fps 23.976 -add "${2}.264" && \
nice -n 18 mkvmerge -o "${2}.mkv" "${2}.mp4" "${2}.ac3" && \
rm "${2}.264" "${2}.ac3" "${2}.mp4"

$1 is the source file, $2 is the destination prefix (leave out the extension),
and $3 is the "crop=w:h:x:y" parameter returned by mplayer -vf cropdetect
foo.mpg.  If you want to use the entire frame, just use crop=720:480:0:0 (but
you'll get a better encode if you crop out any black borders).

In addition to mplayer (which provides mencoder), you'll need gpac (which
provides MP4Box) and mkvtoolnix (which provides mkvmerge).  The output is a
Matroska container with H.264 video and AC3 audio.

For a DVD with only 2-channel audio, you can transcode the audio to AAC and
save some more space:

#!/bin/sh
nice -n 18 mencoder \
  -vf harddup \
  -ovc copy \
  -oac faac \
  -faacopts br=128:mpeg=4
  -of rawaudio \
  -o "${2}.aac" \
  "${1}" && \
nice -n 18 mencoder \
  -vf pullup,softskip,${3},harddup \
  -ofps 24000/1001 \
  -ovc x264 \
  -x264encopts \
    bitrate=1400:pass=1:turbo=2:keyint=240:bframes=3:direct_pred=auto \
  -oac copy \
  -o /dev/null \
  "${1}" && \
nice -n 18 mencoder \
  -vf pullup,softskip,${3},harddup \
  -ofps 24000/1001 \
  -ovc x264 \
  -x264encopts \
    bitrate=1400:pass=2:turbo=2:keyint=240:bframes=3:direct_pred=auto \
  -oac copy \
  -of rawvideo \
  -o "${2}.264" \
  "${1}" && \
nice -n 18 MP4Box "${2}.mp4" -fps 23.976 \
  -add "${2}.264" -add "${2}.aac" && \
rm "${2}.264" "${2}.aac"

H.264 and AAC can be muxed together in an MPEG-4 container, so we use that.

  _/_
 / v \ Scott Alfter
(IIGS( http://alfter.us/            Top-posting!
 \_^_/ rm -rf /bin/laden            >What's the most annoying thing on Usenet?



More information about the mythtv-users mailing list