1 Reply Latest reply on Apr 16, 2018 9:09 AM by Intel Corporation

    Get images from the OV7251 camera (bottom facing)

    sargyrop

      Following the guide in 06 Cameras and Video · intel-aero/meta-intel-aero Wiki · GitHub  to access the OV7251 camera (bottom facing), I get the attached yuv420 Image.

      However, the last command to convert the yuv420 raw image to jpeg using ffmpeg

      ffmpeg -f rawvideo -s 640x480 -pix_fmt yuv420p -i Image-video<*> test.jpg

      does not provide a correct output image (see attachment for output).

       

      The ffmpeg output is

      ffmpeg -f rawvideo -s 640x480 -pix_fmt yuv420p  -i Image-video2-640x480-0.yuv420 out-img.jpg

      ffmpeg version N-83781-g3016e91 Copyright (c) 2000-2017 the FFmpeg developers

        built with gcc 6.3.0 (GCC)

        configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --

      enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li

      bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl

      e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam

      e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable

      -libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib

        libavutil      55. 48.100 / 55. 48.100

        libavcodec     57. 82.102 / 57. 82.102

        libavformat    57. 66.103 / 57. 66.103

        libavdevice    57.  3.100 / 57.  3.100

        libavfilter     6. 74.100 /  6. 74.100

        libswscale      4.  3.101 /  4.  3.101

        libswresample   2.  4.100 /  2.  4.100

        libpostproc    54.  2.100 / 54.  2.100

      [rawvideo @ 000000000036a1a0] Estimating duration from bitrate, this may be inaccurate

      Input #0, rawvideo, from 'Image-video2-640x480-0.yuv420':

        Duration: 00:00:00.04, start: 0.000000, bitrate: 92569 kb/s

          Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 92160 kb/s, 25 tbr, 25 tbn, 25 tbc

      Stream mapping:

        Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))

      Press [q] to stop, [?] for help

      [swscaler @ 00000000003fe560] deprecated pixel format used, make sure you did set range correctly

      Output #0, image2, to 'out-img.jpg':

        Metadata:

          encoder         : Lavf57.66.103

          Stream #0:0: Video: mjpeg, yuvj420p(pc), 640x480, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc

          Metadata:

            encoder         : Lavc57.82.102 mjpeg

          Side data:

            cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1

      [rawvideo @ 00000000003e44a0] Invalid buffer size, packet size 2048 < expected frame_size 460800

      Error while decoding stream #0:0: Invalid argument

      frame=    1 fps=0.0 q=6.9 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.366x

      video:51kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

       

       

      I believe the problem in the conversion is that the output image does not contain only the raw pixel values (otherwise it would be 640*480*1.5=460800 bytes, while it is 462848, hence the offset of 2048 that ffmpeg is complaining about).

       

      Has anyone succeeded in converting images from the bottom facing camera?

       

       

      Here is the output of my aero version:

      aero@aero-CherryTrail:~$ sudo aero-get-version.py

      BIOS_VERSION = Aero-01.00.13

      OS_VERSION = Ubuntu 16.04.4 LTS"

      AIRMAP_VERSION = unknown

      FPGA_VERSION = 0xc2

      AeroFC firmware version = 3.6.0