MediaArea / RAWcooked

Encodes RAW audio-visual data into the Matroska container (MKV), using the video codec FFV1 for the image and audio codec FLAC for the sound.
https://mediaarea.net/RAWcooked
BSD 2-Clause "Simplified" License
41 stars 11 forks source link

Single video stream when there is a discountinuity in the sequence #156

Open JeromeMartinez opened 5 years ago

JeromeMartinez commented 5 years ago

From: https://github.com/MediaArea/RAWcooked/pull/154#issuecomment-423816668

Would be better to have a single video stream for that kind of directory. Being careful about time stamping when muxing.

retokromer commented 5 years ago

FYI: When one stream is needed, we do mux with minimal (when possible 1x1 pixel) black images for the «missing» frames.

JeromeMartinez commented 5 years ago

(when possible 1x1 pixel)

pixel size is fixed for the whole stream in FFV1 version 3.

black images for the «missing» frames.

I am more in favor to just provide the right timestamp for the existing frame, so we don't create fake data (I don't like the idea of cheating here) and the decoder is in charge of deciding what to do. e.g. we set Matroska default frame duration to 40 ms and we have frame 0, 40, 80, 160, 200... The decoer decides what do between 120 and 160 (the Matroska spec hints "no data available here", so the decoder policy decides to show black frame or green frame or previous frame, optionally with a user option)

retokromer commented 5 years ago

This was just meant as quick and dirty hack for handling the case now. Me too, I support a correct implementation!

pixel size is fixed for the whole stream in FFV1 version 3.

To change in version 4! (A full black frame can be compressed well.)

JeromeMartinez commented 5 years ago

This was just meant as quick and dirty hack for handling the case now.

Not possible, lot of users have the DPX folder in read only mode, so I can not write a fake DPX file (the missing one) in the directory, so I need in all cases to use the intermediate text file and handle that well with FFmpeg command line. And when this part is made, adding the timestamp is not the difficult part. Would be more complicated (and dangerous) to try to write in input directory and handle read only related issues than moving to the right solution.

pixel size is fixed for the whole stream in FFV1 version 3.

To change in version 4! (A full black frame can be compressed well.)

I don't want to comment design choices from v3, but "black frame compression" is not an argument, with range coder a 1x1 black frame or 10000x10000 black frame has same byte size in FFV1 (the predictor would work very well and a difference of 0 does not change the state of the range coder so no need on more bytes for storing it :) ).

retokromer commented 5 years ago

a difference of 0 does not change the state of the range coder so no need on more bytes for storing it

It’s exactly what I meant.

stephenmcconnachie commented 4 years ago

@retokromer we came across a real world case where a supplier has meaningfully given us dpx in a single folder with discontinuous sequence, and that's characteristic of the mass digitisation project that we are about to tackle using RAWcooked. there will be hundreds if not thousands of cases.

So in discussion with @JeromeMartinez he agreed that gives this one some priority.

retokromer commented 4 years ago

@stephenmcconnachie Indeed this is not uncommon! Another scenario are outtakes in reels which were digitised with leader, but delivered without the leader frames in folders.