Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE

This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

ffmpeg reencode only mp2, without manual stream set

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

ffmpeg reencode only mp2, without manual stream set

Postby cloudclimber » Sun Jul 16, 2017 6:51 pm


i have some streams which contains one or more mp2 Audio Streams, but not only. There are often also mp3 and ac3 in it.
I'd like to reencode all mp2 Audio Codecs to mp3.

I know how to do this by specifing the stream,
but i'm searching a way in which ffmpeg automatic reencode only mp2-Audio to mp3 and keeps ac3 and other Audiocodecs untouched.

the way now, for every Stream:
- do ffprobe
- note stream numbers for mp2 Audio streams (for example 2 and 3)
- modify ffmpeg to:
ffmpeg -i /some/Input -map 0:v -map 0:a -c:v copy -c:a:2 mp3 -c:a:3 mp3 -f /some/Output
- run ffmpeg and then do again with next stream

i'm searching a generic way which maybe looks like this:
ffmpeg -i /some/Input -map 0:v -map 0:a -c:v copy -c:a mp2->mp3 -f /some/Output

is there something existing like this in ffmpeg?
hope someone can help me.

with regards
Posts: 6
Joined: Sat Nov 07, 2015 8:24 pm

Re: ffmpeg reencode only mp2, without manual stream set

Postby mulvya » Mon Jul 17, 2017 1:14 pm

Not possible. You'll have to use ffprobe first.
Posts: 570
Joined: Mon Oct 26, 2015 6:58 am

Return to ffmpeg

Who is online

Users browsing this forum: Google [Bot] and 7 guests