sooyekim/Deep-SR-ITM

How to extract the frames with 10-bit data from the HDR videos?

CS-GangXu opened this issue · 4 comments

Thanks for your great work!
I want to ask the solution of extracting frames and turning them into the data files with values (uint 0-1023). I first use ffmpeg -i in.mp4 out.yuv to convert the mp4 file into yuv file.
What should I do to split the out.yuv into data files of every frame?

Hi @CS-GangXu ,
Thanks for the enthusiastic comment!
After obtaining the yuv file, you could use utils/load_yuv.m function that I provided to load the individual frames.
LMK if you have any more questions!

Thank you for your prompt reply!!! @sooyekim
I still have two questions about the command: function YUV = load_yuv(file, frame, height, width, h_factor, w_factor, SDR_HDR).

  1. Does the frame mean A) the frame rate, B) the number of total frames, C) the frame number that I want to extract from the video, D) the index of the single frame?
  2. Are the h_factor and w_factor both 0.5 when the video has the format of YUV420?

Sorry for the late reply @CS-GangXu .

  1. The argument 'frame' is C) frame number. The load_yuv() function loads the frame-th frame from the input file. To read the entire video, you can increase this value with a for-loop.
  2. Yes, they're both 0.5 for YUV420. The function utils/yuv_factor.m returns the values for h_factor and w_factor from a yuv format (forgot to mention this function, sorry!)

LMK if you have any other questions :)

Thanks for your reply! This code is really useful! @sooyekim .