L
L
Lexaz2017-02-03 16:07:54
JavaScript
Lexaz, 2017-02-03 16:07:54

How to create a stream from images using FFMPEG?

There is a video camera. It serves the image via http, something like this http://1.2.3.4:80/img.jpg. I want to collect a stream of real-time images and issue it via RTMP and HLS. NGINX is configured, I pass rtsp through it to RTMP and HLS. We need a substream assembled from pictures. How to force ffmpeg to collect 2 times per second the image from the camera?
Ps or force the script to change the image in the div once every half a second, or a player that can request an image

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tsimur_S, 2017-02-03
@Lexaztost

setInterval(function () {$("#myimg").attr("src", " http://1.2.3.4:80/img.jpg.?timestamp= " + new Date().getTime()); }, 500) reload something like this (example with jquery just for demonstration), timestamp that would not be cached.
If you want to create a stream, it will be much more cumbersome: you will need to run wget every half second through watch and give the result to ffmpeg, which will append pictures to the video stream.

W
Wexter, 2017-02-03
@Wexter

for sure, the camera can do motion jpeg, it is inserted into the page with the usual img tag. what model?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question