Wednesday, May 03, 2006

ProjectX, avidemux2, HDTV to DVD encode HOWTO

Issue: PC with fastest CPU has low-resolution plasma (it's the myth frontend). Need high res monitor.
Fix: use 'ssh -Y myfrontend' and remotely view X11 apps on a hi res monitor. Don't do 'ssh -X' with gtk apps like avidemux. You'll get error:

The program 'avidemux2' received an X Window System error.
The error was 'BadWindow (invalid Window parameter)'.

Use projectx in command line mode to demux mythtv .nuv file. This also corrects audio sync and other minor errors commonly found in OTA atsc recordings.

cd ~/tmp_jre/jre1.5.0_06/bin
# ./java -jar ~/tmp3/ProjectX_Source_0.90.3/ProjectX.jar -out /mythtv -name scrubs_demux /mnt/1041_20060425210000_20060425213000.nuv
(/mnt is nfs mount of the backend's recordings dir)

To find the .nuv files and map them to human names like 'Tonight Show with Jay Leno', use the mythls script blogged earlier.

projectx will give you audio and video files:

-rw-r--r-- 1 root root 42732288 May 2 16:09 scrubs_demux.ac3
-rw-r--r-- 1 root root 4055 May 2 16:09 scrubs_demux_log.txt
-rw-r--r-- 1 root root 2230187930 May 2 16:09 scrubs_demux.m2v

We need to convert (encode) the video/m2v file to DVD standard resolution with avidemux2.

Issue: Using avidemux2 with hdtv results in avidemux's window being so large that you can't see the bottom portion where the navigation/cutting controls are.
Fix: Make a large 2667x2000 virtual desktop in your xorg.conf. I did this:

SubSection "Display"
Viewport 0 0
Depth 16
Modes "1024x768" "800x600" "640x480"
Virtual 2667 2000
EndSubSection

I tried to run avidemux2 in cli mode, but gave up and tried gui mode first.

It wouldn't run because it requires X11 and GTK2 (gtk+). And that requires X11 forwarding over ssh and that failed because I was missing ssh switch '-X' and that failed because gtk apps need ssh switch '-Y'. sheesh. anyway, run avidemux gui. Then followed this guide:

http://forum.videohelp.com/viewtopic.php?t=242455

Optionally, check the video info for the file created by avidemux2:

[root@be mythtv]# mplayer -vo dummy -ao dummy -identify scrubs_avidemuxOutput 2>&1 | grep VIDEO
ID_VIDEO_ID=0
VIDEO: MPEG2 720x480 (aspect 3) 29.970 fps 7800.0 kbps (975.0 kbyte/s)
ID_VIDEO_FORMAT=0x10000002
ID_VIDEO_BITRATE=7800000
ID_VIDEO_WIDTH=720
ID_VIDEO_HEIGHT=480
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=1.7778

Mux the audio and video files to a single .mpg:

# mplex -f 8 -V -o scrubs.mpg scrubs_demux.ac3 scrubs_avidemuxOutput

Author a basic dvd:
dvdauthor -o dvd -x dvd.xml

Where .xml is:
<dvdauthor>
<vmgm />
<titleset>
<titles>
<audio lang="en" />
<pgc>
<vob file="scrubs.mpg" chapters="0,10:00,15:00,20:00" />
</pgc>
</titles>
</titleset>
</dvdauthor>

Or you could do two titles on one disc:

<titles>
<video widescreen="nopanscan" />
<pgc>
<vob file="source-1.mpg" chapters="0,0:30,1:00,1:30,2:30,3:00,3:30,4:00"/>
<post> jump title 2; </post>
</pgc>

<pgc>
<vob file="source-2.vob" chapters="0,0:30,1:00,1:30,2:30,3:00,3:30,4:00"/>
<post> call menu; </post>
</pgc>
</titles>

The above has some more advanced dvd authoring tags. See:
http://gentoo-wiki.com/HOWTO_Create_a_DVD:Filesystem

Good output of dvdauthor:

[root@be mythtv]# dvdauthor -o mars_dvd -x dvd_mars.xml
DVDAuthor::dvdauthor, version 0.6.11.
Build options: gnugetopt magick iconv freetype fribidi
Send bugs to

INFO: Locale=en_US.UTF-8
INFO: Converting filenames to UTF-8
INFO: dvdauthor creating VTS
STAT: Picking VTS 01

STAT: Processing mars.mpg...
STAT: VOBU 8560 at 640MB, 1 PGCS
INFO: Video pts = 0.178 .. 3594.568
INFO: Audio[0] pts = 0.178 .. 3594.706
STAT: VOBU 8562 at 641MB, 1 PGCS
INFO: Generating VTS with the following video attributes:
INFO: MPEG version: mpeg2
INFO: TV standard: ntsc
INFO: Aspect ratio: 16:9
INFO: Resolution: 720x480
INFO: Audio ch 0 format: ac3/2ch, 48khz drc

STAT: fixed 8562 VOBUS
INFO: dvdauthor creating table of contents
INFO: Scanning mars_dvd/VIDEO_TS/VTS_01_0.IFO


Play dvd from hard drive:
mplayer dvd:// -dvd-device ./dvd -fs -zoom -vo xv -ao alsa:device=hw=1.0
or
mplayer dvd://1 -dvd-device ./dvd -fs -zoom -monitoraspect 16:9 -vo xv -ao alsa:device=digital2c -aid 128

Instead of "-aid 128" can also try "-alang en"
Your alsa device will be different than mine.

Normally my dvd device is "-dvd-device /dev/hdb" (dvdrom drive).

Versions:

[root@be ~]# rpm -qa | grep gtk
gtkhtml2-2.6.2-1
gtk+-1.2.10-33
gtk2-2.4.14-4.fc3.3
gnome-python2-gtkhtml2-2.6.0-3
gtk2-devel-2.4.14-4.fc3.3
usermode-gtk-1.74-1
gtk+-devel-1.2.10-33
pygtk2-2.4.0-1
authconfig-gtk-4.6.5-3.1
pygtk2-libglade-2.4.0-1
gtkspell-2.0.7-2

[root@be ~]# rpm -qa | grep avidemux
avidemux2-2.0.40-1.1.fc3.rf

[root@be ~]# rpm -qf /usr/bin/mplex
mjpegtools-1.6.2-4.1.fc3.rf

[root@be ~]# rpm -qf /usr/bin/dvdauthor
dvdauthor-0.6.11-1.1.fc3.rf

I tried to compile the latest avidemux2, but it required gtk 2.6 and I couldn't find a good yum package for gtk 2.6 on Fedora Core 3. So just went back to using this yum version of avidemux2 (from DAG).

References:
http://www.linux.com/article.pl?sid=06/04/17/2058219
http://www.linuxquestions.org/questions/showthread.php?s=&postid=1228258
http://forum.videohelp.com/viewtopic.php?t=242455

0 Comments:

Post a Comment

<< Home