1

I am using ffmpeg to stream first 35 seconds of a movie over udp .. in the process of showing a preview of this movie while streaming i reached this command

ffmpeg.exe -re -t 00:00:35.000 -i input.mp4 -i overlay.png -filter_complex "[0:v]scale=1200:720[scaled];[1:v]scale=150:-1[overl],[scaled][overl]overlay=main_w-overlay_w-10:10[logo]" -map "[logo]" -map 0:a -c:a copy  -c:v libx264 -f mpegts udp://224.2.2.1:1234 -vf fps=4 -s 320x240 -update 1 -y preview.jpg

the problem is .. if i don't use the overlay i get my preview.jpg perfectly, but when i do .. ffmpeg streams ok but without creating the jpg image ..

any idea ?? please.

thank you.

2
  • Do you want the preview with the overlay?
    – Gyan
    Jun 7, 2018 at 16:44
  • Yes and with all the applied filters like subtitle and banner and so...
    – Tony Hanna
    Jun 7, 2018 at 16:54

1 Answer 1

1

The final processed stream has to be cloned and mapped, so for the given command,

ffmpeg.exe -re -t 00:00:35.000 -i input.mp4 -i overlay.png -filter_complex "[0:v]scale=1200:720[scaled];[1:v]scale=150:-1[overl];[scaled][overl]overlay=main_w-overlay_w-10:10,split=2[logo][preview];[preview]fps=4,scale=320x240[preview]" -map "[logo]" -map 0:a -c:a copy  -c:v libx264 -f mpegts udp://224.2.2.1:1234 -map "[preview]" -update 1 -y preview.jpg

(The issue corrected here has nothing to do with the updating of a single image).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.