3

I am trying to figure out the issue when pushing to RTMP which has HLS turned on. Below is the command I am using:

ffmpeg -i hls.m3u8.url -vcodec: copy -acodec libfdk_aac - -f flv rtmp://serverurl/live/test

Everything is great, all works as expected. However, as the source changes on the fly, like switching to another source from far end, it shows correct if I am watching via RTMP. However, if I use HLS play list that was generated by the RTMP module, the video's getting ghosting/piexlated with sound coming through fine. Till the source video goes back to original, then it resumes fine.

If I use HLS copy rather than using RTMP/HLS, then it works fine.

Why is it that the RTMP module writing HLS files is scrambling the video?
Is there a command to fix it?
It doesn't like if source changes video on the fly and keep writing the .ts file as corrupted. I can stop the RTMP and start again. Then it clears up the video till source video again changes in middle.

Keep in mind: if I watch same video via rtmp://, then the video switches fine. Only the HLS playlist, that got generated, showed the pixelation/ghosting with audio.

With HLS commands such as this -start_number 0 -hls_time 10 -hls_list_size 0 will correct them. However, for RTMP there is no such commmand.

This is my nginx config:

allow play all;
live on;
hls on;
hls_path /home/live;
hls_fragment 10s;
hls_cleanup on;

Anyone faced this issue?

zx485
  • 2,337

0 Answers0