Monday, 2 December 2019

video - Mjpeg recording with FFMPEG preserving time information

I am recording the MJPEG video from an IP camera and saving it to a file but the problem is that file's duration is way smaller than the actual recording time. Its around 9 seconds video for 2 minutes recording. I tried following commands in order


ffmpeg -f mjpeg -r 8 -i http://c-cam.uchicago.edu/mjpg/video.mjpg -vcodec mpeg4 -b 1000000 -r 8 video_file.avi 

Then I omitted the most of the flags and tried like this


ffmpeg -f mjpeg -i http://c-cam.uchicago.edu/mjpg/video.mjpg video_file.avi

But the problem is that the duration of recorded file is 9 seconds where as the actual recording time is around 2 minutes. I finally tried setpts filter that is supposed to insert the timestamps. The command is as follows


ffmpeg -f mjpeg -i http://c-cam.uchicago.edu/mjpg/video.mjpg -vf "setpts=1*PTS" video_file.avi

But result was still the same. Recording time was way more than video duration.

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...