mpegts.js icon indicating copy to clipboard operation
mpegts.js copied to clipboard

Error to play h264 and aac 5.1 channels HTTP-FLV stream

Open winlinvip opened this issue 2 years ago • 1 comments

Start SRS to convert RTMP to HTTP-FLV:

docker run --rm -it -p 8080:8080 -p 1935:1935 ossrs/srs:5 \
  ./objs/srs -c conf/http.flv.live.conf

Download a small segment from: bbb-4k-10s.mp4.zip, or you can download the huge original source from bbb_sunflower_2160p_60fps_normal.mp4.

Transcode to HEVC by FFmpeg 6.1 and publish to SRS via RTMP:

ffmpeg -stream_loop -1 -re -i bbb-4k-10s.mp4 -c:v copy -c:a aac -ar 44100 \
  -f flv rtmp://localhost/live/livestream

Open http://localhost:8080/players/srs_player.html?autostart=true the errors is:

image

Workaround is to transcode the channels to 6 or 2:

ffmpeg -stream_loop -1 -re -i bbb-4k-10s.mp4 -c:v copy -c:a aac -ar 44100 -ac 6 \
  -f flv rtmp://localhost/live/livestream

Note that the original video is 6 channels, which is 5.1 channels.

winlinvip avatar Jan 06 '24 10:01 winlinvip

@winlinvip FFmpeg seems to send AAC audio_config = 0 in this situlation, it not supported in MSE (Chrome, Firefox, etc...) Workaround is specify channelmap -af channelmap=channel_layout=5.1. This enforce channel config to 6, seems OK.

monyone avatar Jan 06 '24 19:01 monyone