VideoHelp Forum




+ Reply to Thread
Results 1 to 27 of 27
  1. Is there an automated way to demux the audio and video stream from an avi?So far i've been opening the avis on vdub mod,demux the audi stream and then save the avi as a no sound one to get the video.But that's time consuming!

    Isn't there a way to get the video and audio from avi,muuch like we do from mpg.Just select an avi source click start and get the streams?Like the mpeg tool of tmpegenc does for mpeg-2?
    Quote Quote  
  2. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Take a lok at MP4Box or Avidemux or MPlayer - all can be called from the CLI, and seem capable of doing what you want:
    (From Doom9
    Code:
    MP4Box -aviraw audio foo.avi
    MP4Box -aviraw video foo.avi
    Code:
    mplayer -dumpaudio -dumpfile out.raw foo.avi
    mplayer -dumpvideo -dumpfile out.raw foo.avi
    /Mats
    Quote Quote  
  3. I have avidemux,how can i do it there?

    And if i want to do it on lots of files at once?Can a gui be created for that purpose?

    thanx.
    Quote Quote  
  4. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    There's documentation for the CLI of AviDemux on the AviDemux site. A brief glace makes me believe it's only possible to demux audio and raw video stream (without AVI container).
    Of course a GUI could be created, but a pretty simple bat script could be easily written to process let's say all AVIs in a given directory.

    /Mats
    Quote Quote  
  5. What extension would th raw video have?

    Can you help me with the command line editing?How could i process a whole folder?
    Quote Quote  
  6. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Don't know, really, what the raw video stream would appear like - ".XviD" for a XviD stream? OTOH, the extension isn't what matters - what matters is what tools accept raw video stream.
    What do you intend to do with the demuxed streams?
    Example of bat script:
    Code:
    for %%A in (*.avi) DO avidemux2 --load %%A save-raw-audio save-raw-video
    This should demux all AVIs in current directory to elementary streams.
    Not sure, but you might have to split the audio and video saving in two operations.

    /Mats
    Quote Quote  
  7. I'm using megui to encode avc for psp and it encodes audio and video seperately.

    So i need to have a soundless video as a video input and seperately the audio as the audio input in order to encode.

    Also since psp only supports 29.97 i need to use besweet on the audio to stretch it to 29.97 and convert with vdub the video to 29.97.

    So in other words i need a quick way to seperate the streams from avi files!

    Now as for avidemux i asked the extension of the raw video so i would know what to use on the cli.I have no experience with cli whatsoever,but looking at the site i created this one:

    avidemux2 --load input.avi --save-raw-audio --save output.avi
    avidemux2 --load input.avi --save-raw-video --save output.mp3 --quit

    Is that correct?Or should i use yours instead?So i write this in notepad,save it as bat and run it right?
    Quote Quote  
  8. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Yes, you just write in Notepad, and save with a .bat extension.
    As for your examples - may very well work. I'm just theorizing, as I haven't avidemux on this 'puter.
    Experiment!

    /Mats
    Quote Quote  
  9. None of the two worked.Then i tried your script for mplayer only i edited a line so i can have seperate outputs.

    mplayer -dumpaudio -dumpfile out.raw foo.avi
    mplayer -dumpvideo -dumpfile out2.raw foo.avi

    And it gave me out.raw and out2.raw.

    I opened out.raw (audio) in foobar to test it,but it couldn't decode it.

    Then i put out2.raw (video) on mpc but it couldn't play.When i scrolled thorugh the status bar it displayed some frames which were in bad condition,but there was no playback.

    So any other suggestions?I spose raw statre of the streams won't cut it.
    Quote Quote  
  10. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Tried:
    Code:
    avidemux2.exe --load "d:\movies\xyz.avi" --save-raw-audio xyz.ac3
    ...and it worked beautifully. I checked the audio format first with GSpot.

    Check stdout.txt for hints on where your process fails. AviDemux seems picky - some AVI's I tried, it failed after a few minutes of the source.

    /Mats
    Quote Quote  
  11. As for the audio it works indeed,although you got to check the codec with gspot in order to determine tha output,but for the video it still doesn't.

    At least not with the command:

    avidemux2 --load "a.avi" --save-raw-video zy.avi --quit
    Quote Quote  
  12. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    No, because the video will not be an AVI anymore - just the raw video stream. Unless it's mpg, it's pretty useless. Or maybe, as XviD/DivX is mp4, saving as MP4 will do it? Gotta try! Nop, no dice. "Nothing" seems to rcognize the raw video.

    /Mats
    Quote Quote  
  13. Ok lets recap,tha audio works,so how can i make a batch to extract the audio of all avi files in a directory and save them as their avi name.

    So i have a folder with files 1.avi 2.avi 3.avi and i get 1.mp3 2.mp3 3.mp3.

    And then as for the video,how can i make vdub process a batch of video files with the settings i choose?So i can save a settings file where i have selected no sound,and frame rate conversion to 29.97.How can i make that apply to a number of files?
    Quote Quote  
  14. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Extract audio (presuming it's all MP3 in the AVIs):
    Code:
    for %A in (*.avi) DO avidemux2 --load %A --save-raw-audio %A.mp3
    IIRC, VDub has a mode where you can add jobs to a job list, and when finished setting it all up, start processing the lot.

    /Mats
    Quote Quote  
  15. I tried that code but it didn't work.I had two avis on the folder,but i didn't get anything back.
    Quote Quote  
  16. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Code:
    for %A in (*.avi) DO "k:\Program\avidemux\avidemux_2.0.40\avidemux2.exe" --load %A --save-raw-audio %A.mp3 --quit
    This is the exact command I've just succesfully run. CD to the dir where your AVI's are, and change "k:\Program\avidemux\avidemux_2.0.40\avidemux2 .e
    xe" to whatever full path to avidemux2 you have on your system.

    /Mats
    Quote Quote  
  17. Code:
    for %A in (*.avi) DO "C:\Documents and Settings\Administrator\Desktop\New Folder (2)\avidemux_2.1.0_win32\avidemux_2.1.0\avidemux2.exe" --load %A --save-raw-audio %A.mp3 --quit
    That's what i'm doing but i get nothing.Do you see anything wrong n the code i wrote?
    Quote Quote  
  18. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Nope. Looks exactly like mine. ...and you "are in" the directory where the AVI's are?

    /Mats
    Quote Quote  
  19. Of course i am,and i don't get any file after i run the .bat.

    So yours run succesfully though?
    Quote Quote  
  20. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    Yep. Only drawback is that it at once launced one instance of avidemux for each AVI, resulting in long extraction times. I'm sure there's a way to launch AviDemux and have the bat script wait for completion before stepping thru to the next iteration, but that's beyond my relatively limited bat script experience, I'm afraid...
    As for why you don't get any output - I'm at a loss! What if you just change all after DO to "@echo %A" (just prints out the file names) - do you get anything? (Just to see if it's the loop, or in the Avidemux stage things go wrong)

    /Mats
    Quote Quote  
  21. "@echo %A"?So what whould the exact full code be?
    Quote Quote  
  22. What do i get from that?A dos box popped out instantly.
    Quote Quote  
  23. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    What do you mean? Ah - you run the bat by clicking on it!
    Work from within a "DOS box"! Otherwise, you don't know what "working dir" is.
    Put all AVIs and the BAT script in one dir.
    Open a "DOS box" and change to that directory.
    Type the name of the bat script.

    /Mats
    Quote Quote  
  24. What's the difference between clicking on it and calling it from ms dos?Anyway let me try that as well.

    EDIT:Tried it,still nothing happened.

    C:\>cd Documents and Settings\Administrator\Desktop\New Folder (2)\avidemux_2.1.0_win32\avidemux_2.1.0

    C:\Documents and Settings\Administrator\Desktop\New Folder (2)\avidemux_2.1.0_wi
    n32\avidemux_2.1.0>a.bat
    \Documents was unexpected at this time.

    C:\Documents and Settings\Administrator\Desktop\New Folder (2)\avidemux_2.1.0_win32\avidemux_2.1.0>for \Documents and Settings\Administrator\Desktop\New Folder
    (2)\avidemux_2.1.0_win32\avidemux_2.1.0\avidemux2.exe" --load A.mp3 --quit

    C:\Documents and Settings\Administrator\Desktop\New Folder (2)\avidemux_2.1.0_win32\avidemux_2.1.0>
    Quote Quote  
  25. Member
    Join Date
    Dec 2004
    Location
    Australia
    Search Comp PM
    You could also try ffmpeg.
    Quote Quote  
  26. Ok,and how can i do it via ffmpeg?
    Quote Quote  



Similar Threads

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