create an encrypted video file from a webcam
I would like to create a program that can capture video from a webcam. This captured video should then be packed into a compressed format like mpeg2 or mpeg4, and finally encrypted with aes256. I'm planning to also write an application that works in reverse, it takes the encrypted file, decrypts it, then plays the video.
I have an USB webcam, and I have run the camera example. This works, I can see the video feed just fine. I found however, I can't capture the video stream. In the source I see m_camera->isCaptureModeSupported(QCamera::CaptureVideo)) returns false. Forcing it true does not enable me to record video.
I have the following questions:
- Can QMediaRecorder capture the video feed from the viewfinder, or does it really need QCamera::CaptureVideo?
- How can I redirect the output of QMediaRecorder to be something else than a file, so I can encrypt it before it get written to disk? can QAbstractVideoBuffer be used to hold the video data while encrypting it?
- Am I headed in the right direction? Are there more elegant ways of doing this?
Windows 7 Enterprise, Service Pack 1, 64 bit
Core i7-3770 3.4GHz 8GB ram
Qt Creator 4.5.2
Based on Qt 5.10.1 (MSVC 2015, 32 bit)
From revision 8673aae986
Built on Mar 11 2018 04:21:24
Vimicro USB2.0 PC camera(Venus) (VID_0AC8&PID_3420)
I see ffmpeg can create an encrypted video file:
I'll test if I can integrate it into Qt and report back.