Hi, I managed to encode some custom images into a video file using NvVideoEncoder::createVideoEncoder and the related options which we set in context_t structure. There is no camera so I can choose any frameRate I want (I read the images from hard disk, then encode them).
The video is made properly and I can play it with some pot player, even I can open it with OpenCV.
However many of the metadata of the video is not available including the total number of frames. This problem doesn’t allow me to have random access to the middle frames of the video and every time I need to open the whole video to extract the middle frames.
Therefore I am looking for a hint that shows me how to enrich the metadata of the video and prepare the video in a way that I can have random access to all the frames.
P.S. I don’t define the number of frames before encoding. I pass the loop of enqueueing and then finish the enqueue whenever my frames are finished. And I save the video as mp4.
Hi,
The sample demonstrates encoding to H264/H265 stream. For further controls in playback, you would need to implement muxer to mux the stream into mp4 or mkv.
A quick solution is to run gstreamer command and use qtmux or matroskamux plugin.
Thank you for the response.
Does v4l2 have the modules for muxer too?
I already used gstreamer for encoding and it works pretty well, but it seemed the v4l2 itself has a higher speed (true?).
Is there any other option other than gst for the mux implementation?