in

andy vt's tools & blog

Automating lazy

Converting ATSC to WMV HD

Last post 12-06-2007 6:10 AM by Jeffvance. 31 replies.
Page 1 of 3 (32 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 10-12-2007 2:53 PM

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Converting ATSC to WMV HD

    OK, here's what we have so far, working off Andy's blog post about converting ATSC to WMV HD. Video is easy, the tricky part about this process is preserving the 5.1 channel sound by converting Dolby Digital (AC3) to WMA Pro. To do that, we're going to need some help:

    Things you will need before starting:

    The only thing that's tricky to install is the AVIVO codecs.  Unless you want the full application (if you're using non-ATI hw you don't have a choice); after launching the installer and letting it extract the files just cancel out and browse to the ATI folder that should have been created on your system drive.  Drill into the folder until you get to SUPPORT\7-9_vista_xcode_52447\Packages\Apps\AVIVO and execute AVIVO.msi.  It will install the filters you will need.

    First thing that needs to happen is to configure AC3Filter to transform the AC3 audio into 6 channel PCM, so WMEncoder can read the audio and convert it to WMA Pro.  Open up AC3Filter Config, on the main tab select 3/2+SW 5.1 channels from the "Output format" drop down, then click "OK" to save.

     

    NOTE: You can use also use the ffdshow audio decoder, and it might work better.

     How to configure the ffdshow audio decoder:

    • Enable the Mixer, and select "3/2 - 5 channels" + LFE checked
    • On the Output tab, uncheck "Allow direct-to-file output".


    Download the wmvhd.zip file attached to this post and extract it to your DVRMSToolbox install dir. This will give you the graph stub, plus the action profile and the wmvhd.prx encoder profile.

     To convert a DVR-MS to WMV-HD, just use the DVRMSToolboxGUI or DVRMStoMPEG.exe, giving the DVR-MS as the source and any valid filename as the output. Select the "WMV HD" (for command line: /act=WMVHD) profile. Make sure you have sufficient disk space on the destination disk for a temporary MPEG that will be roughly the size of the source DVR-MS. The profile will attempt to rename the finished .WMV based on the metadata, and then delete the temporary MPEG.

    The profile does not currently do any commercial detect or cutting. It is assumed you will have already output a commercial-free DVR-MS, and will be using it for the source. FYI: Toub's DVR-MS Editor still works well for splicing HD DVR-MS, even on Vista.
      

    Filed under:
  • 10-12-2007 10:19 PM In reply to

    Re: Converting ATSC to WMV HD

    I'm excited about trying this but I'm still using 1.2.0.8 for Vista. Not sure what is different but my version won't read your wmvhd profile. I put it in the correct directory and even deleted all the others to make sure it was the right spot and it still didn't show up in the list.
    Home Built Media Server | Windows 7 RC (x86) | HP MediaSmart Connect Extender | www.techlifeweb.com | @techlifeweb on Twitter
  • 10-13-2007 9:53 AM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    1.2.0.8 doesn't have the action this profile uses. WMVHD conversion is so beta it reeks :)

     What you can do is create a "Convert With Graph"-based profile to spit out the MPEG, then use the WM Encoder GUI to do the rest. See Andy's blog post for the manual steps
     

     

  • 10-14-2007 7:23 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    Okay, I've found a gotcha... If the ATSC file you are trying to convert switches between 2.0 and 5.1 AC3, WMEncoder will pooch the file, and you won't know it until it hangs forever at 100%. You can stop the encode and get the file to play by reindexing the WMV, but when it gets to the audio blip, it will hang and not seek past that point. This is a bug in either AC3Filter or WMEncoder, but we can work around it.

    The audio type usually changes when a show goes to commercial and back. Even if you cut commercials and trim it up in DVR-MS Editor, you can still get a split second audio switch. The best way to make sure the doesn't happen is to turn on AC3Filter's tray icon and watch the SPDIF tab as you scrub the video in DVR-MS Editor. You'll see the decoding chain switch between 2.0 and 5.1 if there's a blip.

  • 10-16-2007 12:39 AM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    You can run the encoder from the command line

    Pretty simple:

    wmcmd.vbs -input %if% -output %of% -loadprofile "c:\program files\dvrmstoolbox\prx\WMVHD.prx"
     

    I'll play around with using RunExternal to call this. If it works, 1.2.0.8 users can also enjoy automatic encoding. Maybe an action that will run it this way?

    Config would need:
    specify .prx for "-loadprofile  <file>"
    deinterlace option, toggles "-v_preproc 1"
    quiet option to suppress progress logging, toggles "-silent" (or just drops output)
    a generic options field?
     

  • 10-16-2007 5:42 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    For those who prefer to use ffdshow, it's possible to use the ffdshow audio decoder vs. AC3Filter. One big advantage of using ffdshow is that it seems to be a little more resilient to audio format changes in the input.

     How to configure the ffdshow audio decoder:

    • Enable the Mixer, and select "3/2 - 5 channels" + LFE checked
    • On the Output tab, uncheck "Allow direct-to-file output".

    I've updated the .zip file attached to the top post with a default.ffAPreset that will configure ffdshow for you, plus the wmcmd.vbs and a new profile to use it. (The wmcmd script should allow 1.2.0.8 and 1.1.0.6 to use the WM Encoder. Also, the WMVHD with wmcmd profile uses ffmpeg_MPGMUX to dump the mpeg, so you don't need AVIVO)

  • 10-16-2007 9:07 PM In reply to

    Re: Converting ATSC to WMV HD

    Coyote,

    Thanks for working through this. I was going to take a similar approach but haven't had time to figure out the details.

    One thing I did note when I was trying to get this figured out last weekend was that I did need hotfix KB929182 before using WMCmd.vbs or it would error out. Milage may vary for other people but I though it should be noted.

    So I gave it a shot and it errored out at the wmv conversion process. The mpg file was created fine.

    -----

    InputFile=C:\Users\Public\Recorded TV\The Tonight Show With Jay Leno_KNSD-DT_10_10_2007_00_21_35.dvr-ms
    Processing actions, this may take some time!!
    Profile = wmcmd
    ProcessId = 3828
    DvrmsToolbox Version: 1.2.0.8
    Get the value of Context["OutputFile"] and set the value of Context["TempMpeg"]
    Context["OutputFile"] = C:\Users\Public\Recorded TV\Output\jay.wmv
    Context["TempMpeg"] = C:\Users\Public\Recorded TV\Output\jay.mpg
    Duration = 00:00:00.0039060
    Convert Dvr-ms files with ffmpeg


    Duration = 00:02:47.9990130
    Run c:\windows\system32\cscript.exe "c:\program files\dvrmstoolbox\scripts\wmcmd.vbs" -v_preproc 1 -loadprofile "c:\program files\dvrmstoolbox\prx\wmvhd.prx" -input "C:\Users\Public\Recorded TV\Output\jay.mpg" -output "C:\Users\Public\Recorded TV\Output\jay.wmv"
    Microsoft (R) Windows Script Host Version 5.7
    Copyright (C) Microsoft Corporation. All rights reserved.

    Prepare to encode failed with error -1072886856 The input media format is invalid.
     

    Home Built Media Server | Windows 7 RC (x86) | HP MediaSmart Connect Extender | www.techlifeweb.com | @techlifeweb on Twitter
  • 10-16-2007 10:54 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    "input media format is invalid" almost always means the encoder isn't getting the audio it wants. You need to make sure the encoder is getting 6-channel 16-bit PCM, so make sure AC3Filter is set to "3/2+SW 5.1 Channels" (see screenshot above).

    If you are using ffdshow, you have to enable the mixer, set it to "3/2 - 5 channels", and check the LFE box. Also, for ffdshow, go to the output tab and make sure the "Allow direct-to-file output" box is UNCHECKED. (ffdshow will not work at all if this is checked)

    If "do not use WAVFORMATEXTENSIBLE header" is checked, uncheck it. I don't know if it makes a difference, but I have it unchecked.

    Oh yeah, on the codecs tab, make sure ffdshow is actually enabled to decode AC3 using "liba52" 

  • 10-17-2007 8:32 AM In reply to

    Re: Converting ATSC to WMV HD

    I believe I have AC3Filter and ffdshow all set correctly.

     I am sure it is an audio issue. I was able to get it to work by changing the runexternal command to:

    "c:\program files\dvrmstoolbox\scripts\wmcmd.vbs" -v_preproc 1 -a_codec WMAPRO -a_mode 2 -a_setting Q98_48_2_24 -loadprofile "c:\program files\dvrmstoolbox\prx\wmvhd.prx" -input "%TempMpeg%" -output "%OutputFile%"

    Of course, that sets it to 2 channel. If I do  Q98_48_6_24 to change to 6 channels it blows up with the same error I mentioned above.

    Home Built Media Server | Windows 7 RC (x86) | HP MediaSmart Connect Extender | www.techlifeweb.com | @techlifeweb on Twitter
  • 10-17-2007 6:54 PM In reply to

    • babgvant
    • Top 10 Contributor
    • Joined on 10-02-2006
    • Chicago, IL

    Re: Converting ATSC to WMV HD

    Did you get it working with Ffdshow?
  • 10-18-2007 3:39 AM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    yep. I can transcode to 5.1 without AC3Filter even installed.

     

  • 10-18-2007 7:25 AM In reply to

    • babgvant
    • Top 10 Contributor
    • Joined on 10-02-2006
    • Chicago, IL

    Re: Converting ATSC to WMV HD

    do you know what was causing the earlier problem?  i'd rather use ffdshow if it can have application specific settings (for everything else, i'd like it to just output the raw ac3 audio to the spdif).
  • 10-18-2007 1:40 PM In reply to

    Re: Converting ATSC to WMV HD

    ive converted a few things and am having one small problem.... the actual conversion goes through just fine and everything works great but at the bottom of the picture there is a gray bar where there is no such bar in the mpg version it reads out.  Is there any way to remove that?  or identify where it is coming from.
  • 10-18-2007 8:58 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    Andy -

    You need to uncheck the "allow direct-to-file output" box on the Output tab of the ffdshow audio decoder config. That's what got it working for me. Also, WMencoder will expect 6 channel PCM, so enable the mixer filter and set it to "3/2 5 channel" + LFE checked

     If you want 2 channel AC3 audio to be upmixed to 5.1, also check the "Dolby Decoder" filter.
     

  • 10-18-2007 9:00 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-11-2006
    • Maryland

    Re: Converting ATSC to WMV HD

    jagowar - I get that too. I guess it's just a scaling artifact. There's a 1-pixel yellow bar on the left side too.

    On any display with overscan, you probably won't see them. 

Page 1 of 3 (32 items) 1 2 3 Next >
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems