VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Hi,

    I've got a video file with
    0.0 video
    0.1 ger audio
    0.2 eng audio

    I want to change this to
    0.0 video
    0.1 eng audio
    0.2 ger audio

    I tried this:
    "path\to\ffmpeg.exe" -vcodec copy -acodec copy -i in.avi out.avi -map 0.0 -map 0.2 -map 0.1 -newaudio

    Now, in the output file, the order of streams is as desired, but the first audio stream (eng) is all messed up, the second (ger) works and the output file is 10 mb smaller then the input file.

    What am I doing wrong?

    Win7x64, Zeranoe FFmpeg git-58257ea 64-bit Static (Latest) (2011-07-08)
    Quote Quote  
  2. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    Look at the FFmpeg log. Probably you'll see that the -newaudio stream is encoded instead of copied.

    Try this ...

    Code:
    "path\to\ffmpeg.exe" -i in.avi -vcodec copy -acodec copy out.avi -acodec copy -newaudio -map 0.0 -map 0.2 -map 0.1
    Quote Quote  
  3. Well, now the filesize is right but both audio streams are jumbled...
    Quote Quote  
  4. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    I don't know which app made the source avi, but I think two audio streams in an AVI is uncommon. I guess FFmpeg can't do that properly.

    Just to find out, you could try to mux it into mkv container and see if that works.
    Quote Quote  
  5. Thanks for the tip - the app for the source avi is virtualdub.

    But I don't care if it's avi, mkv or whatever.

    So I tried this
    "ffmpeg.exe" -i in.avi -vcodec copy -acodec copy out.mkv -acodec copy -newaudio -map 0.0 -map 0.2 -map 0.1
    with this result:
    [matroska @ 00000000002E15C0] Can't write packet with unknown timestamp
    av_interleaved_write_frame(): Invalid argument
    Quote Quote  
  6. I got it working now with mkvmerge:
    mkvmerge.exe -o out.in --track-order 0:0,0:2,0:1 in.avi
    Quote Quote  
  7. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    Originally Posted by MarquisdeOz View Post
    I got it working now with mkvmerge:
    mkvmerge.exe -o out.in --track-order 0:0,0:2,0:1 in.avi
    Even better!

    [matroska @ 00000000002E15C0] Can't write packet with unknown timestamp
    It would probably help with FFmpeg (to mkv) if you put -fflags genpts before the input command. That's the way I get rid of that message most of the time.
    Quote Quote  



Similar Threads

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