FORUMS: list search recent posts

How to Record mjpeg video in a file with synchronized time Information

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
adeel Zahid
How to Record mjpeg video in a file with synchronized time Information
on Sep 13, 2012 at 11:24:53 am

Hi,
I am new to ffmpeg and I was trying to record the MJPEG video from an IP camera and store it in a file. Recording worked ok and file was created on the disk. When I played the video It played only for 2 minutes but it was recorded in around 10 minutes. Are there any flags in ffmpeg that I can use to save the timing information along with video data?


Regards
Adeel


Return to posts index

adeel Zahid
Re: How to Record mjpeg video in a file with synchronized time Information
on Sep 14, 2012 at 7:46:04 am

Hi again,

I have used following commands to record the video 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.


Return to posts index

Reuben Martin
Re: How to Record mjpeg video in a file with synchronized time Information
on Sep 16, 2012 at 1:10:13 am

It's an IP cam. It lies about it's frame rate. (It says it's frame rate is 25fps but that's crap)

When it can't send the frame in time it just drops it. Playback at a fixed framerate will no ever be quite right, although using the framerate of 8 should be somewhat in the ballpark.

ffmpeg -re -r 8 -i http://c-cam.uchicago.edu/mjpg/video.mjpg -r 8 -vcodec libx264 -preset slower -vprofile high -trellis 2 -crf 22 -pix_fmt yuv420p -an -f mp4 IpCamCapture.mp4


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]