Log in

View Full Version : [libavcodec] realtime lossless compression - advice?


coordz
19th September 2008, 19:53
I'm working on a video capture project and have hit a bandwidth problem shunting frames from the capture card to the hard drive. I want to capture uncompressed 1360x1024x24bpp RGB at 30fps (120Mbytes/s) but the hard drive can only cope with 50Mbytes/s. I'm using libavcodec so have a choice of lossless codecs: huffyuv (seems a little old but fast); ffv1 (seems slower but better compression); and ffvhuff (seems somewhere between the other 2 in terms of speed and compression).

I think any of these would fit the bill but I'm now canvassing for people's experiences with these especially as I want to capture RGB (not YUV which seems to be what most comparisons use). I found this (http://forum.doom9.org/showthread.php?p=577067#post577067) on the forums but it's quite old.

Thanks for any help and pointers.

Dark Shikari
19th September 2008, 20:33
FFV1 will probably not be fast enough.

FFVHUFF with adaptive huffman tables and median prediction will probably get the compression you need.

coordz
30th September 2008, 19:36
Yes, this seems to be the case. There seems to be a problem as well though..... I get a lot of "encoded frame too large" errors which I guess is because of the resolution being too high. Anyone any idea of how to fix this?

nm
30th September 2008, 21:38
This might help if you're using MEncoder (or give you a hint if not):
http://lists.mplayerhq.hu/pipermail/mencoder-users/2007-April/005695.html

coordz
1st October 2008, 01:27
Sadly I've already seen this mail post and I'm using libav directly. I'd like to know how mencoder changes libav's buffer size though.......

nm
1st October 2008, 10:16
Through avcodec_encode_video (http://wiki.aasimon.org/doku.php?id=ffmpeg:avcodec_encode_video):
out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size, pic);

coordz
1st October 2008, 18:06
Thanks nm