View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
richardpl
8th September 2021, 20:51
I checked your files and it deinterlace just fine with ffmpeg.
VictorLS
8th September 2021, 21:17
I checked your files and it deinterlace just fine with ffmpeg.
Yes, of course. But due to progressive flags deinterlace must be forced as at bottom of my post http://forum.doom9.org/showthread.php?p=1950162#post1950162
Balling
9th September 2021, 11:48
I checked your files and it deinterlace just fine with ffmpeg.
Yeah, with -vf yadif that is. I was also wrong about one of those files, it is actually interlaced, while second appears to have interlaced and progressive content (ads, that is).
Unfortunately, no interlaced flag there (as noted general_progressive_source_flag=1 all over), so it cannot be decoded automatically, not like with pic_struct. And of course, pict_struct is 1/2 height (when fields flag is present) so ffmpeg gets confused. Especially bad is bottom first, since that one is not even recognized by ffprobe as interlaced, while top first is.
"namely word indeed in all over both"
Indeed just meant actually. It is actually interlaced hevc.
Quasi-interlaced is already used by PsF (progressive segmented frame, as part of BT.709, esentially just soft telecine of DVDs). So qasi-interlace has opposite meaning: interlaced package has progressive frames inside, but some frames are absent and marked as repeat flag.
Balling
9th September 2021, 12:05
I did just apply a change that might resolve the issue with TrueHD bitstreaming, as it wasn't properly accounting for varying number of samples in every bitstream frame, which is uncommon for bitstreaming and only happens with TrueHD. It should average out typically, but there might be some corner cases where it didn't, so properly counting them makes sense.
You can test it on tomorrows nightly build.
That is nice, I did a lot of testing of TrueHD lately which resulted in richardpl fixing the encoder that was always forgetting last 16 frames (either 1200 fps for 48000 or less fps for 41000). I thought there are always only 40 samples in a frame, but okay. 48000/40 = 1200
We also activated after that 30 bit samples for 24 bit encoder (AFAIK 30 bit are not preserved, of course) container part of TrueHD encoder. Which appears to be lossless in ffmpeg decoder (all of it 16 bit, 24 bit (it is always 24 bit though, no metadata that signals that it is 16 bit)), but not so much when bitstreaming with Lavfilter. But also some bugs in ffmpeg encoder, like encoding mono TrueHD or no support of 8 channels (including for decoding, that appears to be not lossless somehow).
For those who wanna test it, both wav and hash and md5 stuff default to 16 bit. So you will have to force 24 bit. Then you can check whether outside of 16 bits are present by converting to 16 bit and then back to 24 bit. If the md5 of (again, do not forget to change to 24 bit md5 output) original 24 bit and new 24 bit is the same then it is just 16 bit inside of 24 bit container.
Lavfilter has a problem when bitstreaming those ffmpeg encoded truehd of 44100 Hz to LG C9 (desync, acceleration and deacceleration pattern, and also artefacts) and a problem when doing 48000 (only artefacts here). I also am interested what is the difference between MAT 2.0 streaming and Truehd streaming as specified in EDID. You use the first, ain't you?
Balling
11th September 2021, 13:52
Unfortunately TrueHD fix does not fix above mentioned files. Alas. same behaviour on both. Looks like ffmpeg encoder is after all not conformant even if now lossless with internal decoder.
https://github.com/Nevcairiel/LAVFilters/commit/d5088c6841f20a8722effcd39bf17704a035d868
Balling
11th September 2021, 13:57
This is insanely important patch to fix hevc conformance. Please apply, and review all who read it! https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210910040948.14186-1-haihao.xiang@intel.com/
It fixes this very bad ticket. https://trac.ffmpeg.org/ticket/7799#comment:13
P.S. As for conformance see older version of the patch https://patchwork.ffmpeg.org/project/ffmpeg/patch/20191016025040.31273-2-andriy.gelman@gmail.com/
nevcairiel
11th September 2021, 16:23
LAV is about playback, not remuxing, please don't make any weird claims about nonsense.
VictorLS
12th September 2021, 21:51
nevcairiel
Once you don't want to do only keyframe (i.e. IDR- or I-frame) decoding in LAV Video Decoder can you add in LAV Splitter possibilty to set extremely non-synced mode so if computer can't play i.e. 8K fluently audio will permanently playing with normal speed (so without stuttering) and video more and more behind audio ;)
huhn
13th September 2021, 07:17
use a null renderer.
nevcairiel
13th September 2021, 07:41
Thats not possible, audio and video of the same time are near each other in the file, so you can't read one faster then the other, because where would it go? You would end up with the whole file in memory eventually, and some files are pretty big, so there is limits in place.
Balling
14th September 2021, 21:21
LAV is about playback, not remuxing, please don't make any weird claims about nonsense.
That commit is not for LAV. It is just for ffmpeg itself, it appears to trigger bugs in ripping Blu-rays and stuff as you can see in trac issue, its workaround hevc_metadata on the other hand only keeps the base layers
(nuh_layer_id == 0). BTW, do you want TrueHD encoded music I was testing with? I mean you can produce it yourself in latest ffmpeg... Maybe you already know that ffmpeg TrueHD is not HW decoding conformant even if it lossless with ffmeg decoder. Also, Atmos TrueHD music works perfectly as in 2020 triggering Atmos icon! I tested on John Williams - Live in Vienna Blu-ray.
clsid
14th September 2021, 22:11
LAV only uses a subset of ffmpeg code, primarily just demux/decode. hevc_mp4toannexb_bsf is not used by LAV, so that patch is irrelevant. This is not a ffmpeg discussion topic.
richardpl
15th September 2021, 08:10
That commit is not for LAV. It is just for ffmpeg itself, it appears to trigger bugs in ripping Blu-rays and stuff as you can see in trac issue, its workaround hevc_metadata on the other hand only keeps the base layers
(nuh_layer_id == 0). BTW, do you want TrueHD encoded music I was testing with? I mean you can produce it yourself in latest ffmpeg... Maybe you already know that ffmpeg TrueHD is not HW decoding conformant even if it lossless with ffmeg decoder. Also, Atmos TrueHD music works perfectly as in 2020 triggering Atmos icon! I tested on John Williams - Live in Vienna Blu-ray.
If you want to help you could provide info what is broken to get hw encoder compliant. But you instead chose to spam here. Also you can not help use because you are already banned from project because of your nonsense behavior.
Scoty
15th September 2021, 09:54
Is there a also a zip version for nightly? I see only a exe for install but need a zip please.
nevcairiel
15th September 2021, 10:08
Nightlies are only available as the installer.
filler56789
15th September 2021, 11:01
Is there a also a zip version for nightly? I see only a exe for install but need a zip please.
You can extract the relevant files from the installer with the Inno Setup Unpacker:
http://innounp.sourceforge.net/
VictorLS
17th September 2021, 22:50
Can anybody with powerful processor play 20210917-003653_(noname) SID 1.ts (1.6 GB, 6min) https://transfiles.ru/34i62 I've recorded from SAT with LAV Video Decoder and tell us what processor can play that h265 4K 4:2:2 video absolutely fluently in what player and renderer?
Thats not possible, audio and video of the same time are near each other in the file
Thanks for explanation but I believe while streaming it can be somehow done to audio decoding have full priority over video decoding (despite of any sync problem - I saw yellow clock in GraphEdit long time ago) and video decoding must be dropped to nearest I-frame to achieve non-stuttering audio playing - I'm sorry if my English is poor for you understand my point of view ;)
PS. With MPC-BE's MpegSplitter audio is hearable and non-stutter much longer while playing 8K with only I-frame decoding than with LAV Splitter so I presume MpegSplitter lets more non-synced video with audio.
PPS. Can somebody explain difference between MainConcept MPEG Push Demultiplexer and ordinary MainConcept MPEG Demultiplexer (without Push) (as I understand last one like LAV Splitter)?
Snowknight26
17th September 2021, 23:44
Can anybody with powerful processor play 20210917-003653_(noname) SID 1.ts
What is your goal? To find the cheapest one that can? Lots of CPUs can play that without stuttering/frame drops/etc.
Case in point:
https://www.stfcc.org/pics/i/0700a0e2625ae1dc1b7bbdd60c0b57f5_th.png (https://www.stfcc.org/pics/i/0700a0e2625ae1dc1b7bbdd60c0b57f5.png)
VictorLS
18th September 2021, 00:17
What is your goal? To find the cheapest one that can?
Yes, of course. Namely so I've chosen my 3-core Athlon II x3 460 because I knew such dual-core Athlon could decode h264 1920x1080i50 4:2:2 ~20 Mbit/s transmitted from some SAT feeds (for example small record of first FormulaE race in history at 13 September 2014 09-13_13-19-15_hy1_002.mkv (127 МБ, 35с) https://transfiles.ru/h0o80) with about 80% load of both cores absolutely fluently ;)
Btw you haven't mentioned your CPU ;)
Snowknight26
18th September 2021, 00:54
Btw you haven't mentioned your CPU ;)
Right, because it's overkill: 5900X.
I don't think your question is suited for this thread though, as any well-written multi-threaded decoder will perform similarly.
VictorLS
18th September 2021, 09:27
Right, because it's overkill: 5900X.
I don't think your question is suited for this thread though
I agree, but may be someone tried with slower processor on may compare LAV Video Decoder's speed (fps in renderer or DXVA Checker) with i.e. Mainconcept HEVC Video Decoder ;)
Balling
18th September 2021, 10:39
"powerful processor play 20210917-003653_(noname) SID 1.ts"
This sample breaks ffmpeg:
ffmpeg.exe -i "20210917-003653_(noname) SID 1.ts" -f null -
[hevc @ 000001e28cdd7000] video_delay is larger in decoder than demuxer 3 > 0.
If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Looks like b frame pyramid is too crazy. Or maybe it cannot decode it that fast, since ffplay does not trigger it (but ffplay stops playing it too).
VictorLS
18th September 2021, 12:07
Balling
I don't see "video_delay" in log https://disk.yandex.ru/d/2a3wRKChuIjPGQ and ffplay plays both files.
Balling
18th September 2021, 12:34
Balling
I don't see "video_delay" in log https://disk.yandex.ru/d/2a3wRKChuIjPGQ and ffplay plays both files.
ffmpeg.exe -i "20210917-003653_(noname) SID 1.ts" -f null -
Not 004653 (made a typo). EBU bars is also decoded here no problem.
VictorLS
18th September 2021, 15:10
Not 004653 (made a typo)
I thought so - there is ffplay for both files in my log - repeat: I saw video on both.
Balling
18th September 2021, 15:55
>ffplay for both files in my log
That only happens with ffmpeg with -f null
giangibr
18th September 2021, 17:57
Hi,
my name is Gianluca, I am 52 yo, I live in Italy and I am a c/c++ windows programmer forever
I developed many years ago a software for a mediacenter called Chimera (I posted about that in an italian website HTPCItalia, but now that site doesn't exists anymore), this project is composed by:
1) tuner.exe - interface with tuner, save audio/video data on a timeshift file using a directshow filter developed by me called AVNetworkSender
2) chimera.exe - the frontend, I am able to see live TV by reading data from timeshift file, also for that I use a filter developed by me called AVNetworkReceiver (it's a push filter)
Everythings work ok from many years, but now, for switching from DVBT to DVBT2, things are changed.
I bought a DVBT2 tuner, and I have seen that MPEG2-Demultiplexer doesn't work with HEVC programs, so I realized a directshow filter that I use for creating a .ts timeshift file (by analyzing video and audio pids and writing on file only the pids for program requested)
So, on the frontend side, I have a .ts file that I need to view, but, WARNING, this file is growing (it is writed by tuner) while LAV Splitter decode it.
2 problems:
1) I create a graph few seconds after the .ts file is created, so LAV splitter detect Lenght of file at that time (for example 2 seconds) and keep that duration, also if the file is growing
2) Until the .ts file is at least 20 - 25 seconds of duration, LAV splitter stop the graph, so I must press play again. After 20 - 25 seconds, the playback of file is correct, but duration remain the same the LAV splitter has detected at the rendering time.
I tried also to create a Source Async Filter and use LAV splitter instead of LAV splitter (source) but the behavior is the same, although I return the current (increasing) Lenght of file. I also tried to implement CSourceSeeking interface and modified m_rtDuration and m_rtStop but nothing changed.
So my question is:
is there a solution for my problem? Is there a setting so LAV Splitter can update stream duration while play a timeshift file?
I tried to have a look of your source code but it is too complex for me ...
Of course I can share all my software Tuner and Chimera if someone is interested
Bye
Gianluca
VictorLS
18th September 2021, 19:10
That only happens with ffmpeg with -f null
My fault - now I see video_delay is larger in decoder than demuxer 3 > 0 there
But after remux in mkv with mkvtoolnix 61.0.0.0 seems all OK
Btw may be you want help to do ffmpeg better? So upload shorted sample at https://streams.videolan.org/upload and write to ffmpeg-devel@ffmpeg.org ;)
Balling
19th September 2021, 09:23
Even simple ffmpeg.exe -i "20210917-003653_(noname) SID 1.ts" -c copy new.ts
fixes this issue. Sigh.
Balling
20th September 2021, 15:24
I tested 192 kHz TrueHD, also bitstreaming works like 48000 (those use 1200 fps too yet 160 samples in frame).
Balling
24th September 2021, 16:12
I just remembered that Lavfilter's ffmpeg was not updated yet, so this https://github.com/FFmpeg/FFmpeg/commit/7ebeef6affb5f683febdc86f2dc45a339ac97f6c
can be used to fix 44100 Hz TrueHD desync that was affected! See the comment on mailing list about how 44100 was not correctly handled and thus I think MAT 2.0 packer was getting wrong stuff. https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210905155836.6278-1-onemda@gmail.com/#66568
mzso
1st October 2021, 16:26
Hello!
When I record larger videos with OBS with lossless settings, full range setting, 4:4:4, everything seems fine, except when I play it back. I see madVR claiming "limited range (says upstream)" and plays it back in a borked way. When I manually switch to PC range, the video appears correctly.
I guess something is set wrong in the video file. Either that or something is wrong during decoding.
Where is the data stored that tells the decoder whether the video is limited range or not? Is it in the video stream, or the container? Can it be easily fixed?
Here's a sample: https://drive.google.com/file/d/1Gl8Ahqz5edfFd7V9URCeChNJP81K_u1G/view?usp=sharing
el Filou
1st October 2021, 20:03
On my system with latest LAV, it says "limited range (best guess)" instead of "(says upstream)".
Is it possible to configure OBS to output to another container format?
I don't know if it's possible for the UT Video bitstream to store the range information, but if I remux your file to mkv and manually add a full range flag (Range=2) in the colour format header, LAV then passes it correctly to madVR.
nevcairiel
2nd October 2021, 08:14
All UtVideo YUV formats are defined as limited range. (see the format list here: http://umezawa.dyndns.info/archive/utvideo/utvideo-22.6.0-readme.en.html#fourcc - your video was encoded as ULH4). You could use UtVideo RGB instead, as thats full range by definition.
Its unfortunate that OBS basically encodes a bad format like that.
mzso
2nd October 2021, 19:34
All UtVideo YUV formats are defined as limited range. (see the format list here: http://umezawa.dyndns.info/archive/utvideo/utvideo-22.6.0-readme.en.html#fourcc - your video was encoded as ULH4). You could use UtVideo RGB instead, as thats full range by definition.
Its unfortunate that OBS basically encodes a bad format like that.
Huh. That sucks. My guess is they resort to this because recording in RGB has abysmal performance. But I guess at least they should have added a full range flag to the stream in the container as el Filou did.
On my system with latest LAV, it says "limited range (best guess)" instead of "(says upstream)".
Is it possible to configure OBS to output to another container format?
I don't know if it's possible for the UT Video bitstream to store the range information, but if I remux your file to mkv and manually add a full range flag (Range=2) in the colour format header, LAV then passes it correctly to madVR.
How would I go by adding the full range flag? Did you use ffmpeg or mkvmerge? (or something else?)
Balling
3rd October 2021, 01:44
Well, you can use mpv.com --vf=format=colorlevels=full "borked full range video.avi"
As to how: ffmpeg.exe -i "borked full range video.avi" -c copy -color_range 2 borked1.mkv
Please check it is indeed BT.709 matrix.
filler56789
6th October 2021, 07:33
LAVFilters-0.75.1-6.exe
https://files.1f0.de/lavf/nightly/
clsid
6th October 2021, 14:58
Any chance JRVR will become available as a standalone filter in the future?
nevcairiel
6th October 2021, 15:41
Any chance JRVR will become available as a standalone filter in the future?
This is not planned.
chros
6th October 2021, 18:54
What is that?
huhn
6th October 2021, 19:01
jriver video renderer.
lvqcl
6th October 2021, 19:03
Apparently it's JRiver Video Renderer: https://yabb.jriver.com/interact/index.php/topic,130657.0.html
edit: ninja'd
chros
7th October 2021, 06:40
That's something, especially cross-platform support, congrats to you (guys)!
pacuro
7th October 2021, 08:52
Went through this topic and did not found an answer so can anyone confirm working hardware accelerated AV1 playback with LAV Filters?
I have built setup with i7-11700k and H570 on Windows10 and DXVA2-native playback of Costa Rica 4k60 AV1 is bad. H/W playback is indicated but it is not smooth. About 50-55 fps in my opinion.
I know there is a lot of cpu power to run this in software. I just need to check if UHD750 can handle AV1 4K60 in hardware.
jmone
7th October 2021, 08:52
+1 - Great work, a high quality cross platform Video Renderer. Well done nevcairiel.
nevcairiel
7th October 2021, 10:25
Went through this topic and did not found an answer so can anyone confirm working hardware accelerated AV1 playback with LAV Filters?
I have built setup with i7-11700k and H570 on Windows10 and DXVA2-native playback of Costa Rica 4k60 AV1 is bad. H/W playback is indicated but it is not smooth. About 50-55 fps in my opinion.
I know there is a lot of cpu power to run this in software. I just need to check if UHD750 can handle AV1 4K60 in hardware.
I believe Intel only supports AV1 with D3D11, not DXVA2.
goldfield
7th October 2021, 14:52
Hi there,
I've been using madvr for a long time, in conjunction with LAV filters,
with an RTX 3070 as the graphics card now.
Here I have noticed the following problem.
If "Hardware decoder to use" = DXVA2 or D3D11 (native) is set in LAV-Filters,
the HDR tone mapping (even at 60Hz) runs absolutely smoothly, without frame drops.
But the automatic detection of black bars in madvr doesn't work with DXVA2/D3D11 (native).
(A known problem).
If "Hardware decoder to use" DXVA2 or D3D11 = (copyback) is set,
the automatic detection of black bars works without any problems.
But 60Hz/HDR generates strong jerks and frame drops.
In madvr I have already tested all possible settings unsuccessfully to fix the jerking/dropped frames.
The only possibility for a smooth playback of 60Hz/HDR seems to me only to switch to DXVA2 or D3D11 = (native).
Is there a possible option in "LAV Filters" to switch automatically to (native) with 60Hz/HDR (or generally with HDR),
and automatically back to (copyback) with SDR.
lvqcl
7th October 2021, 16:47
Went through this topic and did not found an answer so can anyone confirm working hardware accelerated AV1 playback with LAV Filters?
I believe Intel only supports AV1 with D3D11, not DXVA2.
Yes. Here's what DXVAChecker says for Intel UHD 750:
AV1_VLD_Profile0: D3D11, SD / HD / FHD / 4K / 8K
QBhd
7th October 2021, 17:11
Hi there,
...
Why even use the HW decoder? Is your CPU so old that it can't handle the decoding?
QB
pacuro
7th October 2021, 17:35
@lvqcl to clarify - I know theory. I am looking for proof in reality.
@nevcairiel - I was writing from work and made mistake. You are right, it was all about D3D11 of course. Hardware decoding engaged but something is wrong with performance. Still looking someone with Rocket Lake to check this.
https://bpccdn.fra1.digitaloceanspaces.com/original/3X/8/b/8b6984f030b86884bd3bc5dd012efa1471e9ffdf.png
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.