Opened 3 years ago
Last modified 3 years ago
#9215 new defect
stream_loop -1 not working with filter_complex overlay
Reported by: | codeSam | Owned by: | |
---|---|---|---|
Priority: | important | Component: | ffmpeg |
Version: | unspecified | Keywords: | stream_loop |
Cc: | codeSam | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Stream does not start when using stream_loop -1 together with filter_complex overlay. With stream_loop 0 stream is ok, but of course doesn't update the overlay.
How to reproduce:
'ffmpeg',
'-thread_queue_size', '1024',
'-i', 'rtsp://...',
'-f', 'image2',
'-stream_loop', '-1',
'-i', 'picture.png',
'-filter_complex', 'overlay=(main_w-overlay_w)/2:main_h*0.1-overlay_h',
'-acodec','aac',
'-ar', '44100',
'-ab', '128k',
'-f', 'flv',
'-g', '30',
'-vcodec', 'libx264',
'-preset', 'ultrafast',
'-crf', '30',
'rtmp://...'
In single line:
ffmpeg -thread_queue_size 1024 -i rtsp://... -f image2 -stream_loop -1 -i picture.png -filter_complex "overlay=(main_w-overlay_w)/2:main_h*0.1-overlay_h" -acodec aac -ar 44100 -ab 128k -f flv -g 30 -vcodec libx264 -preset ultrafast -crf 30 rtmp://...
ffmpeg version 4.4 is the problem. Works fine on FFmpeg 4.3.2. Also tried loop instead of stream_loop. Same result.
Change History (4)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
I changed "stream_loop -1" filter to" loop true" and it started to work normally as before. No other changes were required.
'ffmpeg',
'-thread_queue_size', '1024',
'-i', 'rtsp://...',
'-f', 'image2',
'-loop', 'true',
'-i', 'picture.png',
'-filter_complex', 'overlay=(main_w-overlay_w)/2:main_h*0.1-overlay_h',
'-acodec','aac',
'-ar', '44100',
'-ab', '128k',
'-f', 'flv',
'-g', '30',
'-vcodec', 'libx264',
'-preset', 'ultrafast',
'-crf', '30',
'rtmp://...'
In single line:
ffmpeg -thread_queue_size 1024 -i rtsp://... -f image2 -loop true -i picture.png -filter_complex "overlay=(main_w-overlay_w)/2:main_h*0.1-overlay_h" -acodec aac -ar 44100 -ab 128k -f flv -g 30 -vcodec libx264 -preset ultrafast -crf 30 rtmp://...
comment:3 by , 3 years ago
Well, "loop true" works only for 1 minute for some strange reason. After that picture.png doesn't update on the stream... Weird...
Please do tell if this change helps:
https://trac.ffmpeg.org/ticket/9160#comment:14