[FFmpeg-user] restore video written with opencv

Ingo Flaschberger if at xip.at
Tue Oct 11 02:47:23 CEST 2011

> opencv changed some time ago how rawvideos are written, see:
> https://code.ros.org/trac/opencv/ticket/1400#comment:2
> https://code.ros.org/trac/opencv/ticket/782
> my problem is:
> rawvideo is written with pixfmt bgr24:
> Stream #0.0: Video: rawvideo, bgr24, 456x400, q=2-31, 11673 kb/s, 90k tbn, 4 
> tbc
> ffmpeg (and also all video-players) recognize the video as avi with codec 
> 420p / IYUV - and plays a broken video.
> I can force ffmpeg to use bgp24 as pixfmt when transcoding the video to 420p 
> - resulting in a viewable video but the image runs now from left to right and 
> top to bottom.
> Any ideas how I can restore the original video?
> I can provide a test-video if needed.

I have placed test-videos:
 	Video created with opencv / ffmpeg (same result also with opencv svn /
 	ffmpeg svn)
 	opencv set pixfmt bgr24 for rawvideo,
 	but codec tells this is a IYUV / 420p video

converted with:
 	ffmpeg -f rawvideo -pix_fmt bgr24 -r 4 -s 456x400 -i test1.avi
 		-vcodec rawvideo -pix_fmt bgr24 test2.avi
 	now the videos looks "better", but moves from left to right and top to

Any ideas if the original video stored by opencv could be restored?

Kind regards,
 	Ingo Flaschberger

More information about the ffmpeg-user mailing list