1

I have raw NV12 YUV progressive Data and required to split each frame into images with even and odd fields (interlaced data).

Rajesh
  • 11
  • 2

1 Answers1

0

If you want to do all the jobs manally:

  1. Extract each frame from .yuv file

    Depending on the format and resolution of your stream, caculate the size of one frame. Then, you can do the extration.

  2. Split .yuv frame into .yuv field

    Caculate the size of each line, and split the frame by odd/even line. Please take care of the uv line if the format is yuv420.

  3. Covert .yuv field to .bmp image

    If the format is not yuv444, then convert it to yuv444 first. Then, do the yuv to rgb convertion, and store the image into .bmp format.

With the help of ffmpeg and ImageMagick, it can also be done (more easier) by two steps (supposing that the resolution of frame is 1920x1080 and field is 1920x540) :

  1. Convert YUV to Images

    ffmpeg -s 1920x1080 -i input.yuv frame_%3d.bmp

    -pix_fmt can be used to specify the format(pixel layout) of .yuv file.

  2. Split Images to Odd/Even

    convert frame_000.bmp -define sample:offset=25 -sample 100%x50% frame_000_top.bmp

    convert frame_000.bmp -define sample:offset=75 -sample 100%x50% frame_000_bot.bmp

    These two commands can be found in the last part of de-interlace a video frame.

Sam
  • 5,375
  • 2
  • 45
  • 54
TerrenceSun
  • 433
  • 3
  • 15