[FFmpeg-user] Blue images from raw capture

Yan Seiner yan at seiner.com
Tue Nov 20 00:02:47 CET 2012


I'm getting blue images after trying raw video capture:

http://seiner.com/cz/2012_11_19T14h32m45sZ_0.000236_44.088333_-123.139347.jpg

I'm guessing it has something to do with the yuyv422 pix format I am using
in the second step, but I can't figure out which one I should be using.  I
need to capture raw video since my processor is not very fast, and
capturing directly to jpg or png takes too long, so I capture raw video,
which I can do very fast, then break it up into single images.

*************************************
Step 1: capture raw video

ffmpeg -f video4linux2 -s $SIZE -i /dev/video0 -vframes $NFRAMES -f
rawvideo /tmp/video.raw

ffmpeg version 0.11.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 19 2012 09:50:17 with gcc 4.6.3 20120201 (prerelease)
  configuration: --enable-cross-compile
--cross-prefix=mips-openwrt-linux-uclibc- --arch=mips --target-os=linux
--prefix=/usr --enable-shared --enable-static --disable-debug
--pkg-config=pkg-config --enable-gpl --enable-version3 --disable-asm
--disable-doc --disable-dxva2 --enable-pthreads --disable-optimizations
--enable-small --disable-stripping --enable-zlib --disable-outdevs
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[video4linux2,v4l2 @ 0x5b7590] Estimating duration from bitrate, this may
be inaccurate
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1353393444.461598, bitrate: 94277 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 512x384,
94277 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
[buffer @ 0x5b2670] w:512 h:384 pixfmt:yuyv422 tb:1/1000000 sar:0/1
sws_param:flags=2
[buffersink @ 0x5b29a0] No opaque field provided
Output #0, rawvideo, to '/tmp/video.raw':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 512x384,
q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> rawvideo)
Press [q] to stop, [?] for help
frame=   12 fps=4.5 q=0.0 Lsize=    4608kB time=00:00:00.40
bitrate=94277.6kbits/s
video:4608kB audio:0kB global headers:0kB muxing overhead 0.000000%

***************************************************
Step 2: break up video into individual frames

ffmpeg -f rawvideo -pix_fmt yuyv422 -s $SIZE -i /tmp/video.raw -vf yadif
-f image2 /tmp/road%02d.png

ffmpeg version 0.11.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 19 2012 09:50:17 with gcc 4.6.3 20120201 (prerelease)
  configuration: --enable-cross-compile
--cross-prefix=mips-openwrt-linux-uclibc- --arch=mips --target-os=linux
--prefix=/usr --enable-shared --enable-static --disable-debug
--pkg-config=pkg-config --enable-gpl --enable-version3 --disable-asm
--disable-doc --disable-dxva2 --enable-pthreads --disable-optimizations
--enable-small --disable-stripping --enable-zlib --disable-outdevs
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[rawvideo @ 0xaf5620] Estimating duration from bitrate, this may be
inaccurate
Input #0, rawvideo, from '/tmp/video.raw':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 512x384, 25
tbr, 25 tbn, 25 tbc
[buffer @ 0xaf5dc0] w:512 h:384 pixfmt:yuyv422 tb:1/25 sar:0/1
sws_param:flags=2
[buffersink @ 0xaf27a0] No opaque field provided
[yadif @ 0xaf2d00] mode:0 parity:-1 auto_enable:0
[yadif @ 0xaf2d00] auto-inserting filter 'auto-inserted scaler 0' between
the filter 'src' and the filter 'Parsed_yadif_0'
[scale @ 0xaf2c30] w:512 h:384 fmt:yuyv422 sar:0/1 -> w:512 h:384 fmt:gray
sar:0/1 flags:0x4
Output #0, image2, to '/tmp/road%02d.png':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: png, gray, 512x384, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> png)
Press [q] to stop, [?] for help
Truncating packet of size 393216 to 1 0kB time=00:00:00.44 bitrate=  
0.0kbits/s
frame=   12 fps=2.2 q=0.0 Lsize=       0kB time=00:00:00.48 bitrate=  
0.0kbits/s
video:1439kB audio:0kB global headers:0kB muxing overhead -100.000000%



-- 




More information about the ffmpeg-user mailing list