VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    I am trying to demux the audio from an MKV file using Mplayer. I have searched all over the web and here is the command that most stated would work:

    mplayer -aid # -ao pcm:fast:file=audio_out.wav -vo null -vc null input.mkv

    Now, when I execute this command the MKV file just plays in MPlayer as oppose to demuxing the audio.

    MKV Description:
    Video = ffmpeg H264
    audio = Vorbis
    Quote Quote  
  2. Member
    Join Date
    Jan 2008
    Location
    North America
    Search Comp PM
    Hey, I never heard of that method, but I think its easier to use virtualdubmod or mkvextractgui to extract the audio.
    Quote Quote  
  3. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Originally Posted by MasterRoshi
    Hey, I never heard of that method, but I think its easier to use virtualdubmod or mkvextractgui to extract the audio.
    I don't want to use MKVExtract because sometimes the audio/video is out-of-sync.

    I need a it to be a command line tool, so vdm is out.
    Quote Quote  
  4. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    To add, anyone know how to acomplish this using FFMpeg?
    Quote Quote  
  5. Only demux?

    Code:
    ffmpeg -i name_file.mkv -vn -acodec copy name_file.ogg
    Of course You can decompress audio to WAV PCM and can choose audio stream (-map).
    Look at FFmpeg docs.

    Some other...
    Look at MPlayer docs about -dumpaudio option.
    Quote Quote  
  6. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Placio74
    Only demux?

    Code:
    ffmpeg -i name_file.mkv -vn -acodec copy name_file.ogg
    Of course You can decompress audio to WAV PCM and can choose audio stream (-map).
    Look at FFmpeg docs.

    Some other...
    Look at MPlayer docs about -dumpaudio option.
    Thanks for responding. I am getting the following error:
    Error, non monotone timestamps 6768 >= 6768
    av_interleave_write_frame(): Error while opening file

    Below is the command line:
    ffmpeg.exe -i "C:\movies\test\input.mkv" -vn -acodec copy output.ogg -map 0:1

    I have done some research but don't fully understand the -map option, could that be the problem?

    My input MKV is like so:
    Track 1: Video
    Track 2: Audio
    Quote Quote  
  7. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Disregard this thread please, I was able to figure out how to do everything I previously asked.

    Thanks
    Quote Quote  
  8. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    how did you solve it?
    Quote Quote  
  9. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Baldrick
    how did you solve it?


    For video demux:



    mencoder.exe "C:\input.mkv" -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:mbd=2:trell -nosound -ofps 23.976 -o "C:\output.avi"



    For audio demux



    ffmpeg.exe -i "C:\input.mkv" -map 0:1 -vn -ab 128K -ar 48000 -ac 2 -acodec ac3 "C:\output.ac3"



    I re-muxed using TmpGenc Express just to check A/V Sync and it was perfect.

    The more I work with MKVs, especially those that contain H264 video, the more I am understanding that the sound is usually the main problem when going through the entire process of going MKV->DVD, at least for the process I use.

    Thanks for the help everyone
    Quote Quote  
  10. But technically, it's not just demuxing (splitting the video and audio to separate files) - because it's just recompressing with change container. It's not same.

    BTW
    Why not used only one tool for both operation - FFmpeg?
    (When used lavcopts option in MEncoder - it's used FFmpeg code.)
    And why recompress video to MPEG4?
    Quote Quote  
  11. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Placio74
    But technically, it's not just demuxing (splitting the video and audio to separate files) - because it's just recompressing with change container. It's not same.

    BTW
    Why not used only one tool for both operation - FFmpeg?
    (When used lavcopts option in MEncoder - it's used FFmpeg code.)
    And why recompress video to MPEG4?
    I am not as familiar with FFMpeg's video capabilities as I am with Mencoder. I have written a very large (keep's getting larger everytime I come here ) and robust VB.Net application that streamlines all of my Audio/Video conversions, copy, avs scripts etc etc and when it was first created, Mencoder was the tool of choice to get files inside of MKV and OGM containters into a suitable container for CCE via an AviSynth Script.

    My knowledge is very limited on all the endless codecs available and actually what the differences are. When working with CCE via Avisynth Scripts, for the purpose of going (plug in any container here)->DVD, I was able to automate that task via the aforementioned tool I created and that way was to place them inside of an AVI container. Whenever the MKV Video is H264, as is the case for this particular project, I have the best success using lavc's MPEG4 codec when re-encoding to AVI.

    Yes, I know this isn't optimal and that are other tools that better facilitate MKV->DVD, but for the time being it works, especially since some experts on here taught me to remove the audio from Videos when using CCE.

    Most familiar with this forum can atest that I am always exploring other possible faster and efficient ways to do this, but for now, I am going to use this method.
    Quote Quote  
  12. Hmm... maybe try use demuxed RAW H.264 stream and DGAVCDec in Avisynth script?
    Quote Quote  
  13. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Placio74
    Hmm... maybe try use demuxed RAW H.264 stream and DGAVCDec in Avisynth script?
    I can look into it.

    I am assuming I would use MKVExtract to acquire the H264 Stream?

    I have really stayed away from using MKVExtract for this. As when I first started using said tool maybe a 1-2 years ago, alot of times the Audio/Video would be out-of-sync and even started a thread about it on here when I experienced this. But as I stated, I have not used MKVExtract to get the Audio/Video Streams in a while. Instead I have reserved its use for getting subs.
    Quote Quote  
  14. Other ways...?

    Avinaptic can demux MKV.

    (FFmpeg, MPlayer and AVI-Mux GUI too but have problems to use this demuxed streams in DGAVCIndex and other tools.)

    But... You try used MKVextract from command line or GUI? And used actual versions?

    Of course You can try use DirectShowSource instead AVCSource (DGAVCDec).
    Quote Quote  
  15. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    Originally Posted by mickgreen58
    Originally Posted by Baldrick
    how did you solve it?


    For video demux:



    mencoder.exe "C:\input.mkv" -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:mbd=2:trell -nosound -ofps 23.976 -o "C:\output.avi"



    For audio demux



    ffmpeg.exe -i "C:\input.mkv" -map 0:1 -vn -ab 128K -ar 48000 -ac 2 -acodec ac3 "C:\output.ac3"



    I re-muxed using TmpGenc Express just to check A/V Sync and it was perfect.

    The more I work with MKVs, especially those that contain H264 video, the more I am understanding that the sound is usually the main problem when going through the entire process of going MKV->DVD, at least for the process I use.

    Thanks for the help everyone

    This is not demultiplexing, it's re encoding.

    For mplayer just use the -dumpstream, -dumpvideo, -dumpaudio, -dumpfile commands. These are in the documentation file.
    Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
    Quote Quote  
  16. Originally Posted by mickgreen58
    ...
    I have really stayed away from using MKVExtract for this. As when I first started using said tool maybe a 1-2 years ago, alot of times the Audio/Video would be out-of-sync and even started a thread about it on here when I experienced this. ...
    out-of-sync... it's possible if not set correct FPS from source.
    RAW stream not have FPS info (exclude private data, but it's not always correct).
    That's why... when mux raw AVC stream:
    - to MP4 container used Yamb,
    - to MKV container used MKVmerge,
    - change for/to AVI used avc2avi,
    need set manually correct FPS.
    And after use DGAVCIndex, can change FPS to correct in .dga file (if correct FPS not set automatically).
    Quote Quote  



Similar Threads

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