VideoHelp Forum




+ Reply to Thread
Results 1 to 27 of 27
  1. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    I have a WMV file (HD 720p) with 6 Channel Audio (Windows Media Audio 9 Professional) and very high video bitrate. I want to re-encode the file and lower the bit-rate. I was considering Xvid through Virtual dub. For that I tried Avisynth and through DirectShowSource I was able to get video and audio. Audio however is 2 channel PCM.

    How can I get Avisynth to steam all 6 channels to Virtual Dub. If that's not possible how can I extract AC3 from a WMV file and what is the recommended software to mux AC3 and video together. Alternatively what is the recommended procedure about changing the bitrate of a WMV file. I don't mind if I end up with a WMV file in the end as long as I can get lower bitrate.

    I appreciate your help and looking forward to learning from you.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    are you sure it is ac3? not wma 5.1?
    Quote Quote  
  3. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Originally Posted by Baldrick
    are you sure it is ac3? not wma 5.1?
    My bad. Gspot reports 0x0162 (Windows Media Audio 9 Professional) 6 Channel codec.

    Aud:384 kbps, 48 kHz, 5.1 channel 24 bit 2-pass VBR
    Quote Quote  
  4. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Come on guys. This must be trivial case for you. Could you please give me a hint or a link to a guide to perform such a conversion. 8)

    By the way I upgraded to Avisynth 2.5.7. This version streams multichannel audio. When I check the file info I see PCM stream 5.1 with 48000 Hz sampling rate.

    So this version does stream all 6 channels. However I still cannot encode with AC3 or any other codec for that matter. Virtual Dub (that is 1.7.1) insist that I should have mono or stereo audio.

    HELP.
    Quote Quote  
  5. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    You want to first demux the audio.

    Then you could try and directly encode the wma 5.1 to 5.1 ac3 with besweet (the latest beta, I don't think the last stable version has ac3 encoding) and the belight gui.
    If the audio has no clicking and clipping you could mux your ac3 audio with your video in virtualvubmod (we'll assume you're moving to an avi container for ease).

    If it doesn't work.
    You could also try doing it with graphedit, with ffdshow.
    Writing directly to multichannel ac3.

    Or you might have to convert to 6 channel wave file. Split into 6 mono channels, and then select the correct channel order when creating the new ac3 multichannel file.

    This is for aac to ac3 but the principles are the same
    http://forum.doom9.org/showthread.php?p=666230
    Quote Quote  
  6. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    How can I extract the wma file from wmv?

    I was able to convert to 5.1 WAVE PCM through avisynth 2.5.7 and VirtualDubMod.
    Quote Quote  
  7. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    I have succesfully converted the audio to a 6Gig wave 5.1 PCM file. Besweet will not convert to AC3. BeSplit will demux to mono wave files but they are garbage. EncWAVtoAC3 will encode to AC3 but ony 42 minutes of the 130.

    HOW CAN I COMPRESS A 5.1 WAVE FILE TO AC3
    Quote Quote  
  8. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    If EncWAVtoAC3 is stopping after 42 minutes I would be concerned about the integrity of the file. Try loading the PCM version into Audiacity to make sure it is complete.

    From here you can also save it out as 6 mono files - one for each channel - the try using these in EncWAVtoAC3 instead.
    Read my blog here.
    Quote Quote  
  9. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Originally Posted by guns1inger
    If EncWAVtoAC3 is stopping after 42 minutes I would be concerned about the integrity of the file. Try loading the PCM version into Audiacity to make sure it is complete.

    From here you can also save it out as 6 mono files - one for each channel - the try using these in EncWAVtoAC3 instead.
    Audiacity opened the file only up to 42 minutes. I guess there is something wrong with the file. How can I fix it?
    Quote Quote  
  10. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    are we talking about DRM protected material?
    Quote Quote  
  11. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    I would go back to virtualdub and check what happens at the 42 minute mark. You might be able to isolate and remove the glitch, and get the audio in two parts - up to the glitch, and after the glitch - then repair it afterwards. You can use the Trim command in avisynth to isolate sections when reading the file.


    Or it might have been a momentary lapse, and a second attempt might get the whole lot.
    Read my blog here.
    Quote Quote  
  12. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Originally Posted by 45tripp
    are we talking about DRM protected material?
    No its not DRM protected. There is something wrong with audio. And We are talking about a huge PCM audio file. 6 G.
    Quote Quote  
  13. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    The size is right.

    But perhaps it's part of the problem. I think wave files over 4gb are not handled correctly by some software.

    Gunslinger's suggestions seem good.
    If you've only converted the audio with virtualdub (once?) then it's worth trying other methods.
    Try mplayer, or ffmpeg directly, or the microsoft software, windows media encoder.

    Because of the size you might try splitting the file before conversions.

    You also might try wavewizard instead of audacity.
    Quote Quote  
  14. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    I have tried Mplayer. I have installed the later version and all the codec. It will not run. Here is the command and the output:

    Code:
    "C:\Program Files\Mplayer\MPlayer.exe" -vo null -ao pcm:file=oadio.wav video.wmv
    
    MPlayer 1.0rc1-3.4.2 (C) 2000-2006 MPlayer Team
    CPU: AMD K7 processo (Family: 6, Model: 10, Stepping: 0)
    CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
    Compiled with runtime CPU detection.
    c:/windows/fonts/arial.ttf doesn't look like a bitmap font description, ignoring.
    Cannot load bitmap font: c:/windows/fonts/arial.ttf
    
    Playing video.wmv.
    ASF file format detected.
    VIDEO:  [WMV3]  1280x720  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
    Clip info:
     name: 'video'
     author:
     copyright:
     comments:
    ==========================================================================
    Opening video decoder: [dmo] DMO video codecs
    IMediaObject ERROR: 00B84D00  could not open DMO DLL (0x0 : 0)
    Failed to create DMO filter
    ERROR: Could not open required DirectShow codec wmv9dmod.dll.
    You need to upgrade/install the binary codecs package.
    Go to http://www.mplayerhq.hu/dload.html
    VDecoder init failed :(
    Opening video decoder: [dmo] DMO video codecs
    IMediaObject ERROR: 00B84D54  no such class object (0x80004001 : -2147467263)
    Failed to create DMO filter
    ERROR: Could not open required DirectShow codec wmvdmod.dll.
    You need to upgrade/install the binary codecs package.
    Go to http://www.mplayerhq.hu/dload.html
    VDecoder init failed :(
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffwmv3] vfm: ffmpeg (FFmpeg M$ WMV3/WMV9)
    ==========================================================================
    ==========================================================================
    Opening audio decoder: [dmo] Win32/DMO decoders
    IMediaObject ERROR: 00B84D00  could not open DMO DLL (0x0 : 0)
    ERROR: Could not open required DirectShow codec wma9dmod.dll.
    ADecoder preinit failed :(
    ADecoder init failed :(
    Opening audio decoder: [dmo] Win32/DMO decoders
    GetOutput r=0x0   size:73728  align:1
    StreamCount r=0x0  1  1
    AUDIO: 48000 Hz, 2 ch, s16le, 385.6 kbit/25.11% (ratio: 48206->192000)
    Selected audio codec: [wmadmo] afm: dmo (Windows Media Audio DMO)
    ==========================================================================
    [AO PCM] File: The Fifth Element 16x9 720p WM9 HD-DVD.wav (WAVE)
    PCM: Samplerate: 48000Hz Channels: Stereo Format s16le
    [AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast
    [AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
    AO: [pcm] 48000Hz 2ch s16le (2 bytes per sample)
    Starting playback...
    VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is undefined - no prescaling applied.
    VO: [null] 1280x720 => 1280x720 Planar YV12
    
    Too many video packets in the buffer: (192 in 8388932 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.
    
    Too many video packets in the buffer: (191 in 8388645 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.
    
    
    MPlayer interrupted by signal 11 in module: decode_video
    - MPlayer crashed by bad usage of CPU/FPU/RAM.
      Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
      disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
    - MPlayer crashed. This shouldn't happen.
      It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
      gcc version. If you think it's MPlayer's fault, please read
      DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
      won't help unless you provide this information when reporting a possible bug.
    [/code]
    Quote Quote  
  15. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    When I split the file with VirtualDub and avisynth around 42 minutes into the movie the second part becomes a few seconds long. That means that there is some error at that point and avisynth truncates the file.

    I also tried MediaCoder but it produces a 2 channel audio.

    How about ffmpeg? What is the syntax to extract the audio of a WMV file into a 6 channel PCM or other format?
    Quote Quote  
  16. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    Start the second part progressively further along until you get past the glitch, the try to work out how much is missing. You might have to sarifice a few seconds of audio.
    Read my blog here.
    Quote Quote  
  17. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    I was able to split them into two separate files. Then I put them together with Audacity. Then I split the channels in 6 mono wave files. All I want to do now is how to put them together in an AC3 file, so,

    HOW CAN I COMBINE 6 MONO PCM WAVE FILES INTO AN AC3 FILE?
    Quote Quote  
  18. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    You should be able use EncWAVtoAC3 to do it. Just import all 6 channels in the correct order and encode
    Read my blog here.
    Quote Quote  
  19. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Originally Posted by guns1inger
    You should be able use EncWAVtoAC3 to do it. Just import all 6 channels in the correct order and encode
    Thank you for your quick responses. EncWAVtoAC3 creates an AC3 file for every one of the 6 wave files in the list. What is the correct settings?
    Quote Quote  
  20. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    I have no idea how to set up encwavtoac3.
    Wavewizard puts the mono files together by ticking merge in the preferences window.

    As for your problems with mplayer/mencoder. I had exactly the same.
    Are you also running a Pentium 4? Anyway you can get a precompiled mencoder and mplayer at:
    http://oss.netfarm.it/mplayer-win32.php
    In case you need it.

    So what happened with your audio?
    Have you lost a section of it? Have you already edited the wav, filled the faulty space with silence?
    If no editing was required and you still have all audio you shouldn't have your audio in mono channels until you've unsuccessfully tried converting 6 channel wav to 6 channel ac3.

    Download Ffmpeg.
    open the command promt, move to the ffmpeg directory
    Code:
    ffmpeg -i "c:\path\audio.wav" -acodec ac3 -ac 6 -ab 384 Final.ac3
    You could also try using your wmv file as input.
    I believe it should work, but if there is clicking and clipping you'll have to go to mono and put it back in the correct order. That's beyond me.
    You might try asking an audio specific audience.
    Quote Quote  
  21. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    WAV files over 2GB in size will be problematic. That's probably the 42min mark. I could help you more if the file was DTS or AC3.

    45tripp - that's a good idea(if the WAV files aren't too big) , I think it might even work better if the original WMV could be decoded by ffmpeg. You'd have to use a recent (as in no more than a few months old) version.


    ffmpeg -i "inputfile.wmv" -vn -acodec ac3 -ac 6 -ab 384 -y audio.ac3

    http://tirnanog.fate.jp/mirror/ffmpeg/ffmpeg.rev8047.7z

    ftp://sources.redhat.com/pub/pthreads-win32/prebuilt-dll-2-8-0-release/lib/pthreadGC2.dll
    Quote Quote  
  22. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    The wav files are big. It's a 130 min video.
    (I thought it was ok up till 4GB)

    I've already suggested splitting.
    What about splitting to 3-4 parts with windows media encoder and eventually joining the final avi files? Butcher method. How likely to run into trouble (sync issues)?
    Quote Quote  
  23. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Asfbin (with the GUI) will do a nice job of splitting the files It is quite a good splitter. If you can demux the audio from the video, that would simplify things a bit as well.

    I think it can be done (converted to AC3), but I need some time to figure out the specifics. Possibly Avisynth with DirectShowSource. Maybe replacing the NicAudioSource line with DirectShowSource in this script:

    https://forum.videohelp.com/viewtopic.php?t=317891&highlight=ac3gain





    EDIT - YUP, It works by demuxing the audio in asfbin and transcoding in Avisynth. I'll post the details in a few hours.
    Quote Quote  
  24. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Wow thank you very much. I did not know there were so many options. I do believe the problem is the file size.

    I am using AviSynth 2.5.7 that can stream multichannel audio. I tried extracting the whole file through Virtual Dub (the latest stable version 1.6.17). It projected a file of over 6G but when going past the 4G mark it truncated the file down to 2G which is the mystery 42 min in the movie marker and stopped unexpectedly.

    I tried the same thing with VirtualDubMod but this time it was able to extract the 6G file. The problem was that EncWAVtoAC3 would only encode 42 min to AC3. Furthermore Windows Medial Player XP and Classic cannot play the file and see only 42 min. Only MPlayer (gmplayer) was able to play the whole file.

    What I managed to do is split the file into two files with VirtualDumMod without any loss of content. One is 2G and the other is 4G. I was able to encode them both to AC3 with EncWAVtoAC3. In addition I imported them both in Audacity I appended one to the other and then I exported them into 6 wave mono files.

    The methods that you describe seem much more easy to try and get the AC3 out of the WMV. If these fail I read HERE how to merge mono waves into an AC3 file using BeSweet.

    When I have the AC3 then I am going to create a stream in VirtualDubMod and created an XVid avi with lower bitrate. When I get home I ll give it a try.
    Quote Quote  
  25. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Here's the way to do it without having to worry about 2GB WAV limits, and we can automatically maintain the 5.1 channels as the file is converted to AC3
    -----------------------------------------------------------------------------------------------------

    1) Download and extract the command line version of AsfBin

    http://www.radioactivepages.com/download/asfbin1.6.0.679.zip

    Also download the Ac3gain_WMA zip, which we've modified for Windows Media

    http://www.bestsharing.com/files/c4tjRFT236632/AC3GAIN_WMA.zip.html

    Note: You'll need to have Avisynth 2.5x and at least .NET 1.1 runtimes installed.

    2) Shorten the name of your WMV file just to make your life easier. We'll need to run asfbin against it to determine which track number the audio is sitting at (sorry to end the sentence with a preposition).

    3) I'm using this WMV file as an example

    http://www.cinenow-static.net/v/wmv-snowboard_1080p.zip

    Running asfbin provides us with the following info:




    What we want to do is remove the video track, leaving us with only audio. We can see that Video is on Stream 2, Audio on Stream 1 . The syntax is odd, we want to choose the channel to exclude (in our case, Stream 2)

    4) asfbin -i SnowBoard.wmv -o Snowboard.wma -nostream 2



    Now we have a Snowboard.wma audio file - Eggcelent !

    5)Unzip Ac3Gain_WMA.zip and open up Ac3Gain.avs with notepad. Change

    BassAudioSource("yourfile.wma")

    to

    BassAudioSource("snowboard.wma")#or Whatever your wma file name is

    6) Place snowboard.wma into the same folder as the AC3Gain files

    7) DoubleClick AC3Gain.bat to run. Your Output file will be named Output.ac3

    ac3gain.avs
    aften.exe
    AudioLimiter.dll
    bass.dll
    bassAudio.dll
    bass_aac.dll
    bass_ac3.dll
    bass_ape.dll
    bass_flac.dll
    bass_mpc.dll
    bass_spx.dll
    bass_wma.dll
    bass_wv.dll
    BePipe.exe
    output.ac3
    ReadMe.txt
    Run_AC3gain.bat
    snowboard.wma
    sources

    That should do it. Note: If you're not happy with the output audio levels (I really cranked them up), you'll want to adjust these lines in Ac3Gain.AVS

    amplify(1.4) #Lower to 1.0 for no amplification

    WavGainLimiter(1.4) #Lower or Remove line to reduce dynamic audio compression
    Quote Quote  
  26. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    Thank you all for your answers I learned a lot. I tried the following methods:

    1. Use of ffmpeg: I tried to encode the wave file:
    Code:
    ffmpeg -i audio.wav -vn -acodec ac3 -ac 6 -ab 384 -y audio.ac3
    The newest version of ffmpeg detected an invalid PCM packer in the 42 minutes of audio. This was the only program that detected something wrong with my file. Previous version of ffmpeg would not detect anything and it would stall in about 80% of the audio.

    Encoding with ffmpeg the WMV or the WMA file is not possible because it does not support these codecs.

    2. Use of asfbin & aften: asfbin is a wonderful program and I was able to demux the audio stream in an WMA file.
    Code:
    asfbin -i video.wmv -o audio.wma -nostream 2
    Then I tried to encode the WMA file using aften via an Avisynth stream as Soopafresh recommended.


    Code:
    bepipe.exe --script "import(^ac3gain.avs^)" - | aften.exe -v 0 -b 384 -dynrng 1 - audio.ac3
    ac3gain.avs:
    Code:
    SetMemoryMax(128)
    
    LoadPlugin("BassAudio.dll")
    LoadPlugin("AudioLimiter.dll")
    
    
    BassAudioSource("audio.wma")
    
    ensurevbrmp3sync()
    convertAudiotofloat()
    amplify(1.4)
    #normalize()
    
    #LinearLimiter(1.5)
    #ExpotencialLimiter(1.1)
    WavGainLimiter(1.4)
    #SoftClipperFromAudX(0.4)

    The process seem to work flawlessly but the output file was 2 Mb long and of course did not have the correct audio data.

    I tried to open the WMA file with Audacity but it imported it as a stereo MP3.

    3. Use of Mplayer: I downloaded the precompiled Mplayer form my Athlon XP as recommended by 45tripp and it worked flawlessly. Only problem was that it produced a 2 channel audio wav.

    Code:
    MPlayer.exe -vo null -ao pcm:file=audio.wav video.wmv


    4. Use of Audacity & Besweet: That was my last chance. As you remember I was sucessful in exporting the file into 2 split wavs. 2G and 4G. Then I was able to open them with Audacity and append one to the other. Then I exported them into separate mono wav file, one per channel. I was afraid of sync issues so I did not pursuit that method initially. As my last resort I created a mux file and using Beligth (Besweet) I generated an AC3 file. After playing with VirtualDubMode I was able to sync the video and the audio and I am currenly encoding the whole movie with VirtualDubMod by muxing the WMV video through Avisynth and the AC3 file that I generated.

    I will let you all know how the process went. Thank you for your help.
    Quote Quote  
  27. Member
    Join Date
    Mar 2007
    Location
    United States
    Search Comp PM
    The mux was successful. The video played flawlessly and the sound was in sync without any problems. Thank you for your help. I couldn't have done it without you.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!