Hi Sander,
First to your questions:
>> 1.Is the output we got without the fixes by design? With the output interlaceType set to progressive, we expected something like one correct (deinterlaced?) output frame for each two flushes instead of the one good frame for each IDR followed by grey difference images for each non-IDR.
I believe this is a bug. No grey frame should get out of the transcoder (or any internal decoder) under any circumstances and regardless of the methods you are calling.
>> 2.Our old decoder didn't have any deinterlacing options, so we implemented our own approaches. Does AVBlocks have any deinterlacing options? When using option 1, it does seems to deinterlace. This is not a priority for us, just wondering if we are not missing some option somewhere.
There is internal automatic deinterlacing. It comes into effect when the input is interlaced (top or bottom field first) and the output is progressive.
Now in AVBlocks 1.7.0 (to be released soon) we are adding options to specify the deinterlacing method.
We also plan to add an option for manual deinterlacing - on|off. This would be useful when the input video has a wrong scan type: interlaced instead of progressive and vice versa.
* Now about the grey frame bug
We'd like to explore and fix this case. You can help us a lot by providing the input stream and the code snippet that uses the transcoder.
In the past Bernard has sent a sample stream in the following format: a file containing the input video stream and another binary file describing the chunks (frames) that are received (or pushed to the transcoder).
Let's say that the input file is called "sample_video".
Then the other file "samples_video.frames" would contain the sizes (or offsets) of the frames that you receive.
Any format for frames/chunks description would work for us as long as you specify it.
* About transcoder flushing.
I don't understand why you need to flush the transcoder every (other) frame.
Transcoder::flush should be called when there's no more input data.
I think it's not guaranteed that Transcoder::push() and Transcoder::flush() calls can be alternated safely.
This is so because after Transcoder::flush() is called some internal encoders/decoders may do specific things for end-of-stream processing
and if more data is provided afterwards strange things may happen.
There's little buffering inside Transcoder.
If you push input data and nothing comes out of the output stream then almost certainly more input is needed for some reason (perhaps frames reordering for B-frames)
It would be helpful if you give more details about the need for flushing transcoder before end-of-stream.
Thanks,
Svilen