Log in

View Full Version : LAV Filters - DirectShow Media Splitter and Decoders


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 [499] 500 501 502 503 504 505 506 507 508 509 510 511

Mercury_22
12th December 2022, 23:34
Working fine here. So if it happens with all files/streams, the problem is at your end.

If problem only happens with certain files/stream, you need to give a link to an example.

It seems that is only happening after pausing or / and seeking and only with mp4 (H.264/AVC) and mp4-av1 (AV01) but not with webM (vp9 profile 0)

Sample https://youtu.be/jhyY5e5grzE

clsid
13th December 2022, 16:30
Playing the AAC track of that video directly in the browser gives silence after the netflix logo sound. Same for the OPUS track. I see no issues or difference with LAV decoding. Same with BE as well.

supercoolman
3rd January 2023, 07:10
the latest LAV 0.77.1 is unable to decode BINK2 video despite ffmpeg seemed to have added (https://github.com/richardpl/FFmpeg/commit/7ab92509994dac1dc181cc5f99c45e3e80cd13bf) the support early last year. is it possible to port that support to LAV?

for example, using MPC-BE + LAV to play the BK2 files from Steam version of STEINS;GATE 0 for Windows doesn't output any video (KB2j) while audio plays without issue

richardpl
3rd January 2023, 11:01
Because you linked fork branch, and not real main branch of FFmpeg, thanks for telling me to remove that branch on github from existence.

clsid
3rd January 2023, 13:50
It is sad that such patches are not getting reviewed/approved by other FFmpeg devs. Maybe Hendrik is willing to do a review once he gets some time for it. Same of your AC4 patch.

LigH
4th January 2023, 18:41
And VVC is another "hot topic"...

ryrynz
7th January 2023, 07:57
I have a file with multiple audio streams in English and Japanese, when I switch to Japanese I get the AC3 192kb/s track rather than the Japanese 24bit PCM track, I have "prefer audio stream with the highest quality selected" both Japanese tracks are in Stereo (two channels) so based on that the PCM track should be favored correct?'
I'm using LAV 71.1.1 with MPC-BE (latest dev)

nevcairiel
7th January 2023, 08:45
LAVs stream selection parameters are only for the initial stream selection. If you swap afterwards during playback, you or your player are in full control.

ryrynz
7th January 2023, 09:29
Thanks. Would you be open to a switch or option for this selection to continue after inital stream selection? Or is this something that I aim at the player devs?

nevcairiel
7th January 2023, 11:45
There is really no interface to do anything like that on LAVs side. The only interface there is lets you pick the exact stream you want - if your player abstracts that away into a language choice, then thats on them to handle.

max79
8th January 2023, 20:01
AFAIR the "syntax" of that command is incorrect, or rather, incomplete;
try this one instead:

protocol://username:password@SiteName.domain/directory/filename.MP3

Hello,

may be you, or anybody else, know, why:confused: "LAV Splitter Source" (and VLC player also) can't playback URLs that contains Cyrillic symbols in its path?:

ftp://music:music@home.dimonius.ru/Music/Russian/Misc/Я_не_поняла.mp3

Any feedback would be appreciated.

Sunspark
8th January 2023, 23:01
I don't think it's the Cyrillic. It doesn't work on MPC-BE with its own decoders and the developers of that are Russian.

Speculating here, the problem might be with FTP chosen as the protocol.

max79
9th January 2023, 12:37
I don't think it's the Cyrillic.

I think you are wrong, because if you rename(these files are not hosted on the server, I renamed just for example) the file name like this:
ftp://music:music@home.dimonius.ru/Music/Russian/Misc/1234.mp3

or like this:
ftp://music:music@home.dimonius.ru/Music/Russian/Misc/file.mp3

it plays!

Sunspark
9th January 2023, 19:59
The renamed files just says "Failed to render the file". Try putting it on a http server instead as a test.

max79
9th January 2023, 22:06
The renamed files just says "Failed to render the file". Try putting it on a http server instead as a test.

http server is not my point. I got issues(only with files named using Cyrillic symbols) with FTP server. I told you, i'm renamed URLs just for example:cool:. This one plays fine:
ftp://music:music@home.dimonius.ru/Music/Russian/Misc/Irina_epifanova.mp3

LigH
9th January 2023, 22:46
Just a guess: Many FTP servers deliver unknown file types in ASCII mode by default. It may have to be configured to know that MP3 files must be delivered in binary mode.

filler56789
9th January 2023, 23:05
I had to use Waterfox for downloading one of the Cyrillic-filenamed MP3s...

MPC-BE plus LAV Splitter always returns "Failed to render the file".

F.W.I.W.....
the Cyrillic filenames are always converted to the STUPID "percent-encoded" strings :-/

Sunspark
10th January 2023, 06:12
This one plays fine:
ftp://music:music@home.dimonius.ru/Music/Russian/Misc/Irina_epifanova.mp3

This one does play. The ones named 1234.mp3 and file.mp3 did not render, but Irina does play. So this is enough to establish that FTP works for latin playback.

I was curious enough to dig further into it, and Cyrillic does work.. with https anyway.. copy and paste the below and see for yourself.

https://archive.org/download/ChicaBomb/ИРИНА ДУБЦОВА И ЛЮБОВЬ.mp3

So maybe unicode is supported for https, but not for ftp?

nevcairiel
10th January 2023, 11:34
This should be fixed in the next nightly, the server was requiring an additional call before it accepts the option to enable UTF8 (which is technically out of spec).
Do keep in mind that you need to pass in the "raw" UTF-8 string, and not a URL-encoded string (eg. not using the percent signs). URL encoding is not used for FTP, and LAV does not process the URLs, they are straight passed to the FTP server as-is.

max79
10th January 2023, 14:29
Cyrillic does work.. with https anyway..
Why:confused: are you misleading people by mixing discussions of two different protocols?:mad: I repeat, "LAV Splitter Source" has problems with ftp://-protocol with files named using Cyrillic symbols!

max79
10th January 2023, 14:33
This should be fixed in the next nightly, the server was requiring an additional call before it accepts the option to enable UTF8 (which is technically out of spec).
Do keep in mind that you need to pass in the "raw" UTF-8 string, and not a URL-encoded string (eg. not using the percent signs). URL encoding is not used for FTP, and LAV does not process the URLs, they are straight passed to the FTP server as-is.
Indeed good news:thanks: It's a pleasure to deal with a professional! I'm appreciate it :) I will be waiting final release.

Sunspark
10th January 2023, 21:33
Why:confused: are you misleading people by mixing discussions of two different protocols?:mad: I repeat, "LAV Splitter Source" has problems with ftp://-protocol with files named using Cyrillic symbols!

I am not misleading anyone. I am helping you. It's part of a process of troubleshooting elimination. It was necessary to prove that ftp works at all because the first two links you shared didn't work, only the 3rd link which came later worked. Then it was necessary to determine whether unicode worked with any other protocols. If it did, it made it possible to narrow down specifically that the issue is with FTP. If it didn't work then the issue wasn't specific to a protocol.

Saying that FTP doesn't work with unicode and leaving it at that won't get any attention paid to it. You need to help others help you by doing some of the work to rule out other things.

andybkma
16th January 2023, 10:42
Hi guys, just got a simple advice question... I noticed when playing/seeking a .ts file with has AVC & AAC inside using LAV for both splitter & audio/video decoding it is slow to play after seeking. MediaInfo says they are MPEG-TS files. If I "remux" the same file to a different container such as mp4 or mkv it plays great. Since I use Zoom Player I was easily able to change the splitter to use Haali instead of LAV under MPEG-TS but it's still slow. Any advice besides remuxing all the files? Just wondering why they are slow to play after seeking since normally everything else I use LAV for is so butter smooth :-)

nevcairiel
16th January 2023, 11:08
MPEG-TS is a broadcast/streaming format, its not designed for local file playback - as such it lacks information where to find the audio/video of the time you requested, so it will do the best it can to find it manually, but that can result in the delay you are seeing, depending on some factors.

If you want to keep those files for a longer time, remuxing them might be the best option.

andybkma
16th January 2023, 11:34
If you want to keep those files for a longer time, remuxing them might be the best option.

Thanks much, I knew there was a simple explanation :-)

ryrynz
31st January 2023, 08:44
Hi Nev, there are times I'd like to show English subtitles when English audio is playing usually to clarify something that was said.
Sometimes these files have multiple languages, I'm only ever interested in maybe or or two languages.

I'm not sure if there would be a better way, but I think that hiding all subtitles that I'm not interested in would be a nice feature and one way to solve it.
Alternatively is there a way to be able to select English subs as a default selection for English audio but not have it enabled?
That way whenever I want to enable subs I can get English first and don't have to scroll through a dozen or so languages or have to use the mouse which takes longer / breaks out of HDR.
Thanks

hubblec4
31st January 2023, 13:50
It seems to me more and more people ask for a Linking-System to link audio with subs.
Here is feature request for Matroska (https://github.com/ietf-wg-cellar/matroska-specification/issues/717)

I also like such a Link-System and I have used it for a long time with the Haali-Splitter which supports such a Link-System in a PERFECT way.

I don't know if nevcairiel are interested in to implement this fearture...

Sunspark
31st January 2023, 20:55
@ryrynz Setting default languages in the splitter is easy, but having subs on/off as a default setting surprisingly seems to be a feature that was overlooked in the player. There is a hotkey you can press to turn subs on and off, W, but you would have to do that every time if you don't want subs on every time.

SirMaster
6th February 2023, 22:39
Can anyone think of a way I can play a media file with MPC-HC or MPC-BE and be able to send the audio track out an HDMI bitstream while simultaneously decoding it to 8 channel PCM?

A player like MPC-BE has a dual audio output option, but it seems to only work if both outputs are bit-streaming or both are decoding.

Is there any software that can sort of masquerade as a sort of virtual output device that can accept bitstream audio and then itself decode it into 8 channel PCM?

Any ideas would be appreciated.

It seems like this should be technically possible, but I am not sure the software needed to make it happen even exists in a way that can be connected together.

Sunspark
7th February 2023, 08:16
I have never used it, but maybe something like OBS Studio that the streamers use for displaying gameplay while also broadcasting themselves in the same stream might have something.

Grimsdyke
21st February 2023, 17:42
Hi Nev, I do have a feature request/suggestion !

Please see this thread for reference.
https://forum.doom9.org/showthread.php?t=183390

Basically the problem is that if m2ts' with different audio formats (TrueHD, DTS, AC3, etc.) are parsed into one "program" according to the disc's mpls it is causing problems during playback.

I have tested MPC-BE/HC with both internal and external LAV-filters, MPV based players and also KODI.

Only VLC can switch between audio tracks without any issues !!

Suggestion:
Add a function to LAV so that the user can prevent that the m2ts' are parsed that way, by, maybe, removing content like label jingles, mpaa rating trailers from the mpls ?

If necessary we can continue via PM. I could also send you a disc to test, etc.

Sunspark
28th February 2023, 08:07
ffmpeg 6.0 has been released. Does LAV track master for ffmpeg or releases?

jkauff
28th February 2023, 09:43
ffmpeg 6.0 has been released. Does LAV track master for ffmpeg or releases?
Nev is one of the primary ffmpeg contributors. He certainly knows what's in the new release.

nevcairiel
28th February 2023, 09:53
LAV generally tracks git master, not releases. I update when i think it makes sense.

Cutterkin
7th March 2023, 20:28
Are the changes made to LAV Nightly Builds documented anywhere? I haven't been able to find a changelog.

I know the source code itself is available on Github but I am not capable of understanding the changes by looking at that. I'd guess many others aren't either.

Thanks!

VBB
7th March 2023, 23:53
You can see every change (commit) here: https://github.com/Nevcairiel/LAVFilters/commits/master

Oh, and Nev, I recently got back into WoW. Never realized how involved you were, or still are LOL. Thanks for the addons!

kedautinh12
8th March 2023, 00:00
How to got nightly build??

huhn
8th March 2023, 01:56
https://files.1f0.de/lavf/nightly/

kedautinh12
8th March 2023, 05:20
Thanks

guest
8th March 2023, 07:48
Thanks

Careful !! :D :D

kedautinh12
8th March 2023, 09:04
Don't worry, R***D*** still off :D

nevcairiel
8th March 2023, 11:17
LAV Filters 0.77.2

LAV Splitter
- NEW: Added identification for spatial/immersive audio extensions (Atmos, DTS:X)
- Changed: More reasonable rounding for odd aspect ratios, avoiding issues with some video pipelines
- Fixed: Improved compatibility with some FTP servers

LAV Audio
- Fixed: Restored the default channel layouts for 5.1 and 7.1 to the correct layout (accidentally changed in 0.77, causing some playback issues)
- Fixed: Some TrueHD files would not decode correctly
- Fixed: Clipping protection did not engage when using Integer output


Download: Installer (both x86/x64) (https://files.1f0.de/lavf/LAVFilters-0.77.2.exe) -- Zips: 32-bit (https://files.1f0.de/lavf/LAVFilters-0.77.2.zip) & 64-bit (https://files.1f0.de/lavf/LAVFilters-0.77.2-x64.zip)

This version resolves a regression caused by accidentally changing the default channel layouts for 5.1 and 7.1 in a refactor in 0.77, which caused playback issues with some audio devices - in particular when bitstreaming on Intel iGPUs.

Additionally, LAV Splitter is now capable of identifying spatial audio extensions, in particular Atmos in both EAC3 and TrueHD, as well as DTS:X.

A bigger update will be coming down in a few months, as I aim to at least do one big update per year, also to keep up with FFmpeg improvements, and bugfixes as needed.

filler56789
8th March 2023, 14:47
LAV Filters 0.77.2

LAV Splitter
- NEW: Added identification for spatial/immersive audio extensions (Atmos, DTS:X)
- Changed: More reasonable rounding for odd aspect ratios, avoiding issues with some video pipelines
- Fixed: Improved compatibility with some FTP servers

LAV Audio
- Fixed: Restored the default channel layouts for 5.1 and 7.1 to the correct layout (accidentally changed in 0.77, causing some playback issues)
- Fixed: Some TrueHD files would not decode correctly
- Fixed: Clipping protection did not engage when using Integer output


Many :thanks: for the endless😇 improvements and fixes. :)

jmone
8th March 2023, 21:22
Great work! Especially the ability to detect Atmos and DTS:X.

SamuriHL
8th March 2023, 22:20
The ability to detect Atmos and DTX:X is pretty awesome!

Manni
9th March 2023, 09:18
Thanks a lot for all your work, as always! :)

flossy_cake
11th March 2023, 00:43
Regarding LAV Audio, I was wondering if it might be possible in theory to implement something equivalent to Avisynth's Normalize (http://avisynth.nl/index.php/Normalize) filter?

Basically it works by scanning the entire audio track prior to playback (takes about 5 seconds for a 30 minute track) in order to find the frame with the loudest peak volume, before raising the volume til that peak touches maximum (0dB) , aka "peak normalization". This isn't compression and doesn't distort the audio in any way, it just sets the volume to its loudest position without clipping.

It's a bit of a messy solution, but I find the result is so pleasing, I'm no longer having to constantly reach for the volume control. It's something that I could see myself applying as a global setting to everything that I play.

The key to it working well is that it scans the entire audio track before playback, whereas "normalization" found in the your HDMI/audio device driver is a realtime normalization that constantly adjusts volume in real time and you can get "pumping" artefacts for example explosions or loud instruments can sound unusually quiet as you hear the normalizer kicking in, then gets louder again for quiet dialogue etc. I tried this and did not like it myself, even after tweaking those attack & decay parameters as best I could.

imo an ideal implementation would have these features:


Use multithreading when scanning the audio track(s) to decrease the scanning time


Store the peak level value in an external file to retrieve the next time that file is played, to avoid having to scan the file again.


Offer an option to immediately begin playing the audio while a background thread scans the audio track(s). When that thread is complete, then apply the normalization gradually over a number of seconds to make it less noticeable. Saves the user having to wait, although this may be a non-issue if multithreading optimisations can speed up the process. Alternatively, display some status text on screen: "Normalizing audio (10 seconds remaining)..." but that would probably need to be done through LAV Video and the two would have to talk to each other - not sure if that's possible.

Sunspark
11th March 2023, 05:15
I would love this feature because I currently use Realtek's Loudness Equalization and while it's not perfect it's better than nothing, but it's silly because I basically have 2 video players set up.. one is set up to use exclusive mode and I use that one for stereo streaming, and the other one is set up in shared mode and I use that one for 5.1 files. I use a different video renderer with each too. Works well.

You need to consider however the use case of streaming.. radio streams, youtube (especially if live), etc. none of that will be possible to pre-scan.

So then, what is the proposal? A toggle button in the player? We already know mpc-hc won't add it. mpc-be, maybe, maybe not. So basically, you'd have to do my two-player solution, where one of the players has lav in pre-scan mode and the other doesn't.

I think it's worth doing, but player support is going to be sub-optimal and will require setting up multiple configurations to avoid having to go into the settings every time to check or uncheck the option.

Also need to consider, would this equalization scanning take place before or after down-mixing 5.1 to stereo? I could see either scenario producing different output results.

jmone
11th March 2023, 08:23
Isn't this a Player Feature not a decoder, splitter, render thing? I'm pretty sure JRiver MC does this.

nevcairiel
11th March 2023, 09:34
This is not something I plan on doing. Pre-scanning the entire file does not fit into any of the concepts of LAV. If you are dealing with an entire video file, this takes far longer then a few seconds, especially if you are on a slow HDD.