It’s not long that I came to OpenCV so my experience
is quite limited.
Recently I had the task of analysing/ manipulation
video material where OpenCV’s algs do fit very well.
But first of all I checked if there are no problems
reading in a video and writing it out losslessly right away.
I wasn’t successful with it, no matter what I tried:
I read a video (YUV4.2.1) from file by VideoCapture,
get the frames into Mat structure
and write them back by a VideoWriter.
But the existing lossless codecs (FFV1 and HFYU) produce
all a bit darker than the original (as they are converted to RGBA?).
So my question:
How do I get out video material lossless?
(Somewhere I read to use ffmpeg directly…
Does this mean I should write a VideoCapture on my own?)
Actually I cannot understand how this could be a problem
as I’m at v.3.4.10, and not 0.4beta…
Addendum:
Can anybody please confirm or disconfirm that?
BTW Not only that the specifications of FFV1 and HFYU do not allow RGB(A).
Also VideoWriter’s AVC1 output is bad and wrong.
Will this do in v.4.8?
There is no way to adjust bitrate level. Just the quality level. And setting this has NO effect at all. The default value (which?) produces bad and wrong result filtes. Did you checked it by yourself? I did.
As I wrote opencv only offers only FFV1 and HFYU for lossless encoding. And VideoWrite always writes them as RGB(A) (as mentioned which doesn’t exist by specification).
What do you mean by “use ffmepeg’s libraries directly”? Write my own VideoWriter?
Again: Does v.4.8. works correctly (not in theory but in practise)?