raw video broken since r5569 (Bug #1400)
Description
ffmpeg-0.8.4
opencv-trunk
videowriter with CV_FOURCC_DEFAULT (or any supported raw-video codec)
video with IYUV is created (acording to vlc or ffmpeg), but videowriter writes with:
Output #0, avi, to 'test.avi':
Stream #0.0: Video: rawvideo, bgr24, 456x400, q=2-31, 11673 kb/s, 90k tbn, 4 tbc
Resulting video is broken, can be converted back to a working video when bgr24 is forced at ffmpeg prompt, resulting but the picture "runs" from left to right in the video.
reverting Ticket #782 / r5569 solves the problem:
Output #0, avi, to 'test.avi':
Stream #0.0: Video: rawvideo, yuv420p, 456x400, q=2-31, 11673 kb/s, 90k tbn, 4 tbc
Related issues
duplicated by Bug #1413: VideoWriter YUV RAW video encoding error | Cancelled |
Associated revisions
Fixed a problem with CODEC_ID_RAWVIDEO in FFMPEG (ticket #1400)
Merge pull request #1400 from ilya-lavrenov:ocl_test_mog
History
Updated by Vadim Pisarevsky over 13 years ago
that fix (r5569) was for ticket #782. If we revert the fix, we will break that use case. Of course, we can not keep switching between these 2 variants forever. Waiting for a universal solution.
- Status deleted (
Open)
Updated by Ingo Flaschberger over 13 years ago
ok - how to get the data from the broken videos back?
Updated by Ingo Flaschberger over 13 years ago
finally found a solution how to repair the video:
use latest ffmpeg (0.8.4)
ffmpeg -i test1.avi -vcodec copy -vtag 0x18424752 intermediate.avi
ffmpeg -i intermediate.avi -vcodec rawvideo -pix_fmt yuv420p out.avi
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
- Assignee deleted (
Vadim Pisarevsky)
Updated by Alexander Shishkov almost 13 years ago
- Status set to Open
Updated by Alexander Reshetnikov almost 13 years ago
Hi, Ingo! This problem was because in CODEC_ID_RAWVIDEO case was no condition comparing input pixels format with GRAY formats.
The following code solves it:
case CODEC_ID_RAWVIDEO:
codec_pix_fmt = input_pix_fmt PIX_FMT_GRAY8 ||
input_pix_fmt PIX_FMT_GRAY16LE ||
input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
break;
It has already been applied in r7761
- Status changed from Open to Done
- Priority changed from High to Normal
- Assignee set to Alexander Reshetnikov
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-video