VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    First let me start off by saying that I am newcomer to FFMpeg so please be patient with my lack of knowledge. I am preparing to do a little work that will include a lot of copying the stream data directly via the "-vcodec/acodec/scodec copy" command in ffmpeg. I decided to test to see if I could copy the stream of both the video and audio from a xvid video and vorbis audio mkv into another mkv but ran into some problems(most aggravating of which is the "non monotone timestamp" error). I have tried all of the following commands:

    These codes both cause FFMpeg to attempt to map a subtitle track onto an audio stream, at least that is what it seems to be doing(if anyone can tell me how to correct this in a non convoluted way I would be much obliged), which makes me wonder if I am correctly encoding the dual audio:

    Code:
    ffmpeg -i <input.mkv> -vcodec copy -acodec copy <output.mkv>
    and

    Code:
    ffmpeg -i <input.mkv> -vcodec copy -acodec copy <output.mkv> -acodec copy -newaudio
    gives this error:

    Code:
    Input #0, matroska, from 'input.mkv':
    Stream #0.0: Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 23.98 tb(r)
       Stream #0.1(eng): Audio: vorbis, 48000 Hz, stereo
       Stream #0.2(jpn): Audio: vorbis, 48000 Hz, stereo
       Stream #0.3: Subtitle: 0x0000
    Output #0, matroska, to 'output.mkv':
       Stream #0.0: Video: mpeg4, yuv420p, 640x480, q=2-31, 23.98 tb(c)
       Stream #0.1(eng): Audio: vorbis, 48000 Hz, stereo
       Stream #0.2: Subtitle: 0x0000
       Stream #0.3(jpn): Audio: vorbis, 48000 Hz, stereo
    Stream mapping:
       Stream #0.0 -> #0.0
       Stream #0.1 -> #0.1
       Stream #0.3 -> #0.2
       Stream #0.2 -> #0.3
    Unsupported codec for output stream #0.2
    (Which I guess can be fixed by passing -scodec copy(which will still copy stream 2 to 3 and 3 to 2 unless you pass -sn and then -scodec copy -newsubtitle, but this seems to get a little ridiculous, isn't there a way to just copy a dual audio stream?)

    But for the purpose of speeding this up(very slightly) I used this code:

    Code:
    ffmpeg -i <input.mkv> -vcodec copy -acodec copy -sn <output.mkv>
    and

    Code:
    ffmpeg -i <input.mkv> -vcodec copy -acodec copy -sn <output.mkv> -acodec copy -newaudio
    Both of these codes have given me the following error regardless of what dual audio xvid/vorbis I have fed it:

    Code:
    error, non monotone timestamps 57 >= 57
    av_interleaved_write_frame(): Error while opening file
    I get the same error when trying to encode xvid video and vorbis audio(including ogm) to avi with the first code, which I can fix by specifying a different audio codec; dual audio will also work this way:

    Code:
    ffmpeg -i <input.ogm/mkv> -vcodec copy -acodec libmp3lame -ab 192k -ar 48000 -ac 2 <output.avi>
    Dual Audio:

    Code:
    ffmpeg -i <input.ogm/mkv> -vcodec copy -acodec libmp3lame -ab 192k -ar 48000 -ac 2 <output.avi> -acodec libmp3lame -ab 192k -ar 48000 -ac 2 -newaudio
    However, when using the same code with certain mkvs I receive the "non monotone timestamps" error again(Another strange note, when I am able to encode successfully I can also output to an mkv container, but the resulting video is jerky and does not include any dual audio even when specified, any help with this would also be appreciated). This time though, it is slightly different in that it encodes for a short time(until it gets to frame around 3800) and then spews out the error with slightly different parameters:

    Code:
    error, non monotone timestamps 3831 >= 3831
    av_interleaved_write_frame(): Error while opening file
    Nothing that I can see is out of the ordinary about frame 3831 on the video that gave that particular error message.

    I would much appreciate it if anyone can tell me any of the following:

    1. What I am doing wrong.
    2. Is there an easy way(preferably one command) to copy and correctly map the direct streams of a dual audio file without using convoluted commands(e.g. -acodec copy -sn ouput.mkv -acodec copy -newaudio -scodec copy -newsubtitle)

    and most importantly:

    3. What on earth is a "non monotone timestamp" or for that matter a "monotone timestamp" and how do I fix this problem? I have scoured the net to no avail in an attempt to discover the meaning of this cryptic error message.

    Entire FFMpeg Output:

    Code:
    ffmpeg -i "input.mkv" -vcodec copy -acodec copy -sn "output.mkv"
    FFmpeg version SVN-r12665, Copyright (c) 2000-2008 Fabrice Bellard, et al.
      configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilt
    er-lavf --enable-pthreads --enable-liba52 --enable-avisynth --enable-libfaac --e
    nable-libfaad --enable-libgsm --enable-memalign-hack --enable-libmp3lame --enabl
    e-libnut --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
     --cpu=i686 --extra-ldflags=-static
      libavutil version: 49.6.0
      libavcodec version: 51.54.0
      libavformat version: 52.13.0
      libavdevice version: 52.0.0
      built on Apr  2 2008 22:35:11, gcc: 4.2.3
    [matroska @ 00AA6C70]Ignoring seekhead entry for ID=0x1549a966
    [matroska @ 00AA6C70]Ignoring seekhead entry for ID=0x1654ae6b
    [matroska @ 00AA6C70]Ignoring seekhead entry for ID=0x114d9b74
    [matroska @ 00AA6C70]Ignoring seekhead entry for ID=0x1043a770
    [matroska @ 00AA6C70]Unknown entry 0x73a4 in info header
    [matroska @ 00AA6C70]Unknown track header entry 0x23314f - ignoring
    [matroska @ 00AA6C70]Unknown track header entry 0x23314f - ignoring
    [matroska @ 00AA6C70]Unknown track header entry 0x23314f - ignoring
    [matroska @ 00AA6C70]Unknown track header entry 0x23314f - ignoring
    [matroska @ 00AA6C70]Unknown matroska file header ID 0x1043a770
    Input #0, matroska, from 'Input.mkv':
      Duration: 00:23:46.6, start: 0.000000, bitrate: N/A
        Stream #0.0: Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 23.98 tb(r)
        Stream #0.1(eng): Audio: vorbis, 48000 Hz, stereo
        Stream #0.2(jpn): Audio: vorbis, 48000 Hz, stereo
        Stream #0.3: Subtitle: 0x0000
    File 'output.mkv' already exists. Overwrite ? [y/N] y
    Output #0, matroska, to 'output.mkv':
        Stream #0.0: Video: mpeg4, yuv420p, 640x480, q=2-31, 23.98 tb(c)
        Stream #0.1(eng): Audio: vorbis, 48000 Hz, stereo
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    Press [q] to stop encoding
    error, non monotone timestamps 57 >= 57
    av_interleaved_write_frame(): Error while opening file
    Quote Quote  
  2. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by blazerqb11
    FFmpeg version SVN-r12665,
    update to something more recent
    http://arrozcru.no-ip.org/tripp

    Originally Posted by blazerqb11
    1. What I am doing wrong.
    not much,
    ffmpeg is what it is,
    and complex, muxing/remuxing is not a strength.
    use something more dedicated to the task, like mkvtoolnix for mkvs.

    Originally Posted by blazerqb11
    2. Is there an easy way(preferably one command) to copy and correctly map the direct streams of a dual audio file without using convoluted commands(e.g. -acodec copy -sn ouput.mkv -acodec copy -newaudio -scodec copy -newsubtitle)
    that's the syntax.
    -newaudio only auto routes mapping when input streams equal output streams.

    Originally Posted by blazerqb11
    3. What on earth is a "non monotone timestamp" or for that matter a "monotone timestamp" and how do I fix this problem? I have scoured the net to no avail in an attempt to discover the meaning of this cryptic error message.
    God knows... (aka Michael Niedermayer in this context)

    much of understanding ffmpeg, means undersanding c, and audiovisual internals.
    c'est la vie


    tripp
    "I'll give you five dollars if you let me throw a rock at you"
    Quote Quote  
  3. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    First off thanks for replying, I know that was a long post.
    Originally Posted by 45tripp
    update to something more recent
    http://arrozcru.no-ip.org/tripp
    Cool, I was just getting one from the videohelp.com mirror. Actually, I'm working on compiling my own but I need to figure out what I want to enable.

    Originally Posted by 45tripp
    that's the syntax.
    -newaudio only auto routes mapping when input streams equal output streams.
    First, are you saying that the way I did that is actually the best way to do it?

    And second, the input streams do equal the output streams. I have one video, two audio and one subtitle in both the input and output. I can run -vodec copy -acodec <new parameters because copy results in non monotone error> -scodec copy -acodec <new parameters because copy results in non monotone error> -newaudio and It will still cross streams 2 and 3, though I don't get the "unsupported codec" error. If I was able to use copy would it map them all to the same stream? I suppose maybe it doesn't matter, it just seems a little odd.
    Quote Quote  
  4. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by blazerqb11
    First, are you saying that the way I did that is actually the best way to do it?
    probably.
    if you want to remux with this tool.

    Originally Posted by blazerqb11
    It will still cross streams 2 and 3, though I don't get the "unsupported codec" error.
    meaning it works, which is a big difference from something non-working.
    do crossed streams matter to you?
    it's probably unattractive, but you can always manually map them,
    which will just extend your commandline even more though.

    Originally Posted by blazerqb11
    If I was able to use copy would it map them all to the same stream?

    that makes no sense actually.
    no. copy vs encode wouldn't make a difference to the mapping, if that's what you mean.

    and btw,
    putting vorbis in an avi, is a very bad idea.
    i forgot to mention that last time.
    like water and oil basically.

    Originally Posted by blazerqb11
    it just seems a little odd.
    probably


    tripp
    "I'll give you five dollars if you let me throw a rock at you"
    Quote Quote  
  5. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    Originally Posted by 45Tripp
    meaning it works, which is a big difference from something non-working.
    do crossed streams matter to you?
    it's probably unattractive, but you can always manually map them,
    which will just extend your commandline even more though.
    Yea I know it works, It is just weird.

    Originally Posted by 45Tripp
    that makes no sense actually.
    no. copy vs encode wouldn't make a difference to the mapping, if that's what you mean.
    Yes, I meant copy vs encode. The reason why I asked that question is because you said it automatically maps if you have the same number of streams. Does that just mean that it will not cross codecs but it will change the stream order?

    Originally Posted by 45Tripp
    and btw,
    putting vorbis in an avi, is a very bad idea.
    i forgot to mention that last time.
    like water and oil basically.
    I didn't know that thanks for the info. I will definitely keep that in mind in the future, however I don't really want to put this into an avi container; I want to put it in an mkv. All the avi stuff was just tests. I guess I don't really have much choice but to check out mkvtools now.
    Quote Quote  
  6. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    Remuxing with MKVtools seems to have solved the problem, however I am still having playback issues with Media Player Classic and small playback issues with VLC. Playback is flawless in MPlayer though.
    Quote Quote  
  7. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by blazerqb11
    Does that just mean that it will not cross codecs but it will change the stream order?
    yes.

    Originally Posted by blazerqb11
    Remuxing with MKVtools seems to have solved the problem,
    it's the right tool

    Originally Posted by blazerqb11
    however I am still having playback issues
    still?
    this the first mention of them.

    what kind of problems?
    perhaps open a new thread for it.


    tripp
    "I'll give you five dollars if you let me throw a rock at you"
    Quote Quote  
  8. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    Originally Posted by 45tripp
    still?
    this the first mention of them.

    what kind of problems?
    perhaps open a new thread for it.
    I didn't mention them because it wasn't my primary concern and I assumed the videos were fine because MPlayer played them perfectly. I guess that may have been an incorrect assumption because I just tried a different MKV I have and it worked fine in all three players.

    The videos jutter constantly in Media Player Classic, and there is a slight transposition of a few frames at the beginning of the video while playing in VLC.
    Quote Quote  
  9. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    yeah open a new thread.

    post a screenshot from mediainfo of the problem file,
    post info on what kind of ds codecs you have setup on your system.

    bad playback on vlc is never a good sign.
    could well be a bad file.

    i'm generally interested in shitty files for samples,
    so you could upload it if you liked too.

    tripp
    "I'll give you five dollars if you let me throw a rock at you"
    Quote Quote  



Similar Threads

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