3

I have an mp4 video file that I've converted to .ts file with ffmpeg for streaming via m3u8. along with that mp4 I also have multiple audio files as .wav that are the alternate audio files for the video. I have added them to a main m3u8 file like this:

#EXTM3U
#EXT-X-VERSION:3

#EXT-X-STREAM-INF:BANDWIDTH=850000,RESOLUTION=640x360,AUDIO="bipbop_audio"
index0.m3u8

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="eng",NAME="BipBop Audio 1",
 AUTOSELECT=YES,DEFAULT=YES
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="nr",NAME="BipBop Audio 2",
 AUTOSELECT=NO,DEFAULT=NO,URI="audio1.m3u8"

when I go to play this using hls.js in the browser the video file's m3u8 is downloaded (index0.m3u8) and the video plays, but the audio file's m3u8 files are not downloaded by the browser and the audio does not play. I can actually see the alternate audio info in the hls.js object instance that is in the main m3u8 file when I console log it, but making hls.js switch to it does not make it download nor play.

So far I've tried:

  1. converting the audio to .mp3 via ffmpeg
  2. converting the audio to .ts via ffmpeg

here is what the .ts version of the audio file looks like as an m3u8

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2914
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:2913.661333,
abc0.ts
#EXT-X-ENDLIST

I'm pretty new to ffmpeg and hls.js, but is there some specific way I need to make ffmpeg generate the m3u8 files for both the audio and video to make them work together? so far I don't see any errors in the browser relating to the main m3u8 or hls.js.

zero
  • 2,759
  • 7
  • 38
  • 56

0 Answers0