ffmpegvideo-streamingvlchttp-live-streamingplex

Ffmpeg -c copy not carrying over audio track from mkv to hls stream


I am using ffmpeg to create an hls stream. The source is an mkv with multiple audio tracks. I have tried using -map to specify the audio stream as well. I also found that when I point ffmpeg to any other audio stream in the file it works. It's just the first audio stream that does not. At one point I replaced -c copy with -acodec aac -ac 6 on the first stream and I got sound which is great but I am only looking to copy the stream and not re-encode it. The next thing I tried was using other mkv videos I have. All are reflecting the same issue. The mkv's by itself play both audio and video fine in VLC. When playing the output.m3u8 in VLC the option to choose different audio tracks is greyed out. Here is the command I'm using:

ffmpeg -i "./video.mkv" -ss 00:00:00 -t 00:00:30 -c copy -f hls "output.m3u8"

I want the audio of my hls stream to reflect that of the mkv source: enter image description here

Although what I get returned from the command above gives me no sound and shows me this in mediaInfo: enter image description here I've aslo noticed that hls does not support pcm. Is it possible dash could work with this stream because it is pcm?


Solution

  • HLS segments can be either MPEG-TS or fragmented MP4. Neither officially support PCM audio, so you'll have to convert it.

    DASH uses fragmented MP4 as segment format.