Hi Nvidia,
I want to use ResizeNv12 in place of ScaleYUV420 API for resizing planar or interleaved yuv .
In AppEncLowLatency.cpp example code.
The ScaleYUV420 is giving jerk moment in final output .{ Video_Codec_SDK_8.2.16}
Issue with ScaleYUV420 :-
In high motion video the output video is jerky {.h264/.hevc}
SO want to try ResizeNv12 API instead ScaleYUV420 API in AppEncLowLatency.cpp example.
I have attached the input file with ffmpeg cmd to extract .yuv and feed to nvidia video sdk encoder.
- Encoded Input file
https://drive.google.com/open?id=1vtraIOWlF01Q5p7_tgbAPgNXi71jc9ZN - cmd to extract yuv
ffmpeg.exe -y -i U4K_jurassic_world_fallen_kingdom_23M_hevc.ts -c:v rawvideo -pix_fmt yuv420p U4K_jurassic_world_fallen_kingdom_23M_hevc.yuv
Issue 2
How to integrate ResizeNv12 in AppEncLowLatency.cpp example code.
I have added the function as below.
Kindly guide me to how to call the ResizeNv12 with CopyToDeviceFrame API?
NvEncoderCuda::CopyToDeviceFrame(cuContext,
pHostFrame.get(),
0,
dpInputYPlane,
(uint32_t)inputYPlanePitch,
initializeParams.encodeWidth,
initializeParams.encodeHeight,
CU_MEMORYTYPE_HOST,
eFormat,
&chromaDevicePtrs[0],
(uint32_t)inputChromaPlanePitch,
(uint32_t)chromaDevicePtrs.size());
/* ScaleYUV420((unsigned char *)encoderInputFrame->inputPtr,
(unsigned char *)encoderInputFrame->inputPtr + encoderInputFrame->chromaOffsets[0],
(eFormat == NV_ENC_BUFFER_FORMAT_NV12) ? nullptr : (unsigned char *)encoderInputFrame->inputPtr + encoderInputFrame->chromaOffsets[1],
(int)encoderInputFrame->pitch,
(int)encoderInputFrame->chromaPitch,
enc.GetEncodeWidth(),
enc.GetEncodeHeight(),
(uint8_t*)dpInputYPlane,
(unsigned char *)chromaDevicePtrs[0],
(eFormat == NV_ENC_BUFFER_FORMAT_NV12) ? nullptr : (unsigned char *)chromaDevicePtrs[1],
(int)inputYPlanePitch,
(int)inputChromaPlanePitch,
initializeParams.encodeWidth,
initializeParams.encodeHeight,
(eFormat == NV_ENC_BUFFER_FORMAT_NV12) ? true : false);*/
//void ResizeNv12(unsigned char *dpDstNv12, int nDstPitch, int nDstWidth, int nDstHeight,
//unsigned char *dpSrcNv12, int nSrcPitch, int nSrcWidth, int nSrcHeight, unsigned char* dpDstNv12UV)
ResizeNv12((unsigned char *)encoderInputFrame->inputPtr,
(int)encoderInputFrame->chromaPitch,
enc.GetEncodeWidth(),
enc.GetEncodeHeight(),
(uint8_t*)dpInputYPlane,
(int)inputYPlanePitch,
initializeParams.encodeWidth,
initializeParams.encodeHeight
);