New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VideoWriter class does not support stream copy #14573
Comments
is not the same as
VideoCapture and VideoWriter do not provide interface to access raw compressed video stream, except maybe MJPEG in some cases. Make sure you actually use FFmpeg backend by setting apiPreference parameter: |
My apologies, I mistakenly mixed two issues in my comment. The second is a valid issue though; there is no support for the copy codec of ffmpeg in the VideoWriter class even using the ffmpeg backend. |
I have also had this issue. The solution proposed in the VideoWriter documentation (codec=0; fps=0;) does not produce a file containing raw (uncompressed/unencoded) data as expected, and in fact, it produces no file at all. I can get the result I'm after (raw H.265 data as an MP4 file) using
If possible I'd like to be able to do the same thing using OpenCV, although I assume that OpenCV will essentially just be providing a wrapper interface for calling an
|
I think that media stream repackaging is out of scope of OpenCV and direct usage of FFmpeg and GStreamer is the right way to do it. If you have evidence of issue with documentation and/or videoio module, please add more information here: platform, build configuration, minimal reproducer app. |
The following application produces no output file yet should according to documentation as indicated above.
|
System information (version)
-->
Detailed description
The VideoWriter object does not have working stream copy functionality. Using a command line call to ffmpeg, for instance, one can read a video stream as input (akin to the VideoCapture object) and directly copy this stream into an output file without any decoding or re-encoding, which saves a lot of computation time. In OpenCV, if no codec is specified for the VideoWriter object, no file is output. Documentation suggests that entering a value of 0 into the fourcc codec code and a framerate of 0 when constructing the VideoWriter object should accomplish this but does not.
https://docs.opencv.org/3.4/dd/d9e/classcv_1_1VideoWriter.html
"If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file."
The following code produces no output file.
```.py
-->
The text was updated successfully, but these errors were encountered: