<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">Den 23.12.2021 17:01, skrev Andrew
Randrianasulu:<br>
</div>
<blockquote type="cite"
cite="mid:CA+rFky6wTkhVZ=Ksa=2F9XB4dwumTBWmHaXwGd-ygNZdLNbe9Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br>
<br>
On Thursday, December 23, 2021, Terje J. Hanssen via Cin <<a
href="mailto:cin@lists.cinelerra-gg.org" moz-do-not-send="true"
class="moz-txt-link-freetext">cin@lists.cinelerra-gg.org</a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Background:<br>
<br>
Digital video produces vast amounts of data. Take PAL-SD
material (only image, no audio), stored as YUV422 with 8-bits
per component (=16-bits per pixel) and a resolution of 720x576
pixels, for example.<br>
<a
href="http://download.das-werkstatt.com/pb/mthk/info/video/comparison_video_codecs_containers.html#lossy_vs_lossless"
target="_blank" moz-do-not-send="true">http://download.das-werkstatt.<wbr>com/pb/mthk/info/video/compari<wbr>son_video_codecs_containers.<wbr>html#lossy_vs_lossless</a><br>
<br>
* Applying no compression at all (=uncompressed<br>
<<a
href="http://download.das-werkstatt.com/pb/mthk/info/video/comparison_video_codecs_containers.html#codec_uncompressed"
target="_blank" moz-do-not-send="true">http://download.das-werkstat<wbr>t.com/pb/mthk/info/video/<wbr>comparison_video_codecs_contai<wbr>ners.html#codec_uncompressed</a>>)<br>
results in:<br>
* 720 x 576 x 16 bits x 25 frames ≥ 1.159 GiB/Minute<br>
*<br>
<br>
* For YUV422, 10 bpc (10+5+5 = 20 bits per pixel), this would
be:<br>
* 720 x 576 x 20 bits x 25 frames ≥ 1.448 GiB/Minute<br>
<br>
<br>
So you would fit no more than 4 minutes of video on a whole 4.7
GiB DVD. Since these values are already uncomfortable (even for
422-subsampled PAL), imagine HD and beyond.<br>
Therefore, you will hardly find uncompressed video in the wild,
except for temporary editing use cases.<br>
<br>
-----------<br>
<br>
The examples below show the differences in storage space
required for uncompressed, lossless and lossy video codecs:<br>
<a
href="https://www.scart.be/?q=en/content/short-guide-choosing-digital-format-video-archiving-masters"
target="_blank" moz-do-not-send="true">https://www.scart.be/?q=en/con<wbr>tent/short-guide-choosing-digi<wbr>tal-format-video-archiving-<wbr>masters</a><br>
<br>
* uncompressed (e.g., v210) 10-bit -> approx. 100GB per hour
of video;<br>
* lossless compression (FFV1 and JPEG 2000) 10-bit ->
approx. 45-50 GB<br>
per hour of video;<br>
* lossy compression;<br>
* MPEG 2/DV50/IMX50 (50 Mbps) -> approx. 25 GB per hour of
video;<br>
* to compare with<br>
* DV (DV25) -> approx. 12 GB per hour of video;<br>
* MPEG 2 (DVD quality) -> approx. 3.6 GB per hour of video.<br>
<br>
-------------<br>
<br>
That is, if we manage to capture 422 uncompressed video via
either an internal capture card or via an external SSD recorder,
there is a need for<br>
<br>
* mathematical lossless compression with typical intraframe
FFV1/MKV<br>
for preservation (archive masters)<br>
* and/or possibly "visually lossless" compression to a lossy<br>
intraframe intermediate/mezzanine format<br>
<br>
<br>
I had no uncompressed test file available, but tried this guide
to generate a simple video (only) file:<br>
Compressing and uncompressing a preservation master video file<br>
<a
href="https://bits.ashleyblewer.com/blog/2018/11/08/compressing-and-uncompressing-a-preservation-master-video-file/"
target="_blank" moz-do-not-send="true">https://bits.ashleyblewer.com/<wbr>blog/2018/11/08/compressing-an<wbr>d-uncompressing-a-preservation<wbr>-master-video-file/</a><br>
<br>
ffmpeg -f lavfi -i mandelbrot=size=640x480:rate=2<wbr>5 -c:v
v210 -t 5 uncompressed.mov<br>
<br>
and next to turn it to a FFV1/MKV lossless compressed file<br>
<br>
ffmpeg -i uncompressed.mov -map 0 -dn -c:v ffv1 -level 3 -g 1
-slicecrc 1 -slices 16 -c:a copy ffv1.mkv<br>
<br>
and if required a test to uncompress the FFV1/MKV file to
uncompressed 10bit file again:<br>
<br>
ffmpeg -i ffv1.mkv -c:v v210 uncompressed-again.mov<br>
<br>
du -s *<br>
105004 uncompressed.mov<br>
22844 ffv1.mkv<br>
105004 uncompressed-again.mov</blockquote>
<div><br>
</div>
<div>i think there is special filter (framecrc?) in ffmpeg for
checking exactness of those frames (no example off hand.. <a
href="http://underpop.online.fr/f/ffmpeg/help/framecrc.htm.gz"
moz-do-not-send="true" class="moz-txt-link-freetext">http://underpop.online.fr/f/ffmpeg/help/framecrc.htm.gz</a>
? ) </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In this simple case the lossless compressed ffv1.mkv size is
schrinked to 22% of the uncompressed.mov file.<br>
In other practical tests I read the FFV1 file size was schrinked
to 1/3 to 46% of the uncompressed video.<br>
<br>
(I tested for fun to transcode a "visual lossless" compressed
ProResHQ.mov file to FFV1/MKV, but that extented the file size
to 180% )<br>
<br>
I loaded the simple generated ffv1.mkv in Cinelerra, but also
read about a problem in a previous thread<br>
[Cin] Single-frame step fwd/bak in viewer delayed?<br>
<a
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg01799.html"
target="_blank" moz-do-not-send="true">https://www.mail-archive.com/c<wbr>in@lists.cinelerra-gg.org/msg0<wbr>1799.html</a><br>
<br>
Is this problem solved?<br>
And will the lossless compressed (preservation) format FFV1.MKV
work as a editing format, or will there be a need beside to have
another intermediate format MPEG 2/DV50/IMX50 (50 Mbps) for
editing?</blockquote>
<div><br>
</div>
<div>I think Andrea run into slowness/desyncro with some mkvs
(unsolved) </div>
<div><br>
</div>
<div>ffv1 can be quite cpu intensive, so fludity during edition
depends on host cpu. Also, apparently there is two-level of crc
codes both in ffv1 and mkv container. May be one can disable one
level of checking for faster de/compression (I will look into
it) </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
</blockquote>
</blockquote>
<br>
<font face="monospace">Better multithreading (than ffv1 -slices at
the expense of file size) would help. There is a current
suggestion for ffv1 v.4: "Appendix A. Multithreaded Decoder
Implementation Suggestions"<br>
<a class="moz-txt-link-freetext" href="https://datatracker.ietf.org/doc/html/draft-ietf-cellar-ffv1-v4#appendix-A">https://datatracker.ietf.org/doc/html/draft-ietf-cellar-ffv1-v4#appendix-A</a><br>
<br>
Else, interesting to read an equivalent article "Open Source FFV1
video capture workflow for MacOS"<br>
<a class="moz-txt-link-freetext" href="https://digitensions.home.blog/2019/03/18/moving-video-tape-capture-to-an-open-source-workflow/">https://digitensions.home.blog/2019/03/18/moving-video-tape-capture-to-an-open-source-workflow/</a><br>
<br>
<br>
<br>
</font>
</body>
</html>