Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Problem with ffmpeg soundstream

  • Problem with ffmpeg soundstream

    Posted by Daniel Bean on December 11, 2011 at 3:11 pm

    Hello guys

    i have a problem with ffmpeg. I only want to change the h264 level to 4.1
    I looked for the syntax and found one:

    ffmpeg -i abm.mkv -vcodec copy -acodec copy -vbsf h264_changesps=level=41 abmmuss.mkv

    ffmpeg take the file “abm.mkv” copy the sound and video stream, change the level to 4.1 and write the file “abmmuss.mkv”
    Here is my problem: I have a german sound stream in the input file and a english sound stream. In the output file is only the english one inside. But i want to have both.
    So i looked after a syntax and found “-map 0”.
    I put it in like this:
    ffmpeg -i abm.mkv -vcodec copy -acodec copy -map 0 -vbsf h264_changesps=level=41 abmmuss.mkv
    But it doesn’t work.
    How can i keep both streams?

    Thank you very much for your help!

    Reuben Martin replied 14 years, 7 months ago 2 Members · 7 Replies
  • 7 Replies
  • Reuben Martin

    December 12, 2011 at 5:43 am

    It depends on what version of ffmpeg is being used. What you are trying to do will work with the latest version of ffmpeg, but not on older versions.

    You may be using an older version where you have to explicitly map each audio channel and use a “-newaudio” syntax to have more than one audio stream in the output. (“-newaudio” is depreciated and no longer works on the most recent versions)

  • Daniel Bean

    December 12, 2011 at 8:59 pm

    Thank you for your answer. I have downloaded the version 0.9 and tried the command:

    ffmpeg -i abm.mkv -map 0 -vcodec copy -acodec copy -vbsf h264_changesps=level=41 abmmuss.mkv

    But i get a mistake notification: Unknown bitstream filter h264_changesps=level=41

    I don’t know where the mistake is. Are you able to help me?

    Thank you

  • Reuben Martin

    December 13, 2011 at 2:51 am

    That bitstream filter is not a standard ffmpeg filter. You have to apply a patch before building ffmpeg in order to access that functionality.

    ffmpeg -bsfs

    will tell you what bitstream filters are available.

    The patch for the filter you are referring to can be found here: https://forum.doom9.org/showthread.php?t=152419

    I think they have some patched win32 builds available.

  • Daniel Bean

    December 13, 2011 at 8:22 pm

    From this site i had the first version i used. The version you said its an old version. I don’t know how i have to integrate the filter.
    ffmpeg -bsfs give me this information:

    ffmpeg version N-35709-g7d531e8, Copyright (c) 2000-2011 the FFmpeg developers
    built on Dec 12 2011 13:56:52 with gcc 4.6.2
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
    ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
    ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
    able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
    -enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
    c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
    libxvid --enable-zlib
    libavutil 51. 32. 0 / 51. 32. 0
    libavcodec 53. 43. 0 / 53. 43. 0
    libavformat 53. 24. 0 / 53. 24. 0
    libavdevice 53. 4. 0 / 53. 4. 0
    libavfilter 2. 53. 0 / 2. 53. 0
    libswscale 2. 1. 0 / 2. 1. 0
    libpostproc 51. 2. 0 / 51. 2. 0
    Bitstream filters:
    text2movsub
    remove_extra
    noise
    mov2textsub
    mp3decomp
    mp3comp
    mjpegadump
    mjpeg2jpeg
    imxdump
    h264_mp4toannexb
    dump_extra
    chomp
    aac_adtstoasc

    Thank you for your help!!

  • Reuben Martin

    December 14, 2011 at 12:10 am

    The version you are using is a build of the 0.9 version. As you can see from the output there is no “h264_changesps” in the list of supported bitstream filters. Basically you can not do what you’re trying to do with the version of ffmpeg that you are using.

    Assuming you are on windows, you need this version here: https://sourceforge.net/projects/direct264/files/Related%20Programs/ffmpeg%20%28demuxer_muxer%20only%29/ffmpeg_git_31792.7z/download

  • Daniel Bean

    December 19, 2011 at 9:46 am

    Thank you. But now i get a different error:

    Number of stream maps must match numer of output streams

    I don’t know what this means…

  • Reuben Martin

    December 28, 2011 at 8:51 pm

    Yes, that patched version of ffmpeg is based off of an older version of ffmpeg, which uses different syntax for stream mapping.

    Try adding “-newaudio” onto the end of the command you are using. This is how the older versions added additional audio streams. The newer 0.9 doesn’t need that, but the modified version you are using is probably based of 0.7 or 0.8.

    (Basically, you are running into problems because online documentation, especially stuff found in community forums don’t tend to relay the version of ffmpeg being used. As new features get added, the syntax changes to accommodate new features.)

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy