Comments (1)
Update: today I recompiled LAV Filters myself from master and hacked this function into LAVSplitter, attached .zip contains my adjusted version:
https://nextcloud.dasdeck.com/index.php/s/bGPRdyxtXdAD7qL
There is only this single change: if there is a REG_DWORD value called "PreferredVideoStreamHeight" under HKCU\Software\LAV\Splitter, the demuxer will select the video stream with the smallest absolute difference to this value. If there is no such value in the registry, it will select the stream with the smallest difference to 4320 (=8K), so basically the same behavior as before, since I guess there are no HLS streams with higher resolution (but 4320 could also be replaced with 0xFFFFFFFF, so to really "always select the largest").
To make this work, I added this line on top of the programs for loop in method STDMETHODIMP CLAVFDemuxer::CreateStreams() in LAVFDemuxer.cpp:
DWORD dwFavoriteHeight = m_pSettings->GetPreferredVideoStreamHeight(); // CUSTOM
And inside the loop, I changed
//DWORD dwResolutionScore = st->codecpar->width * st->codecpar->height;
to
DWORD dwResolutionScore = 0xFFFFFFFF - (st->codecpar->height >= dwFavoriteHeight ? st->codecpar->height - dwFavoriteHeight : dwFavoriteHeight - st->codecpar->height);
And that's about it. New method "GetPreferredVideoStreamHeight" is declared in LAVSplitterSettingsInternal.h - since I didn't want to touch the public COM interface - and implemented in LAVSplitter.cpp like this:
STDMETHODIMP_(DWORD) CLAVSplitter::GetPreferredVideoStreamHeight()
{
return m_settings.PreferredVideoStreamHeight;
}
And new DWORD property "PreferredVideoStreamHeight" of CLAVSplitter's Settings struct is initialized directly inside CLAVSplitter::LoadDefaults() like this:
HRESULT hr;
CRegistry reg = CRegistry(HKEY_CURRENT_USER, LAVF_REGISTRY_KEY, hr, TRUE);
DWORD dwVal = reg.ReadDWORD(L"PreferredVideoStreamHeight", hr);
if (SUCCEEDED(hr))
m_settings.PreferredVideoStreamHeight = dwVal;
else
m_settings.PreferredVideoStreamHeight = 4320; // 8K
That's because I didn't want to recompile MPC-HC as well, so I wanted it to work also in case of m_bRuntimeConfig being true, and therefor couldn't add it to the ReadSettings method. For now it's just a hidden extra feature not showing up in the settings GUI, so only for those willing to edit stuff in the Registry. But that's perfectly fine for me.
from lavfilters.
Related Issues (20)
- Chipmunk voices or no sowftare volume control when using player built-in audio transform filter HOT 1
- Crash in LAV Splitter tray menu
- Feature Request: Pitch Correction Support During Playback Speed Adjustments HOT 2
- RTX HDR not working for alot of X265 videos HOT 4
- Deprecated
- LAV Splitter Subtitles Selection HOT 4
- Feature reqest: Add ffmpeg.exe and ffprobe.exe to the package HOT 3
- Blacklist more mov/mp4 handler names HOT 1
- VVC support broken? HOT 1
- I don't know how to set up a decoder to play WMV files.
- OSD expansion with audio and subtitles HOT 2
- Artifacts in Some YouTube HDR Videos When Trying to Playback Using Hardware Decoding HOT 14
- Improve downtime in audio when seeking with bitstreaming enabled HOT 6
- VP9 and HEVC hardware accelleration support wrongly detected HOT 5
- LAV Audio Mixing. Wrong channel mixing when use 5.1 to 2.0 (Stereo) downmix HOT 2
- Streamlink not working after 79.2?
- Get stereo frame buffer when decoding H.264 MVC HOT 4
- Generic D3D11 copyback choice HOT 1
- I updated potplayer to version 240618 (1.7.22260) and then I encountered some errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lavfilters.