Log in

View Full Version : FFV1 supported by LibavSMASHSource?


asarian
18th November 2024, 10:34
I was told LibavSMASHSource supported FFV1. However, LibavSMASHSource just flat-out hangs on this:

vid = core.lsmas.LibavSMASHSource(r"f:\veai\dark_rhea1.mkv")

So, if not LibavSMASHSource, then what can read it?

ChaosKing
18th November 2024, 11:16
"hangs" as in generates an index maybe? How long did you wait?

asarian
18th November 2024, 14:13
"hangs" as in generates an index maybe? How long did you wait?

Hmm, not that long. I was under the impression LibavSMASHSource doesn't need to make an index (like for .mov files).

EDIT: And I see no index being made either. It does seem to be reading on disk like crazy, though.

ChaosKing
18th November 2024, 14:19
Hmm maybe it was the other function "LWLibavSource" with no index? Can't test right now.

asarian
18th November 2024, 14:28
Hmm maybe it was the other function "LWLibavSource" with no index? Can't test right now.

Both seems to hang in the same fasion, with no index being written anywhere.

The .mkv container (with FFV1 in it) is playable by any regular media player, btw.

ChaosKing
18th November 2024, 14:53
Maybe it's a bug then.

Did you also check the hdd activity?

asarian
18th November 2024, 15:26
Maybe it's a bug then.

Did you also check the hdd activity?

Yep, hard disk is reading, but not writing; nothing happens still.

I even tried this:

vid = core.bs.VideoSource(source="f:/veai/dark_rhea1.mkv")

Still hangs, like the rest.

poisondeathray
18th November 2024, 15:29
For MKV, use


core.lsmas.LWLibavSource


For MOV, MP4, use


core.lsmas.LibavSMASHSource


The latter does not require index and is faster. Don't use MKV if you don't like indexing

Z2697
18th November 2024, 15:34
Can you test the file generated by this

ffmpeg.exe -f lavfi -i testsrc2=hd1080:d=1 -c:v ffv1 asd.mkv


It reads normal on my side.

asarian
18th November 2024, 15:52
Can you test the file generated by this

ffmpeg.exe -f lavfi -i testsrc2=hd1080:d=1 -c:v ffv1 asd.mkv


It reads normal on my side.

That was a good test. :thanks:

I'm beginning to believe TVAI produces some incompatible FFV1 file, as my file still hangs (even though it's playable in an external media player). I set the output to 10-bit, 4:2:0.

EDIT:

ffmpeg can read it, of course:

Input #0, matroska,webm, from 'dark_rhea1.mkv':
Metadata:
VIDEOAI : Enhanced using rhea-1; mode: auto; revert compression at 0; recover details at 0; sharpen at 0; reduce noise at 0; dehalo at 0; anti-alias/deblur at 0; focus fix Off; and recover original detail at 20. Changed resolution to 3840x2160
creation_time : 2024-11-17T23:36:55.253000Z
ENCODER : Lavf61.5.101
Duration: 01:40:29.11, start: 0.000000, bitrate: 419441 kb/s
Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv420p10le(tv, bt709, progressive), 3840x2160, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn
Metadata:
ENCODER : Lavc61.11.100 ffv1
DURATION : 01:40:29.106000000

poisondeathray
18th November 2024, 16:38
Also try ffms2 , and remuxing the mkv

asarian
18th November 2024, 17:08
Also try ffms2 , and remuxing the mkv

Long live ffmpeg! I got it working now, letting ffmpeg convert the lot to a .mov file!

F:\veai>ffmpeg -i "dark_rhea1.mkv" -c copy "i:\video\dark.mov"

And then just

vid = core.lsmas.LibavSMASHSource(r"i:\video\dark.mov")

Thank you all for thinking along.

asarian
18th December 2024, 01:52
Also try ffms2 , and remuxing the mkv

Again not working.

vid = core.bs.VideoSource(source=r"h:/veai/sucker.mov")
vid = core.lsmas.LibavSMASHSource(r"h:/veai/sucker.mov")
vid = core.ffms2.Source(source=r"h:/veai/sucker.mov")

Used them all. All these filters just outright hang (or are producing an index? file is over 600G long). I see no index being written to disk, though.

This time the FFV1 file has HDR data in it:

videoai : Enhanced using prob-4; mode: manual; revert compression at 87; recover details at 16; sharpen at 13; reduce noise at 19; dehalo at 10.665700000000001; anti-alias/deblur at -10; focus fix Off; and recover original detail at 20
encoder : Lavf61.7.100
Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv422p10le(bt2020nc/bt2020/smpte2084, progressive), 3832x1584 [SAR 1:1 DAR 479:198], q=2-31, 683268 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
Metadata:
creation_time : 2024-12-17T15:08:18.000000Z
handler_name : VideoHandler
vendor_id : FFMP
encoder : Lavc61.5.103 ffv1
Side data:
Mastering Display Metadata, has_primaries:1 has_luminance:1 r(0.7080,0.2920) g(0.1700,0.7970) b(0.1310 0.0460) wp(0.3127, 0.3290) min_luminance=0.005000, max_luminance=1000.000000
Content Light Level Metadata, MaxCLL=1105, MaxFALL=805
Press [q] to stop, [?] for help
[out#0/mov @ 000002e129200a40] video:637990065KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.000337%
frame=183396 fps= 44 q=-1.0 Lsize=637992215KiB time=02:07:29.14 bitrate=683270.4kbits/s speed=1.82x

poisondeathray
18th December 2024, 03:10
Stream copy/cut a small segment like with ffmpeg. Try a source filter on that. If it works relatively "fast", likely you need to wait longer for the larger file on your hardware setup . If small segment hangs - file a bug report and include the sample