<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">Den 02.02.2023 01:46, skrev Terje J.
Hanssen:<br>
</div>
<blockquote type="cite"
cite="mid:cae6bcf9-3f1a-f978-dfcc-504bf3bc21c5@gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<font face="Courier New, Courier, monospace"> I have no plan to
compete with our </font><font face="Courier New, Courier,
monospace"><span><span><span><font style="vertical-align:
inherit;"><font style="vertical-align: inherit;"
class="">National Library </font></font></span></span></span>located
locally here :)<br>
<a class="moz-txt-link-freetext"
href="https://www-nrk-no.translate.goog/nordland/her-skal-den-norske-kulturarven-bevares-i-evig-tid-1.16277933?_x_tr_sl=no&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc"
moz-do-not-send="true">https://www-nrk-no.translate.goog/nordland/her-skal-den-norske-kulturarven-bevares-i-evig-tid-1.16277933?_x_tr_sl=no&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc</a><br>
<br>
but I prepare myself to test and use one method left with
regards to "Personal Video Archiving".<br>
<br>
Therefore I have ordered two selected, inexpensive devices (the
urls here are just for English language):<br>
<br>
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB
3.2/3.1/3.0, </font><font face="Courier New, Courier,
monospace"><font face="Courier New, Courier, monospace">60 Hz
and 1080p FHD.</font>)<br>
<a class="moz-txt-link-freetext"
href="https://www.turascandinavia.com/en/products/computer/microphone-webcam/webcams/74257"
moz-do-not-send="true">https://www.turascandinavia.com/en/products/computer/microphone-webcam/webcams/74257</a><br>
</font>
<ul>
<li><font face="Courier New, Courier, monospace">Fluid video
recordings without delays or distortions during live
streaming</font></li>
<li><font face="Courier New, Courier, monospace">Linux not
mentioned, but assumed this is a standard supported UVC. OBS
and VLC is mentioned.</font></li>
</ul>
<font face="Courier New, Courier, monospace"><br>
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA
DVD HD TV adapter (3-4 weeks delivery time <br>
<a class="moz-txt-link-freetext"
href="https://www.ebay.com.au/itm/295472602625"
moz-do-not-send="true">https://www.ebay.com.au/itm/295472602625</a><br>
</font>
<ul>
<li><font face="Courier New, Courier, monospace">The 3-in-1
S-/video/RCA/SCART to HDMI converter is a universal
converter for analog video input to HDMI output. </font></li>
<li><font face="Courier New, Courier, monospace">Analog to
digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
</font></li>
</ul>
<font face="Courier New, Courier, monospace"><br>
<br>
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide
for SD and HDV capturing and hope for suggestions and comments
here!?<br>
<br>
3.1 FFmpeg recipe (PAL)<br>
</font>
<blockquote><font face="Courier New, Courier, monospace">ffmpeg -i
VIDEO_IN \</font><br>
<blockquote><font face="Courier New, Courier, monospace">-c:v
ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \</font><br>
<font face="Courier New, Courier, monospace">-color_primaries
bt470bg \</font><br>
<font face="Courier New, Courier, monospace">-color_trc bt709
\</font><br>
<font face="Courier New, Courier, monospace">-colorspace
bt470bg \</font><br>
<font face="Courier New, Courier, monospace">-color_range mpeg
\</font><br>
<font face="Courier New, Courier, monospace">-map 0 \</font><br>
<font face="Courier New, Courier, monospace">-top 1 \</font><br>
<font face="Courier New, Courier, monospace">-c:a copy \</font><br>
<font face="Courier New, Courier, monospace">-g 1 -pix_fmt + \</font><br>
<font face="Courier New, Courier, monospace">VIDEO_OUT.mkv</font><br>
</blockquote>
</blockquote>
<font face="Courier New, Courier, monospace"><br>
3.2 Reference Example<br>
<a class="moz-txt-link-freetext"
href="https://trac.ffmpeg.org/wiki/Encode/FFV1"
moz-do-not-send="true">https://trac.ffmpeg.org/wiki/Encode/FFV1</a><br>
<br>
Copy audio "as-is" and use FFV1.3 as video codec. <br>
<br>
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24
slices and slice-CRC on:<br>
<br>
ffmpeg -i <input_video> \<br>
-acodec copy \<br>
-vcodec ffv1 -level 3 \<br>
-threads 8 \<br>
-coder 1 \<br>
-context 1 \<br>
-g 1 \<br>
-slices 24 \<br>
-slicecrc 1 \<br>
<output_video><br>
<br>
<br>
</font></blockquote>
<br>
<br>
<font size="4"><font face="monospace">While awaiting the HDMI-USB3
capture dongle next week, I have tested to transcode a couple of
video files to FFV1/MKV. In lack of available uncompressed
10-bit 422 video files (like v210), I have used two previous
encoded 10-bit ProRes-422HQ (denoted visually or near lossless
compression) as input files, to see what happens.<br>
<br>
Input files:<br>
------------<br>
du -sh *.mov<br>
</font></font>
<blockquote><font size="4"><font face="monospace">40G
Hi8_tape_1_1992+1993.mov # converted to SD from PAL
analog Hi8/S-Video, Sony CCD-TR2000E</font></font><br>
<font size="4"><font face="monospace">1,7G hd01.mov
# a short FHD clip from Sony FX7E camcorder
directly via EIP & HDMI<br>
# The Imaging
Processor works at 1920x1080 in a 4:2:2 colorspace.
</font></font><br>
</blockquote>
<font size="4"><font face="monospace"><br>
ffmpeg -i Hi8_tape_1_1992+1993.mov 2>&1 >/dev/null |
egrep "Video|Audio|Duration"<br>
Duration: 01:11:25.28, start: 0.000000, bitrate: 79566 kb/s<br>
Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061),
yuv422p10le(tv, bt709/unknown/unknown, top coded first
(swapped)), 720x576, 61100 kb/s, SAR 59:54 DAR 295:216, 25 fps,
25 tbr, 2500 tbn, 2500 tbc (default)<br>
handler_name : Apple Video Media Handler<br>
Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000
Hz, hexadecagonal, s32 (24 bit), 18432 kb/s (default)<br>
<br>
<br>
ffmpeg -i hd01.mov 2>&1 >/dev/null | egrep
"Video|Audio|Duration"<br>
Duration: 00:01:11.24, start: 0.000000, bitrate: 200607 kb/s<br>
Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061),
yuv422p10le(tv, bt709/unknown/unknown, top coded first
(swapped)), 1920x1080, 182130 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25
tbr, 2500 tbn, 2500 tbc (default)<br>
handler_name : Apple Video Media Handler<br>
Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000
Hz, hexadecagonal, s32 (24 bit), 18432 kb/s (default)<br>
<br>
<br>
Transcoding to FFV1/MKV:<br>
------------------------<br>
<br>
ffmpeg -i Hi8_tape_1_1992+1993.mov -acodec copy -vcodec ffv1
-level 3 -threads 8 -coder 1 -context 1 -g 1 -slices 24
-slicecrc 1 Hi8_tape_1_1992+1993_ffv1.mkv<br>
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers<br>
built with gcc 7 (SUSE Linux)<br>
...................<br>
[prores @ 0x5613af6cef40] error, wrong slice data size26.64
bitrate=131749.8kbits/s speed=3.88x <br>
[prores @ 0x5613af6cef40] error decoding picture header<br>
Error while decoding stream #0:0: Invalid data found when
processing input<br>
frame=107131 fps= 95 q=-0.0 Lsize=70256226kB time=01:11:25.27
bitrate=134306.1kbits/s speed=3.82x <br>
video:60607655kB audio:9641880kB subtitle:0kB other streams:0kB
global headers:0kB muxing overhead: 0.009525%<br>
<br>
</font></font>
<blockquote><font size="4"><font face="monospace"># 18.5 minutes on
a fast internal SSD nvme0n1 Samsung model: MZVPV512HDG</font></font><br>
<font size="4"><font face="monospace"># (26 minutes on a USB3
Expansion HDD Seagate, %CPU (top): 610-280, FFMpeg speed:
3.92x-2.68x)</font></font><br>
</blockquote>
<font size="4"><font face="monospace"><br>
<br>
ffmpeg -i hd01.mov -acodec copy -vcodec ffv1 -level 3 -threads 8
-coder 1 -context 1 -g 1 -slices 24 -slicecrc 1 hd01_ffv1.mkv<br>
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers<br>
built with gcc 7 (SUSE Linux)<br>
..............<br>
frame= 1781 fps= 23 q=-0.0 Lsize= 4495998kB time=00:01:11.27
bitrate=516733.5kbits/s speed=0.929x <br>
video:4335507kB audio:160380kB subtitle:0kB other streams:0kB
global headers:0kB muxing overhead: 0.002472%<br>
<br>
# ca. 2 minutes on a fast internal SSD nvme0n1 Samsung
model: MZVPV512HDG<br>
<br>
<br>
Output files:<br>
-------------<br>
<br>
</font><font face="monospace">du -sh *.mkv<br>
</font></font>
<blockquote><font size="4"><font face="monospace">4,3G
hd01_ffv1.mkv</font></font><br>
<font size="4"><font face="monospace">68G
Hi8_tape_1_1992+1993_ffv1.mkv</font></font><br>
</blockquote>
<font size="4" face="monospace"><br>
ffmpeg -i Hi8_tape_1_1992+1993_ffv1.mkv 2>&1 >/dev/null
| egrep "Video|Audio|Duration"<br>
Duration: 01:11:25.28, start: 0.000000, bitrate: 134306 kb/s<br>
Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646),
yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)),
720x576, SAR 59:54 DAR 295:216, 25 fps, 25 tbr, 1k tbn, 1k tbc
(default)<br>
HANDLER_NAME : Apple Video Media Handler<br>
Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, hexadecagonal, s32
(24 bit), 18432 kb/s (default)<br>
<br>
<br>
ffmpeg -i hd01_ffv1.mkv 2>&1 >/dev/null | egrep
"Video|Audio|Duration"<br>
Duration: 00:01:11.28, start: 0.000000, bitrate: 516719 kb/s<br>
Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646),
yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)),
1920x1080, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc
(default)<br>
HANDLER_NAME : Apple Video Media Handler<br>
Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, hexadecagonal, s32
(24 bit), 18432 kb/s (default)<br>
<br>
<br>
Summary and comments:<br>
---------------------<br>
As seen above the SD (Hi8) output FFV1.MKV file has grown with 78/
40 = 1.7 compared with the input ProRes.mov file,<br>
while the HD output file has grown with 4.3/ 1.7 = 2.5 compared
with the input ProRes.mov clip.<br>
<br>
Possibly not as expected, but decoding the compressed ProRes first
might not be optimum. At least I hope that encoding both from a
common, lossless codec like v210 or more actual from an input
video stream, would have shown another, closer picture?<br>
<br>
<br>
</font><br>
<blockquote type="cite"
cite="mid:cae6bcf9-3f1a-f978-dfcc-504bf3bc21c5@gmail.com"><font
face="Courier New, Courier, monospace"> 3.3 Various Encoding
examples for Video capture from USB camera /dev/video0:<br>
<br>
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0
output_data.mkv<br>
<br>
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0
-codec:v ffv1 -codec:a pcm_s16le \<br>
-f matroska output_video.mkv<br>
<br>
Check that video is captured properly using ffplay:<br>
<br>
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \<br>
-r 25 -thread_queue_size 1024 -i $VIDEO \<br>
-codec copy -f matroska - | ffplay -<br>
</font><font face="Courier"><span class="text-node"><br>
</span></font><font face="Courier New, Courier, monospace"><span
class="text-node">Check the overall flow using ffplay before
capturing:</span> </font>
<div class="language-plaintext highlighter-rouge"
data-pf_style_display="block" data-pf_style_visibility="visible">
<div class="highlight" data-pf_style_display="block"
data-pf_style_visibility="visible"> <br>
</div>
</div>
<font face="Courier New, Courier, monospace">ffmpeg -ar 44100
-thread_queue_size 1024 -f alsa -i $AUDIO \<br>
-itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \<br>
-filter_complex 'channelmap=FL-0' -filter_complex
'crop=w=700:h=556:x=8:y=0' \<br>
-map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \<br>
-f matroska - | ffplay -<br>
<br>
<br>
<br>
4, Regarding FFV1 lossless compression in realtime<br>
</font><font face="Courier New, Courier, monospace"><font
face="Courier New, Courier, monospace">Comparison tests
(2013/2015) have shown that FFV1 produced the smallest files
at the fastest speed. It can be used to capture SD material in
realtime, and HD possibly, too. </font></font><font
face="Courier New, Courier, monospace"><font face="Courier New,
Courier, monospace"><font face="Courier New, Courier,
monospace">This according to a 2012/2015 article, where I
have extracted the results for FFV1 v.3 in the tables below:<br>
<br>
<a class="moz-txt-link-freetext"
href="http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_tests"
moz-do-not-send="true">http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_tests</a><br>
</font> </font></font> NOTE: This is a consumer grade,
off-the-shelf PC setup.<br>
<br>
<table>
<tbody>
<tr>
<th colspan="2">Hardware:</th>
</tr>
<tr>
<td>CPU:</td>
<td>Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz</td>
</tr>
<tr>
<td>RAM:</td>
<td>8 GB</td>
</tr>
<tr>
<td>Disk:</td>
<td>Intel SSDSA2CW080G3 (SSD)</td>
</tr>
<tr>
<th colspan="2">Software:</th>
</tr>
<tr>
<td>Operating System:</td>
<td>GNU/Linux (Xubuntu 12.04.1, 64bit)</td>
</tr>
<tr>
<td>Transcoding tool:</td>
<td>FFmpeg (version git N-59183-g3e62654, Dec 17 2013)</td>
</tr>
</tbody>
</table>
<br>
<table>
<tbody>
<tr>
<td>Video source file:</td>
<td colspan="6"> <a
href="http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m"
moz-do-not-send="true">VQEG reference video "football"</a>
(NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) </td>
</tr>
<tr>
<th>Codec</th>
<th>Encoding</th>
<th>Decoding</th>
<th>Filesize</th>
<th>% of uncompressed</th>
<th>Implementation</th>
<th>Details</th>
</tr>
<tr>
<td><a
href="http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1"
moz-do-not-send="true">FFV1</a> (version 3)</td>
<td>216 fps</td>
<td>277 fps</td>
<td>111 MiB</td>
<td>46.1%</td>
<td><a href="http://en.wikipedia.org/wiki/Libavcodec"
moz-do-not-send="true">libavcodec (FFmpeg)</a></td>
<td> <a
href="http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log"
type="text/plain" moz-do-not-send="true">log</a>, <a
href="http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5"
type="text/plain" moz-do-not-send="true">framemd5</a></td>
</tr>
</tbody>
</table>
<font face="Courier New, Courier, monospace"> <br>
</font><br>
<table>
<tbody>
<tr>
<td>Video source file:</td>
<td colspan="6"> <a
href="http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m"
moz-do-not-send="true">SVT reference video "park joy"</a>
(full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) </td>
</tr>
<tr>
<th>Codec</th>
<th>Encoding</th>
<th>Decoding</th>
<th>Filesize</th>
<th>% of uncompressed</th>
<th>Implementation</th>
<th>Details</th>
</tr>
<tr>
<td><a
href="http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1"
moz-do-not-send="true">FFV1</a> (version 3)</td>
<td>31 fps</td>
<td>63 fps</td>
<td>879 MiB</td>
<td>57.2%</td>
<td><a href="http://en.wikipedia.org/wiki/Libavcodec"
moz-do-not-send="true">libavcodec (FFmpeg)</a></td>
<td> <a
href="http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log"
type="text/plain" moz-do-not-send="true">log</a>, <a
href="http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5"
type="text/plain" moz-do-not-send="true">framemd5</a></td>
</tr>
</tbody>
</table>
<font face="Courier New, Courier, monospace"> <br>
<br>
</font><br>
<font face="Courier New, Courier, monospace"><font face="Courier
New, Courier, monospace"><font face="Courier New, Courier,
monospace"><font face="Courier New, Courier, monospace">PAL-SD
720x576 </font><font face="Courier New, Courier,
monospace">stored as YUV422</font><font face="Courier New,
Courier, monospace">, 10 bpc (bits per component), instead
of the tested 8 bpc above, seems to me would have enlarged
the the filesizes with about 25%, or to about 40 GB/hr
with FFV1 lossless compressed. </font></font></font><br>
<br>
Although the FFV1 compression results above obviously used
yuv422p, 8bps source SD and FHD files as input, it seems for me
that the encoding speeds at 216 fps and 31 fps for SD and FHD
respectively, assumingly should manage realtime FFV1 encoding
and streaming of PAL SD and HDV at 25 fps as well, especially
with a faster i7-6700 x 8 cpu. Comments here?<br>
<br>
<br>
5. Related 2021-[Cin] threads as background references<br>
<br>
[Cin] hdmi capture card (with v4l2)<br>
<a class="moz-txt-link-freetext"
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg02865.html"
moz-do-not-send="true">https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg02865.html</a><br>
<br>
[Cin] offtopic: Digitize and record Video with A/D USB adapters<br>
<a class="moz-txt-link-freetext"
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg03269.html"
moz-do-not-send="true">https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg03269.html</a><br>
<br>
[Cin] offtopic: HDMI capture<br>
<a class="moz-txt-link-freetext"
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg02084.html"
moz-do-not-send="true">https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg02084.html</a><br>
<br>
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)?<br>
<a class="moz-txt-link-freetext"
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg03719.html"
moz-do-not-send="true">https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg03719.html</a><br>
<br>
[Cin] Uncompressed video to lossless compression FFV1/MKV<br>
<a class="moz-txt-link-freetext"
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg03791.html"
moz-do-not-send="true">https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg03791.html</a><br>
</font> </blockquote>
<br>
</body>
</html>