Search code examples
videoffmpegmp4m3u8hls.js

FFmpeg mp4 to m3u8 but audio not working


Command I'm using

ffmpeg -y -i video.mp4 -vcodec libx264 -preset superfast -r 25 -vb 240000 -s 
426x240 -aspect 1.77 -acodec libfdk_aac -ab 128k -ar 48000 -an -g 30 -r 30 
-hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_playlist_type vod 
-bsf:a aac_adtstoasc video.m3u8

output shows "no audio"

http://dailymotion.github.io/hls.js/demo/?src=http%3A%2F%2Ftvfiless.com%2Fvideo.m3u8&enableStreaming=true&autoRecoverError=true&enableWorker=true&levelCapping=-1

anyone help what's wrong in my command

Update

ffmpeg -i video.mp4 -c:v libx264 -c:a aac -strict -2 -f hls -hls_list_size 0 output.m3u8

i tried this command and its working fine, generating audio with m3u8, but i want to integrate it with my above command.

Thanks


Solution

  • ffmpeg -y -i video1.mp4 -f mp4 -vcodec libx264 -preset superfast -r 25 -vb 240000 -s 426x240 -aspect 1.77 -acodec libfdk_aac -ab 128k -ar 48000 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_playlist_type vod output.m3u8