[FFmpeg-user] h264 and opus in mp4 container

Adi Marvillo adi5 at gmx.at
Mon Feb 26 10:40:58 EET 2018

Hi Vittal, what you want do do is called multiplexing after you have demultiplexed/seperated your video- and audiotrack from a stream.

ffmpeg can do demultiplexing-> conversion of audio track-> multiplexing A+V in one step with

ffmpeg -i INPUTFILE.mp4 -map 0:v -c:v libx264 -map 0:a -c:a libopus OUTPUTFILE.mp4

INPUTFILE means your original input.mp4 (sample.mp4). Be aware that you're loosing quality when converting your audio track from one format (aac) into the other lossy format (opus).... if you're not planning to do something special with the opus-track, just leave it as it is with copy.... -map 0:a -c:a copy

regards adi

Am 2018-02-26 um 05:36 schrieb Vittalprasad:
>  Hi All,
> From below link i saw that mp4 container can have h264 as video codec and
> opus as audio codec. so i tried  both codecs in to mp4 using ffmpeg, but
> external player like mplayer, vlc and kmp are failing to decode voice . i.e
> while playing mp4 file there is only video no voice.
> https://en.wikipedia.org/wiki/Comparison_of_video_container_formats
> Procedure followed using ffmpeg:
> 1. From sample mp4 file, i have separated audio(aac codec) and video(h264)
> in to different files .
> 2. aac trans-coded to opus
> 3. tried to merge video and audio(opus) in to single mp4
> please let me know
> 1. whether ffmpeg support above codecs in single mp4 file or issue with
> external player .
> If anyone has  mp4 file with h264 and opus codecs please provide me along
> with procedure to convert.

More information about the ffmpeg-user mailing list