Page 1 of 1

ffmpeg doesn't work for <4x

Posted: Fri Oct 15, 2004 11:20 am
by Ben G
Hi

I've seen a couple of previous posts about this problem, but no solutions.

I've got SuSE 9.1, ZM 1.19.5 and ffmpeg-0.4.9-pre1.

ZM works, but when I try to make mpeg videos, it only works for 4x realtime or greater. I get errors for anything less. This seems to be because ffmpeg only works for 25fps, and since the ZM capture at normal speed is less than this (USB cam), it doesn't work.

Any ideas?

Ben

Posted: Fri Oct 15, 2004 11:26 am
by zoneminder
Hi Ben,

I can happily generate videos of events at less than 25fps.

This is the output from zmvideo.log for one of those events

Code: Select all

Creating video file F-127712.mpg for event 127712
/usr/local/bin/ffmpeg -y -hq -r 10.66 -s 352x288 -i %03d-capture.jpg F-127712.mpg > mpeg.log
Input #0, image, from '%03d-capture.jpg':
  Duration: 00:00:07.6, bitrate: N/A
  Stream #0.0: Video: rawvideo, yuvj420p, 352x288, 10.66 fps
Output #0, mpeg, to 'F-127712.mpg':
  Stream #0.0: Video: mpeg1video (hq), 352x288, 10.66 fps, q=2-31, 200 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=   14 q=7.0 size=     112kB time=1.3 bitrate= 698.6kbits/s    ^Mframe=   32 q=14.0 size=     170kB time=3.0 bitrate= 463.9kbits/s    ^Mframe=   48 q=16.0 size=     214kB time=4.5 bitrate= 389.3kbits/s    ^Mframe=   67 q=12.0 size=     264kB time=6.3 bitrate= 344.1kbits/s    ^Mframe=   82 q=12.0 size=     296kB time=7.7 bitrate= 315.2kbits/s    ^M

Finished F-127712.mpg
What do you get in zmvideo.log that might be different I wonder.

Phil,

Posted: Fri Oct 15, 2004 9:54 pm
by Ben G
Hi Phil.
Thanks for the quick respose.

Here's the output of zmvideo.log. There's two results, one for 2x and the second for 4x. 4x worked, 2x didn't.
2x============
Creating video file Event-1498.mpg for event 1498
/usr/local/bin/ffmpeg -y -hq -intra -r 12.92 -s 320x240 -i %03d-capture.jpg Event-1498.mpg > mpeg.log
[mjpeg @ 0x827f3b8]get_buffer() failed
Input #0, image, from '%03d-capture.jpg':
Duration: 00:00:05.2, bitrate: N/A
Stream #0.0: Video: rawvideo, yuvj420p, 320x240, 12.92 fps
Output #0, mpeg, to 'Event-1498.mpg':
Stream #0.0: Video: mpeg1video (hq), 320x240, 12.00 fps, q=2-31, 200 kb/s
Stream mapping:
Stream #0.0 -> #0.0
[mpeg1video @ 0x827f3b8]MPEG1/2 doesnt support 12/1 fps
Error while opening codec for stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

Error: 1 at /usr/local/bin/zmvideo.pl line 259.
Creating video file Event-1498.mpg for event 1498
4x======
/usr/local/bin/ffmpeg -y -hq -intra -r 25.84 -s 320x240 -i %03d-capture.jpg Event-1498.mpg > mpeg.log
[mjpeg @ 0x827f3b8]get_buffer() failed
Input #0, image, from '%03d-capture.jpg':
Duration: 00:00:02.6, bitrate: N/A
Stream #0.0: Video: rawvideo, yuvj420p, 320x240, 25.84 fps
Output #0, mpeg, to 'Event-1498.mpg':
Stream #0.0: Video: mpeg1video (hq), 320x240, 25.00 fps, q=2-31, 200 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 66 q=24.8 Lsize= 284kB time=2.6 bitrate= 894.8kbits/s
video:282kB audio:0kB global headers:0kB muxing overhead 0.802773%

Finished Event-1498.mpg
============
See the note in 2x regarding the 12/1 fps. I get a similar one about 5/1 fps when I ty to run realtime. I note you aren't using the -intra swtich. I don't know what this does.

Ben

Posted: Fri Oct 15, 2004 10:40 pm
by zoneminder
I can't recall what the intra switch does either. You can test things like that by just cd'ing to the event directory in question and running the ffmpeg line directly.

Phil,

Posted: Fri Oct 15, 2004 10:55 pm
by Ben G
Thnaks, Phil.

I've been doing just that, but can't make progress. I've even tried other formats (avi, etc), but my winbox doesn't like them. Maybe I've got a problem with ffmpeg.

What version of ffmpeg works for you? I've got the latest - maybe I'll install a previous version?
Ben

Posted: Sat Oct 16, 2004 11:39 am
by victor_diago
this may occur if you are capturing at less than 1 fps.

in this case, just turn fps capture to 1 instead 0.xxx

if you dont, so check the command line options that goes to ffmpeg


victor diago