LinHES Forums
http://forums.linhes.org/

HOWTO - MythArchive OTA NTSC HDTV to DVD Audio Synched
http://forums.linhes.org/viewtopic.php?f=15&t=15764
Page 1 of 1

Author:  lantz [ Tue Jul 03, 2007 12:09 am ]
Post subject:  HOWTO - MythArchive OTA NTSC HDTV to DVD Audio Synched

Ok, after working on and off trying to figure this out for about a year, I've finally put together a list of modifications for MythArchive to support OTA HDTV without losing audio sync (or audio all together). I'd love if other people can try it out and see if it works for them too. If so, I'll clean it up and add it to the wiki.

The one caveat is that the only way I could get it to work reliably was to add VideoReDo into the process. The problem isn't that it's a windows program, because it runs ok in WINE, the problem is that it does cost $50. To me, that's well worth it. There's a free 14 day trial so you can try this without any risk (no, I have no affiliation with VideoReDo, it just works). I really wanted ProjectX to work better for this task, but the author doesn't plan to support NTSC fully and my attempts to modify it myself were derailed.

Make sure that you only run commands that need root access (apt-get, etc) as root. Run everything else as mythtv so when the script runs it has permissions.

Anyways, on to the show:
------------------------------------------
1) install java from java.sun.com

2) download ProjectX_Source_0.90.4.00 from http://sourceforge.net/projects/project-x
unzip ProjectX_Source_eng_0.90.4.00.zip to /myth/tools

3) Install WINE - http://www.winehq.org/
su
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo wget http://wine.budgetdedicated.com/apt/sou ... /etch.list -O /etc/apt/sources.list.d/winehq.list
apt-get install wine
run "wine" once as mythtv to create the directory structure

4) Install cscript.exe for WINE to use
Might need changes if you're not using a dual windows/linux box
cp mfc42.dll /home/mythtv/.wine/drive_c/windows/system32
regsvr32 mfc42.dll
wine WindowsXP-Windows2000-Script56-KB917344-x86-enu.exe

5) Install - VideoReDo
download from - http://www.videoredo.com/index.html
wine VideoReDoPlus-2-5-6-512.exe
let wine install the gecko app it wants to
turn off "show tips at startup" <- important
get a trial key and add it
NOTE IF YOU DON'T USE A KEY IT WILL CUT FILES OFF AT AROUND 10 MINUTES

6) Modify mythburn script
cd /usr/share/mythtv/mytharchive/scripts/
cp mythburn.py mythburn.py.bak
edit mythburn.py so the function deMultiplexMPEG2File looks like this:

Code:
def deMultiplexMPEG2File(folder, mediafile, video, audio1, audio2):
    checkCancelFlag()

    command = "wine cscript //nologo \"C:\\Program Files\\VideoReDoPlus\\vp.vbs\" %s/newfile2.mpg %s/fixed.mpg /q /na /t1 /e" % (folder,folder)
    write("Running: " + command)
    result = os.system(command)

    if result<>0:
        fatalError("Failed while running VideoReDo. Command was %s" % command)

    command = "java -jar /myth/tools/ProjectX_Source_0.90.4/ProjectX.jar -name stream %s/fixed.mpg" % (folder)

    write("Running: " + command)
    result = os.system(command)

    if result<>0:
        fatalError("Failed while running ProjectX. Command was %s" % command)

    command = "mv %s/stream.m2v %s/stream.mv2" % (folder,folder)
    write("Running: " + command)
    os.system(command)
    command = "mv %s/stream.ac3 %s/stream0.ac3" % (folder,folder)
    write("Running: " + command)
    os.system(command)
    command = "mv %s/stream[1].ac3 %s/stream1.ac3" % (folder,folder)
    write("Running: " + command)
    os.system(command)


7) Update encoder profiles

cd /usr/share/mythtv/mytharchive/encoder_profiles
cp ffmpeg_dvd_ntsc.xml ffmpeg_dvd_ntsc.xml.bak
edit each of the profiles for these changes:
add:
<parameter name="-deinterlace" value=""/>
<parameter name="-vsync" value="1000"/>
<parameter name="-async" value="0"/>
remove:
<parameter name="-copyts" value=""/>

----------------------------------------------------------

Open Issues:
1) Would it make more sense to run VideoReDo before ffmpeg gets ahold of the file?
2) is -vsync 1000 / -async 0 the best options for ffmpeg
3) would -genpts help?
4) would mythtranscode be able to handle demux'ing after VideoReDo? Right now it's ProjectX because I trust it way more.

Author:  mihanson [ Tue Jul 03, 2007 7:41 am ]
Post subject: 

I'm confused as to why all this is necessary. I've never had an issue with ATSC HD signals getting to a DVD using mytharchive... For, me, "it just works." :)

Author:  lantz [ Tue Jul 03, 2007 7:46 am ]
Post subject: 

mihanson wrote:
I'm confused as to why all this is necessary. I've never had an issue with ATSC HD signals getting to a DVD using mytharchive... For, me, "it just works." :)


For OTA?

Mine's never worked out of the box. When the stream is demuxed audio sync goes out the window in a big way.

I know I'm not the only one, but it's good that it works for you.

Author:  bruce_s01 [ Tue Jul 03, 2007 8:47 am ]
Post subject: 

I don't know if this is related to the problem you were having, but I had a set of DVB-T recordings from an earlier KM install which I had to top and tail to cut to the programme itself. In addition select the correct soundtrack.
So following the instructions for avidemux, I used projectX to demux, mplex to remux, then avidemux to cut out the excess material. When I saved out as MPEG-PS (A+V) then copied over to the Mythbox to burn as a video. It played back OK under Kaffeine on my Kubuntu box, and it played back OK on the KM box. But when using the MythArchive to burn the video to disk, the sound sync was all over the place.
So just as a test I saved the file out as a MPEG-TS (A+V) and MythArchive worked OK with those files.
So I'm wondering if your files are ending up as PS files rather than TS.

Does anyone know a programme that is already installed on KM that would allow him to identify the files?

Bruce S.

Author:  mihanson [ Tue Jul 03, 2007 2:23 pm ]
Post subject: 

lantz wrote:
For OTA?


Yes.

:)

Author:  lantz [ Tue Jul 03, 2007 5:05 pm ]
Post subject: 

bruce_s01 wrote:
I used projectX to demux


This won't work in my case because projectX can't handle the demux until VideoReDo has fixed it up.

mihanson wrote:
lantz wrote:
For OTA?


Yes.


Great to hear. Obviously you don't need this. My intended audience was more people having the problem too since other posts make me think I was not alone:
R5E50 MythArchive DVD has audio video sync issues
[mythtv-users] mytharchive and audio sync for HDTV
etc.
and paulh agreed with the problem earlier

Author:  mihanson [ Tue Jul 03, 2007 5:29 pm ]
Post subject: 

Just to be clear, it was not my intention to poo-poo on your hard work. My apologies if it came off that way. Are you on R5E50 like the problems referenced in your links above were? If so, have you tried upgrading to R5F1? In the links you provided at least one mentioned the recordings were "DVB recordings." Now, I know ATSC cards are set up like DVB cards, but when someone says they have "DVB recordings" I assume (and you know what that gets you) they're recording off satellite--a different source than over-ther-air (OTA) terrestial recordings. I did not see a mention of your hardware. What are those details?

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/