Page 1 of 1

Video Export Compression/Quality (mpg/wmv/etc.)

Posted: Sun Aug 26, 2007 11:01 pm
by scottfinman
When creating a video to export (in any of the several formats available; I tried them all) through ffmpeg, the quality is substantially lower than that of the original jpeg images (in particular, grainy with subtle squares showing up). Nothing terrible, but still noticeably worse than the quality that is there to start out with.

I tried passing the "-compression-level 0" parameter through Zoneminder to ffmpeg, as per the ffmpeg documentation, with no noticeable effect on the video quality.

While I realize compression comes in handy for smaller file sizes and quicker responses, the amount of times I create a video from an event is not very often, and it's easier to pass off an event in a single video file to law enforcement when need be.

Any thoughts on how to tackle this, or is this just a reality of the jpeg-to-mpeg/wmv/et al. format jump?

Posted: Mon Aug 27, 2007 9:21 am
by jameswilson
Its an mpeg thing mate
I messed a lot with mpeg encoding and you can increase the bitrate from std to much higher settings but the only way i have found to reduce this to (what i deem an acceptable quality) is to match the jpeg bitrate, ie quite high. avi is incompressed though so you may be better using that format?

Passing bit_rate to ffmpeg

Posted: Mon Aug 27, 2007 9:50 am
by scottfinman
Thanks for pointing me in that direction. It seems that changing the bitrate doesn't seem to make a dent though. In particular, I'm passing "-bit_rate <integer>", as per the ffmpeg documentation, with said integer being everything from 2 bytes/sec to 2 MB/s with no effect on the file size in either .avi or .mpg format (even .avi is showing the fuzzy square effect).

Seems that you have experience with exactly this issue; what settings in particular work for your setup? I presume the appropriate calculation for the jpeg bitrate would be something like 640*480*3 for a color 640x480 image?

My Bad

Posted: Mon Aug 27, 2007 9:58 am
by scottfinman
Upon further investigation, the -bit_rate flag was for a different ffmpeg plugin (a lot of flag options to pass through!)...scrolling up a bit in the list gave the proper option of "-b <integer>" to pass in a bitrate in kb - all is well, high quality video now.

Thanks James!

Posted: Wed Aug 29, 2007 6:08 pm
by AmmarossDanan
I've noticed the default output is of rather low quality myself. Maybe you should try this (Options -> Images):
ZM_FFMPEG_OUTPUT_OPTIONS = -r 20 -pass 2 -b 5000k

Works well for me.

Posted: Thu Jun 24, 2010 2:16 am
by control_freak
Thanks this worked for me, I'm very new.

Under Options > Images > FFMPEG_OUTPUT_OPTIONS I put this

-r 25 -b 5000k

now my video exports are high quality. :)