Opened 2 years ago

Closed 2 years ago

#5902 closed defect (needs_more_info)

ffmpeg freezes while converting live stream to hls

Reported by: ballot Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hi guys i am just trying to restream a live stream as hls
and my batch file just restarts ffmpeg if my source stream goes down as you see
but ffmpeg doesnt give an error doesnt crash does not exit process
it just hangs,stucks because of that my live stream stops and i have to restart it every half hour and not sure what is the reason

SETLOCAL
set bitrate=1200k
set yayinid=%random%%random%
:loop
																																																																																										
ffmpeg -i "http://185.59.222.55:1935/edge/ch104/yayin.m3u8" -i ayay.png -filter_complex "overlay=main_w-overlay_w-69:50,fps=35" -strict -2 -vcodec libx264 -preset veryfast -maxrate %bitrate% -minrate %bitrate% -minrate %bitrate% -r 30 -g 60 -c:a aac -b:a 128k -ar 44100 -f hls -hls_time 5 -hls_list_size 5 -hls_allow_cache 1 -hls_flags delete_segments -segment_list_flags +live -hls_base_url "../ts/" -hls_segment_filename "C:\nginx\html\ts\yay-%random%%random%-%%3d.svgz" -y "C:\nginx\html\hls\yay.m3u8"

goto loop

i have no idea how can i fix it, as i see it just stucks at writing last .ts file and freezes

this is how it looks when freezes
http://i.hizliresim.com/kEPPJv.jpg

Change History (7)

comment:1 Changed 2 years ago by ballot

i get this notice can it be the reason?

[mpegts @ 0000000000567fc0] Thread message queue blocking; consider raising the
thread_queue_size option (current value: 8)
Past duration 0.714272 too large
Past duration 0.857140 too large

comment:2 Changed 2 years ago by ballot

i tried to incrase by -thread_queue_size 512 but it stuck again
http://i.hizliresim.com/WbOjX2.jpg

not sure what to do

comment:3 Changed 2 years ago by llogan

The console output is composed of text. Please do not take screenshots of text; copy and paste it instead, and ensure that you include the complete output (you may trim the multiple repeating lines from the middle). Taking a screenshot of a partial output is like taking a screenshot of a half of an email message and sending that instead of the original text.

Scripts are not supported here. You should provide an unscripted command.

Lastly, it would be helpful if you could provide the most minimal command that allows you to reproduce the issue (no filtering, etc), and if you can do so with a native encoder (such as mpeg4) that would be even better.

Last edited 2 years ago by llogan (previous) (diff)

comment:4 Changed 2 years ago by llogan

  • Keywords ffmpeg live stream removed
  • Priority changed from critical to normal

comment:5 Changed 2 years ago by ballot

hi i tried to incrase logging level i got these logs after streaming freeze

[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] SDT:
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26
[mpegts @ 0000000001de3320] pid=100 pes_code=0x1e0
[mpegts @ 0000000001de3320] pid=101 pes_code=0x1c0
[mpegts @ 0000000001de3320] PAT:
[mpegts @ 0000000001de3320] PMT: len 26

comment:6 Changed 2 years ago by ballot

i think i found it , this command line options causes the error

-strict -2 -vcodec libx264

comment:7 Changed 2 years ago by llogan

  • Resolution set to needs_more_info
  • Status changed from new to closed

Still waiting for your actual, unscripted, minimal command and the console output that still shows the issue.

Note: See TracTickets for help on using tickets.