I’m working with OpenCV 4.5 on Jetson Nano 2GB [ CUDA 10 ] - Debian system.
I need to record video from my webcam and save it to .mov or .mp4, the problem is that I do not know which encoding to use, while I tried a variety of fourcc-s ( like “mp4v”, “h264”, “avc1”) all of them generate a drop of fps (from 25 to 8 ) with resolution 1280x720. If I resize to a smaller size, it’s work’s better but I can’t go any lower .
So I thought about two solutions:
- Saving raw frames and encoding them only when a user would like to download recordings.
- Use some faster encoding
But I have no idea how to do that, I could only try different combinations for the whole day and I found nearly nothing!
I by chance saved once in MPEG-4 video format and 7400 kbps, and while I could not play that file with any program (Internal stream error) - I could read it by OpenCV again and then save it correctly (seems like my first idea), but I don’t know how I have done that. Now when I try to do the same I’m only getting MPEG-4 (Simple Profile) which is not working . I have done that on lower resolution (640x480) so I’m not even sure if that’s really would solve my problem.
I’m working on Jetson nano and theoretically have access to GPU, but I could not find a working way to do this with it.
I had issues with video reading speed so I’m not using VideoCapture but NvAPI and I get cv::Mat from it. [Check Here]
That’s my first post here - sorry if I have made any mistakes.