1
votes

I'm doing a simple test of ffmpeg. I'd like to use it for thumbnail generation / video grabbing for a website I'm developing. I'm currently using VLC to grab a single frame and then generate a thumbnail, but it's rather slow and a bit cumbersome.

The problem is that the video I'm using (from my own pc) is generated by security camera software and it has an odd video format. When I open it (.bvr) in VLC, it plays very, very fast. A 10 second video goes by in about 2.5 seconds. Additionally, using a simple convert with ffmpeg "ffmpeg -i test.bvr output.avi" generates a proper-length video (10 seconds), but the video frame never changes. (It's a still image)

Test file and test output file:

I think this is primarily caused by the fact that the IP cameras may only generate 5-7 fps but the security software doesn't know better and writes it as if it should be 24/30 fps.

FFMpeg Reports: [m4v @ 00000000002cec60] Estimating duration from bitrate, this may be inaccurate Input #0, m4v, from 'test.bvr': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5 tbr, 1200k tbn, 5 tbc Output #0, avi, to 'output.avi': Metadata: ISFT
: Lavf54.25.104 Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 5 tbn, 5 tbc Stream mapping:

Stream #0:0 -> #0:0 (mpeg4 -> mpeg4) Press [q] to stop, [?] for help frame= 50 fps=0.0 q=2.0 Lsize= 244kB time=00:00:10.00 bitrate= 199.7kbits/s video:237kB audio:0kB subtitle:0 global headers:0kB muxing overhead 2.877066%**

Any help is appreciated!

1
Perhaps it is unable to determine the framerate but understands how to decode the stream. Have you tried forcing a constant framerate of 6 fps?BlueVoodoo
The problem is that although in this case it's my own video, it will generally be customers uploading their own stuff. I have no idea what the framerate should be.Jason Muchow

1 Answers

0
votes

Not really a programming question. But here is my input anyways. The content produced is mpeg4 elementary stream. So there is no way this will be played at correct frame rate by vlc.

Secondly your video is a static frame with one illumination change only and with the time code increasing below at bottom right from 21s to 32s. So are you saying that your output video does not the time code changing at the bottom right?

EDIT: vlc is not able to play it for me too. However ffplay is able to play it fine at my end and also you can use ffmpeg to grab the thumbnail wherever you want.

EDIT: This works with vlc as well:

ffmpeg -i input.dvr -vcodec mpeg4 output.avi

This plays in vlc as well. One thing is you should give the target bitrate and resolution as well.