<br><br>On Monday, December 27, 2021, Terje J. Hanssen <<a href="mailto:terjejhanssen@gmail.com" target="_blank">terjejhanssen@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Den 26.12.2021 23:44, skrev Andrew Randrianasulu:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Monday, December 27, 2021, Terje J. Hanssen via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg.org</a>> wrote:<br>
<br>
<br>
<br>
Den 26.12.2021 21:13, skrev Andrew Randrianasulu via Cin:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Sunday, December 26, 2021, Phyllis Smith via Cin<br>
<<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg.org</a>> wrote:<br>
<br>
for now it seems only ffv1.avi defaults to v.0 and mkv<br>
defaults to 3.4<br>
<br>
For now, how about if I just add a comment to ffv1.mkv about<br>
level numbers? That way the user will see this if they look<br>
and can decide for themselves. Otherwise if we make every<br>
possible setting available we will end up with millions of<br>
choices and then if we have new ones labeled _3, when level 4<br>
comes along we would need even more as _4.<br>
<br>
<br>
ok, add comment please}<br>
<br>
</blockquote>
<br>
Ok, maybe I'm thinking aload quite "outside the box" here with my<br>
questions * below:<br>
<br>
I seems for me Cin-GG supports ffv1.mkv in two instances (did't<br>
find other mentioned in the manual either):<br>
<br>
1) File > Save as: ffv1.mkv (that is save current edited video<br>
from Cin-GG)<br>
<br>
and<br>
<br>
2) File > Record<br>
using Video compression according to<br>
<br>
Settings > Preferences > Record<br>
File format: FFMPEG mkv<br>
Video wrench: Compression: ffv1.mkv or user_ffv1.mkv<br>
<br>
* Could i.e the empty <Format box> here be used to input<br>
levels and/or other user options?<br>
<br>
Further down on this window<br>
<br>
Video IN<br>
Record driver: i.e Video4Linux<br>
<br>
* Or possibly get BM Intensity/declink SDK card<br>
working/integrated with ffmpeg/Cin-GG?<br>
<br>
<br>
if you find programmer familiar with both ends.. Cin-gg uses her own code for dealing with v4l2, not ffmpeg's.<br>
<br>
</blockquote>
<br>
So Cin-gg doesn't use ffmpeg to capture/record video directly from a video/TV capture card?</blockquote><div><br></div><div>she uses ffmpeg for compression/muxing (and some effects), but not for interfacing with device... </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But I'm not sure I really understand where Record/prefs/preset ffv1.mkv (2 above) get into this picture?<br>
Just to record (encode and save) the pre-captured video in a lossless ffv1.mkv file format?</blockquote><div><br></div><div>no, you are right - this option selects capture codec</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What would possible benefits be if ffmpeg had been used to capture/record video via the capture card?<br>
Or do we miss something without ffmpeg doing this?</blockquote><div><br></div><div>we miss declink support ) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
In the case of BM Decklink or Intensity Pro 4k, Media Express is available (deb, rpm on Linux) for free capture and playback uncompressed 8 or 10-bit video or compressed ProRes.</blockquote><div><br></div><div>I also noticed there is no way to capture 10 bit rgb/yuv via v4l2.. ( (simply no define for such formats) </div><div><br></div><div><a href="https://github.com/torvalds/linux/blob/master/include/uapi/linux/videodev2.h" target="_blank">https://github.com/torvalds/<wbr>linux/blob/master/include/<wbr>uapi/linux/videodev2.h</a></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
A forum user had found out that Quicktime uncompressed 10 bit 4:2:2 .MOV was the same codec as AJA v210 for 10-bit uncompressed, i.e. it did not require rendering when placed into the FCP timeline. Bit rates examples:<br>
<br>
625 PAL uncompressed 10 bit @ 720 x 576 @ 25fps = 26 MB per/sec, or 93 GB per/hr.<br>
720p HDTV uncompressed 10 bit @ 1280 x 720 @ 59.94 = 140 MB per/sec, or 494 GB per/hr.<br>
1080i and 1080p HDTV uncompressed:<br>
10 bit @ 1920 x 1080 @ 25fps = 132 MB per/sec, or 463 GB per/hr.</blockquote><div><br></div><div>yeah, and if you want more than 1 stream multiply this by num. of streams.. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="https://gist.github.com/afriza/879fed4ede539a5a6501e0f046f71463" target="_blank">https://gist.github.com/afriza<wbr>/879fed4ede539a5a6501e0f046f71<wbr>463</a><br>
<br>
(sdk 12 should be compatible with ffmpeg 4.4?)<br>
<br>
note --extra-cflags="-I$HOME/ffmpeg<wbr>_build/include -I$HOME/ffmpeg_sources/BMD_SDK<wbr>/include -I/usr/lib/cuda/include" \<br>
<br>
and<br>
<br>
--enable-nonfree \<br>
--enable-decklink \<br>
<br>
addditional confugure switches for ffmpeg (you can drop cuda includes if you do not have proprietary nvidia driver/card installed, if course)<br>
<br>
---<br>
List devices:<br>
<br>
ffmpeg -f decklink -list_devices 1 -i dummy<br>
<br>
List supported formats:<br>
<br>
ffmpeg -f decklink -list_formats 1 -i 'DeckLink Quad HDMI Recorder (1)'<br>
<br>
Capture Camera at 23.976fps to h264:<br>
<br>
ffmpeg -y -thread_queue_size 90 -hwaccel cuda \<br>
-channels 2 -raw_format yuv422p10 -format_code 23ps -f decklink -i 'DeckLink Quad HDMI Recorder (1)' \<br>
-c:a pcm_s16le -c:v libx264 -preset ultrafast -crf 10 ~/camera264.mov<br>
<br>
---<br>
<br>
obviously you can try to just copy frames into mov for 'as uncompressed as possible' and hope your disk(s) will keep up! (I've heard stories some ssd dislike being full - their write speed drop down dramatically.. so try to write to not very full ssd. Not sure abount newer nvme.. or raids from them!)<br>
<br>
from<br>
<br>
<a href="https://github.com/wonderunit/storyboarder/wiki/Recording-Live-Camera-and-Desktop-on-Linux-using-Blackmagic-Decklink" target="_blank">https://github.com/wonderunit/<wbr>storyboarder/wiki/Recording-Li<wbr>ve-Camera-and-Desktop-on-Linux<wbr>-using-Blackmagic-Decklink</a><br>
<br>
<br>
<br>
<br>
* Get the option to preserve/archive transcoded ffv1.mkv<br>
directly to a storage device?<br>
<br>
<br>
probably not? (no support for arbitrary compressed frames and their metadata in internal representation.. not impossible, but no one did it yet)<br>
<br>
<br>
<br>
* And/or get the option to load /pipe (uncompressed) video<br>
files recorded on one storage (SSD) device,<br>
compress it with the right preset ffv1.mkv and save it to<br>
another storage device.<br>
<br>
<br>
should be default mode of operation for files (not sure about purely raw video w/o any container, apart from dvvideo, but some types of raw rgb/yuv in avi/mov should work.. test a bit?) , for piping...<br>
<br>
try video loopback?<br>
<br>
<a href="https://github.com/umlaeute/v4l2loopback" target="_blank">https://github.com/umlaeute/v4<wbr>l2loopback</a><br>
<br>
it may even work for declink input, if your ffmpeg can input frames from declink and output to v4l2..<br>
<br>
<br>
<a href="https://superuser.com/questions/1330959/what-is-the-right-ffmpeg-output-format-for-a-v4l2-loopback-device" target="_blank">https://superuser.com/question<wbr>s/1330959/what-is-the-right-ff<wbr>mpeg-output-format-for-a-v4l2-<wbr>loopback-device</a><br>
<br>
some variation of<br>
<br>
ffmpeg examples<br>
Grab desktop:<br>
<br>
ffmpeg -f x11grab -framerate 25 -video_size 1280x720 -i :0.0+0,0 -f v4l2 /dev/video0<br>
Send file:<br>
<br>
ffmpeg -re -i input.mp4 -f v4l2 /dev/video0<br>
<br>
or (in answers)<br>
<br>
ffmpeg -f x11grab -r 60 -s 1920x1080 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0<br>
<br>
guess you can try variation of such cmdline with declink input after compiling non-free ffmpeg with Blackmagick sdk...<br>
<br>
we also probably can use such line for testing non-trivial v4l2 formats in Cinelerra-gg ..<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Sat, Dec 25, 2021 at 9:29 PM Andrew Randrianasulu via Cin<br>
<<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg.org</a>> wrote:<br>
<br>
<br>
<br>
On Sunday, December 26, 2021, Terje J. Hanssen via Cin<br>
<<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg.org</a>> wrote:<br>
<br>
<br>
<br>
Den 25.12.2021 17:35, skrev Andrew Randrianasulu via Cin:<br>
<br>
seems to miss level=3 setting<br>
<br>
$ cat bin/ffmpeg/video/ffv1.avi<br>
avi ffv1<br>
$ cat bin/ffmpeg/video/ffv1.mkv<br>
matroska ffv1<br>
threads=8<br>
context=1<br>
slices=30<br>
$ cat bin/ffmpeg/video/ffv1.mov<br>
mov ffv1<br>
#coder=0<br>
context=1<br>
g=1<br>
level=3<br>
threads=16<br>
slices=16<br>
slicecrc=1<br>
#pass=2<br>
$<br>
<br>
not sure if we should modify our avi/mkv profikes<br>
or add new (may be with _v3 name) ones?<br>
<br>
<br>
Without own experience yet, I would ask if there any<br>
reason to not use the latest and more feature rich<br>
FFV1 level=version 3? Backward compitibility, typical<br>
can v. 3 uncompress v. 1 compressed archives?<br>
<br>
good question... I have older avplay (~2012) here and<br>
will test.<br>
<br>
for now it seems only ffv1.avi defaults to v.0 and mkv<br>
defaults to 3.4 due to crc protection per slice, i think<br>
(looked into ffmpeg encoder source)<br>
<br>
{filenames were just that I had in inputbox, not<br>
indicative of content}<br>
<br>
<br>
$ mediainfo ~/h265-p2.avi<br>
General<br>
Complete name : /data/data/com.termux/files/ho<wbr>me/h265-p2.avi<br>
Format : AVI<br>
Format/Info : Audio Video Interleave<br>
File size : 8.82 MiB<br>
Duration : 3 s 720 ms<br>
Overall bit rate mode : Variable<br>
Overall bit rate : 19.9 Mb/s<br>
Writing application : Lavf58.76.100<br>
<br>
Video<br>
ID : 0<br>
Format : FFV1<br>
Format version : Version 0<br>
Codec ID : FFV1<br>
Duration : 3 s 720 ms<br>
Bit rate mode : Variable<br>
Bit rate : 19.9 Mb/s<br>
Width : 720 pixels<br>
Height : 576 pixels<br>
Display aspect ratio : 5:4<br>
Frame rate : 25.000 FPS<br>
Standard : PAL<br>
Color space : YUV<br>
Chroma subsampling : 4:2:0<br>
Bit depth : 8 bits<br>
Compression mode : Lossless<br>
Bits/(Pixel*Frame) : 1.916<br>
Stream size : 8.81 MiB (100%)<br>
coder_type : Golomb Rice<br>
<br>
<br>
$ mediainfo ~/h265-p2.mkv<br>
General<br>
Unique ID : 361468916052617614775298570411<wbr>4819283<br>
(0x2B829EF6988D4EEDCB446A86122<wbr>10D3)<br>
Complete name : /data/data/com.termux/files/ho<wbr>me/h265-p2.mkv<br>
Format : Matroska<br>
Format version : Version 4<br>
File size : 7.48 MiB<br>
Duration : 3 s 80 ms<br>
Overall bit rate mode : Variable<br>
Overall bit rate : 20.4 Mb/s<br>
Writing application : Lavf58.76.100<br>
Writing library : Lavf58.76.100<br>
ErrorDetectionType : Per level 1<br>
<br>
Video<br>
ID : 1<br>
Format : FFV1<br>
Format version : Version 3.4<br>
Codec ID : V_MS/VFW/FOURCC / FFV1<br>
Duration : 3 s 80 ms<br>
Bit rate mode : Variable<br>
Bit rate : 20.0 Mb/s<br>
Width : 720 pixels<br>
Height : 576 pixels<br>
Display aspect ratio : 5:4<br>
Frame rate mode : Constant<br>
Frame rate : 25.000 FPS<br>
Standard : PAL<br>
Color space : YUV<br>
Chroma subsampling : 4:2:0<br>
Bit depth : 8 bits<br>
Scan type : Progressive<br>
Compression mode : Lossless<br>
Bits/(Pixel*Frame) : 1.927<br>
Stream size : 7.34 MiB (98%)<br>
Default : Yes<br>
Forced : No<br>
Color range : Full<br>
Matrix coefficients : BT.470 System B/G<br>
coder_type : Golomb Rice<br>
MaxSlicesCount : 30<br>
ErrorDetectionType : Per slice<br>
<br>
<br>
<br>
I conclude that a couple of referense papers on the<br>
web say and use level 3 in their profile/presets:<br>
<br>
1) Video into Matroska/FFV1<br>
<a href="https://avpres.net/FFmpeg/im_FFV1.html" target="_blank">https://avpres.net/FFmpeg/im_F<wbr>FV1.html</a><br>
<<a href="https://avpres.net/FFmpeg/im_FFV1.html" target="_blank">https://avpres.net/FFmpeg/im_<wbr>FFV1.html</a>><br>
<br>
We advise to use only the version 3 of FFV1 in<br>
production, because the version 1 is deprecated, the<br>
version 2 has never really existed, and the version 4<br>
is currently under development.<br>
<br>
<br>
Transcode a video file using the FFV1 codec into the<br>
Matroska container for preservation purposes.<br>
Solution<br>
<br>
ffmpeg \<br>
-i input_file \<br>
-c:v ffv1 \<br>
-level 3 \<br>
-coder 1 \<br>
-context 1 \<br>
-g 1 \<br>
-slices 24 \<br>
-slicecrc 1 \<br>
-c:a copy \<br>
output_file.mkv<br>
<br>
2) Presets for FFV1 and MKV: Choosing the right<br>
parameters for the job (ffv1_params.pdf)<br>
<a href="https://docs.google.com/viewer?url=https%3A%2F%2Fmediaarea.net%2FEvents%2F2019-12-05_NoTimeToWait4%2F03.%2520Peter%2520B.%2520-%2520Presets%2520for%2520FFV1%2520and%2520MKV%2C%2520Choosing%2520the%2520right%2520parameters%2520for%2520the%2520job%2Fffv1_params.pdf&pdf=true" target="_blank">https://docs.google.com/viewer<wbr>?url=https%3A%2F%2Fmediaarea.n<wbr>et%2FEvents%2F2019-12-05_NoTim<wbr>eToWait4%2F03.%2520Peter%2520B<wbr>.%2520-%2520Presets%2520for%<wbr>2520FFV1%2520and%2520MKV%2C%<wbr>2520Choosing%2520the%<wbr>2520right%2520parameters%<wbr>2520for%2520the%2520job%<wbr>2Fffv1_params.pdf&pdf=true</a><br>
<<a href="https://docs.google.com/viewer?url=https%3A%2F%2Fmediaarea.net%2FEvents%2F2019-12-05_NoTimeToWait4%2F03.%2520Peter%2520B.%2520-%2520Presets%2520for%2520FFV1%2520and%2520MKV%2C%2520Choosing%2520the%2520right%2520parameters%2520for%2520the%2520job%2Fffv1_params.pdf&pdf=true" target="_blank">https://docs.google.com/viewe<wbr>r?url=https%3A%2F%2Fmediaarea.<wbr>net%2FEvents%2F2019-12-05_NoTi<wbr>meToWait4%2F03.%2520Peter%2520<wbr>B.%2520-%2520Presets%2520for%<wbr>2520FFV1%2520and%2520MKV%2C%<wbr>2520Choosing%2520the%<wbr>2520right%2520parameters%<wbr>2520for%2520the%2520job%<wbr>2Fffv1_params.pdf&pdf=true</a>><br>
<br>
Level = FFV1 version<br>
page 9 (of 30)<br>
<br>
0<br>
1 (Default)<br>
3 (Recommended)<br>
<br>
<br>
FFmpeg recipe (PAL)<br>
page 27 (of 30)<br>
<br>
ffmpeg -i VIDEO_IN \<br>
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24<br>
-slicecrc 1 \<br>
-color_primaries bt470bg \<br>
-color_trc bt709 \<br>
-colorspace bt470bg \<br>
-color_range mpeg \<br>
-map 0 \<br>
-top 1 \<br>
-c:a copy \<br>
-g 1 -pix_fmt + \<br>
VIDEO_OUT.mkv<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
-- Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" target="_blank">https://lists.cinelerra-gg.org<wbr>/mailman/listinfo/cin</a><br>
<<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" target="_blank">https://lists.cinelerra-gg.or<wbr>g/mailman/listinfo/cin</a>><br>
<br>
-- Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" target="_blank">https://lists.cinelerra-gg.org<wbr>/mailman/listinfo/cin</a><br>
<<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" target="_blank">https://lists.cinelerra-gg.or<wbr>g/mailman/listinfo/cin</a>><br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>