export h.264 from QGraphicsScene?
-
can i use
QMediaRecorder
andQMediaCaptureSession
to write an h.264 file from aQGraphicsScene
? or from aQVideoSink
? or from aQGraphicsItem
?like, i want to export an MP4 video (including audio) that i can currently play via a
QGraphicsScene
, and the scene does have a few layers: some graphics and text overlays.seems i can record live from a camera / window / screen, but can i record directly from a
QGraphicsScene
?or, how would i accomplish what i'm attempting, without using 3rd party libs?
-
Hi,
Since you are talking about QVideoSink, you are using Qt 6.
So QVideoSink would be an option AFAIK. Note that h264 might not be available for encoding without additional codec packages. In any case, if you want to recompress a video, you should rather use ffmpeg directly.
-
my only platforms are macOS and Windows, and i believe both media back ends support export to h.264. so, say i am going to try to do this without ffmpeg, how would i connect the video sink to the built-in QMediaCaptureSession ?
-
I think it should be doable with QMediaRecorder::serVideoSink.
-
doesn't
setVideoSink()
tell theQMediaRecorder
to send a copy of the video to a viewer? it's not setting the INPUT of the recorder, it's setting an output.How can i connect an audio stream input, and a
QGraphicsScene
video input, so the recorder creates a new mp4 file? -
You are correct, I misread the method documentation.
Currently, from the looks of it, you cannot do it directly.
Some sort of virtual camera would be needed as I don't see any generic "media object" class that can be used as input for QMediaRecorder.
-