Ffmpeg to duplicate the audio stream and encode this new stream

I have some video files that I need to transcode due to compatibility issues. They are currently mkv files with h.264 video and ac3-a52 audio. I want to save an h.264 video, convert the container to m4v and create two audio tracks, one with the original ac3-a52 and one copied from this, but in aac stereo.

I suppose there should be some kind of audio stream conversion command, but I don't know how to match and transcode at the same time. What command should I enter in ffmpeg for this?

Also, what is the difference between ac3 and ac3-a52? Will Apple TV still go through ac3-a52 or does it need to be converted to ac3?

+4
source share
2 answers

this works for me:

ffmpeg -y -i Source.mkv -map 0:v -c:v copy -map 0:a -c:a copy -map 0:a -strict -2 -c:a aac out.mkv
  • -y - global option to overwrite the output file, if it already exists.
  • -map 0:v - Specify the video stream from the first input as the source for the output file.
  • -c:v copy- Streaming copy of the video. This simply inserts the input to the output. No re-encoding occurs.
  • -map 0:a - Assign audio streams from the first input as the source for the output file.
  • -c:a copy- Stream copy audio. This simply inserts the input to the output. No re-encoding occurs.
  • -strict -2 -c:a aac - FFmpeg AAC. -strict -2 , , . , .

wikipedia, AC3 ATSC A/52: - , - , AC3. , - ?

+7

, OP, m4v. MacForts "nonfree" ffmpeg, libfaac, , AAC, , @dkam. , , :

ffmpeg -i input.m4v -map 0:v -c:v copy -map 0:a -c:a:0 copy -map 0:a -c:a:1 libfaac output.m4v

( iPad, , , ac3.)

+1

Source: https://habr.com/ru/post/1525342/


All Articles