View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 7 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Jul 03, 2007 12:09 am 
Offline
Joined: Sat Mar 04, 2006 11:32 am
Posts: 23
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 7:41 am 
Offline
Joined: Sun Sep 25, 2005 3:50 pm
Posts: 1013
Location: Los Angeles
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." :)

_________________
Mike
My Hardware Profile


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 7:46 am 
Offline
Joined: Sat Mar 04, 2006 11:32 am
Posts: 23
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 8:47 am 
Offline
Joined: Tue Aug 08, 2006 7:08 pm
Posts: 554
Location: UK
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.

_________________
Updated 2011/11/19: Athlon64 3700+ Asus A8N4-SLI Deluxe
1Gb PC 3200, 200Gb+250Gb+500Gb SATA HDD,
SATA DVD-RW Optiarc , Gigabyte GV-NX66128DP
Hauppauage Nova-T 500,+ 2x Nova HD S2 LinHes R6.02


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 2:23 pm 
Offline
Joined: Sun Sep 25, 2005 3:50 pm
Posts: 1013
Location: Los Angeles
lantz wrote:
For OTA?


Yes.

:)

_________________
Mike
My Hardware Profile


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 5:05 pm 
Offline
Joined: Sat Mar 04, 2006 11:32 am
Posts: 23
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 5:29 pm 
Offline
Joined: Sun Sep 25, 2005 3:50 pm
Posts: 1013
Location: Los Angeles
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?

_________________
Mike
My Hardware Profile


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu