I am using PyNvVideoCodec “SimpleDecoder”. Following function provides me with tensor with unit8 values.
advanced_decoder = SimpleDecoder(
enc_file_path="input_video.mp4", # Input filename
gpu_id=0, # Index of GPU, useful for multi-GPU setups
use_device_memory=True, # Decoded frames reside in device memory
max_width=1920, # Maximum width of buffer for decoder reuse
max_height=1080, # Maximum height of buffer for decoder reuse
need_scanned_stream_metadata=True, # Retrieve stream-level metadata
decoder_cache_size=8, # Maximum number of unique decoder sessions cached
output_color_type=nvc.OutputColorType.RGBP # Decoded frames available as RGB or YUV
)
However I want to normalize it to 0-1fp32. I don not want to use additional library like PyTorch to perform normalization. Anyway to do it within the PyNvCodec frameworks or Do I need to write a CUDA kernel to do so.