title: Convert RAW images to BMP format
body: <p>I received a <code>.raw</code> frame format (<a href="https://www.dropbox.com/s/norfp745rwbvise/frame.raw?dl=0" rel="nofollow noreferrer">here is a sample</a>) which contains the raw pixel values of a frame. And I've been told I can convert it to an image (.bmp or .png) using <code>FFMpeg</code> using following command. However, when trying, it doesn't work.</p>
  <pre><code>dd bs=16 dumpB4EncodeHLSAfterEncodeBuf1200IP_TS/dumpedYuv/image-1140.raw |  ffmpeg -f rawvideo -video_size 2160 2160 -pixel_format nv12 -i - yuv.bmp
  </code></pre>
  <p>What is the problem? Is there any ways to avoid use of <code>dd</code> and purely do it from <code>FFmpeg</code>?</p>
  <p>Here is the error:</p>
  <pre><code>dd: unrecognized operand ‘frame.raw’
  Try 'dd --help' for more information.
  ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
    configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
    libavutil      55. 78.100 / 55. 78.100
    libavcodec     57.107.100 / 57.107.100
    libavformat    57. 83.100 / 57. 83.100
    libavdevice    57. 10.100 / 57. 10.100
    libavfilter     6.107.100 /  6.107.100
    libavresample   3.  7.  0 /  3.  7.  0
    libswscale      4.  8.100 /  4.  8.100
    libswresample   2.  9.100 /  2.  9.100
    libpostproc    54.  7.100 / 54.  7.100
  pipe:: Invalid data found when processing input
  </code></pre>
  <p>And if I use ffmpeg directly:</p>
  <pre><code>ffmpeg -video_size 2160x2160 -pixel_format nv12 -i frame.raw yuv.bmp
  </code></pre>
  <p>I will get this error:</p>
  <pre><code>ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
    configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
    libavutil      55. 78.100 / 55. 78.100
    libavcodec     57.107.100 / 57.107.100
    libavformat    57. 83.100 / 57. 83.100
    libavdevice    57. 10.100 / 57. 10.100
    libavfilter     6.107.100 /  6.107.100
    libavresample   3.  7.  0 /  3.  7.  0
    libswscale      4.  8.100 /  4.  8.100
    libswresample   2.  9.100 /  2.  9.100
    libpostproc    54.  7.100 / 54.  7.100
  [image2 @ 0x5605e52bb4c0] Format image2 detected only with low score of 5, misdetection possible!
  Input #0, image2, from 'frame.raw':
    Duration: 00:00:00.04, start: 0.000000, bitrate: 1244160 kb/s
      Stream #0:0: Video: rawvideo (NV12 / 0x3231564E), nv12, 2160x2160, 25 tbr, 25 tbn, 25 tbc
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (rawvideo (native) -&gt; bmp (native))
  Press [q] to stop, [?] for help
  [rawvideo @ 0x5605e52bea00] Invalid buffer size, packet size 6220800 &lt; expected frame_size 6998400
  Error while decoding stream #0:0: Invalid argument
  Finishing stream 0:0 without any data written to it.
  Output #0, image2, to 'yuv.bmp':
    Metadata:
      encoder         : Lavf57.83.100
      Stream #0:0: Video: bmp, bgr24, 2160x2160, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
      Metadata:
        encoder         : Lavc57.107.100 bmp
  frame=    0 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed=   0x
  video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
  Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
  Conversion failed!
  </code></pre>