Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
BestSource2 - The Bestest Source with Fast Seeking
Some of you tried and used the original BestSource. Some of you complained that it was slow or was missing RFF and CFR modes. All of this has been fixed. With hardware decoding support intact.
Run your seek tests. Do your worst. This should surpass all previously released source filters with only slightly slower indexing and marginally higher ram usage. BestSource releases
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet Last edited by Myrsloik; 3rd April 2024 at 18:43. |
|
|
|
|
|
#2 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
R2 RC2 released. Keep testing.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#4 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Github is preferred. If it's a specific avisynth issue wait for rc3 since lots of bugs were found there
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#6 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
And we have a proper R2 release!
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#8 | Link |
|
Registered User
Join Date: Aug 2016
Posts: 467
|
Thanks for this source filter, I'm always interested in having more source filters available in case a file doesn't play nice with another filter so it's much appreciated.
These are the source filters I've been using so far and I feel reasonably familiar with their performance and compatibility with the files I play for realtime screening with MPC-HC (mostly MPEG2 DVD remux files (mkv and vob), x264 and x265 with the usual audio formats like AC3, DTS, AAC, MP3, FLAC).
And now I add to that list BSVideoSource and BSAudioSource - we shall see whether it can outdo StvG's FFMS2 fork and possibly LWLibav! Some issues...
Last edited by flossy_cake; 22nd April 2024 at 09:21. |
|
|
|
|
|
#10 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
2. It's the way it is. I'd rather not implement a gazillion path modes. If an angry mob boycotts the filter maybe I'll add some option. 3&4. I have no idea what the exact conventions are but you do get an interesting problem for clips with RFF since effectively the field order does change. What are the rules? Having things like this set per clip and not per frame is to me an absurdity.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#11 | Link | |
|
Registered User
Join Date: Aug 2016
Posts: 467
|
Quote:
You can read about how it's supposed to work here In laymans terms: originally 24p film was stored on DVDs as 30i with 3:2 field cadence, then they realised it's a waste of bandwidth so instead just store 24p and put a bunch of "repeat me" flags for the DVD player to read and construct the 3:2 cadence at runtime. "Great, so I'll just ignore the flags and get the 24p which is what I wanted all along". Unfortunately it doesn't work like that - the flags need to be obeyed otherwise there are sync issues (this is what DG's special "forced film" mode tries to correct, but doesn't get it quite right in my experience). BSVideoSource appears to obey the flags correctly which is great, so it correctly reconstructs the 30i from the 24p, but for some reason it's setting Avisynth internal parity (field order) of the resulting 30i frames to some dynamically changing value which I'm sure it shouldn't be doing since none of the other source filters do it, and it confuses downstream filters like Bob or any IVTC filters which is going to mess with its decision making regarding which field to weave with. Last edited by flossy_cake; 22nd April 2024 at 10:17. |
|
|
|
|
|
|
#12 | Link |
|
Registered User
Join Date: Aug 2016
Posts: 467
|
If inside BSVideoSource you have access to what LWLibav or FFMpeg thinks the field order is, just set it to that, because those filters are trustworthy.
As for the "fieldbased" issue, I would just never set fieldbased to true inside BSVideoSource, because since when do you encounter a video file where each frame is a field? Never happens, never seen it. Fieldbased is a clip property that results from Avisynth processing, it's not a property of the source file. Fieldbased is an Avisynth concept, has nothing to do with the source file. Therefore the source filter should never set it to true. Last edited by flossy_cake; 22nd April 2024 at 10:18. |
|
|
|
|
|
#14 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#15 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#16 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
R4 is out to please the avs+ users.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#20 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Avs+ version?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#24 | Link |
|
Registered User
Join Date: Nov 2008
Posts: 72
|
Thanks for BestSource2, using (55MB) sample "20090227_letterman-x264_m2ts_1080i.mp4" taken from:
https://forum.videohelp.com/threads/...le#post2608363 ffms2 gives slighlty wrong num/den FPS (500000/16697) LSmashVideoSource thinks it's PAL 25fps and duplicate all frames LWLibavVideoSource gives 2x FPS 60000/1001 DirectshowSource gives slightly wrong 10000000/333667 FPS BSSource is the only one which gives correct FPS 30000/1001 |
|
|
|
|
|
#25 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
So even if you get the framerate you expect you could still end up with an audio offset of a few ms. Everything is shit.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#26 | Link |
|
Video damager
Join Date: Sep 2008
Posts: 1,281
|
What's up with this very slow indexing? I guess it tries to decode whole video file.
With LSMASHSource half of encode would be finished when BestSource2 would be still indexing...
__________________
InpaintDelogo, DoomDelogo, JerkyWEB Fixer, Standalone Faster-Whisper - AI subtitling |
|
|
|
|
|
#27 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
The whole file is decoded. Every frame has its checksum calculated. Makes things more reliable than all other source filters.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#28 | Link |
|
Video damager
Join Date: Sep 2008
Posts: 1,281
|
Could be there option implemented for faster indexing like LWLibavVideoSource()?
I like that dxva2/d3d11va decoding works here, could speed-up encoding a bit.
__________________
InpaintDelogo, DoomDelogo, JerkyWEB Fixer, Standalone Faster-Whisper - AI subtitling |
|
|
|
|
|
#29 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
Sure, just download LWLibavVideoSource.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#30 | Link |
|
Video damager
Join Date: Sep 2008
Posts: 1,281
|
I meant the faster indexing.
__________________
InpaintDelogo, DoomDelogo, JerkyWEB Fixer, Standalone Faster-Whisper - AI subtitling |
|
|
|
|
|
#31 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#32 | Link |
|
Big Bit Savings Now !
![]() Join Date: Feb 2007
Location: close to the wall
Posts: 2,106
|
Many thanks Myrsloik !
Here your BestSource R8 just served correct framerate 6.004fps from a crappy xvid in .avi webcam source. The other sourcefilters assumed 25.000fps and borked the stream.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." |
|
|
|
|
|
#33 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Interesting. Now I'm waiting for someone to report a case where the framerate guessing really fails. Posting a mega VFR file doesn't count.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#34 | Link |
|
Registered User
Join Date: Jul 2015
Posts: 989
|
I don't know how to use it.
![]() Test GCC: (GNU) 15.0.0 20241020 (experimental) (SIMD) AVX I don't know if gcc 15.0.0 works correctly in C++23. Wrapper uses std::format and std:: print or fmt::format replacement. https://github.com/vapoursynth/bests...6dcff124a6729f BSAudioSource("myAvi.avi", -1, -1, 0, false, false, 0, 1, "", 100) Code:
[mp3 @ 0000022278cac380] The dropchanged flag is deprecated.
[mpeg4 @ 0000022278cca160] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
[mp3 @ 0000022278cf0fe0] The dropchanged flag is deprecated.
Input #0, avisynth, from 'AudioBoost.avs':
Duration: 01:38:45.19, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
6.83 M-A: 0.000 fd= 0 aq= 192KB vq= 0KB sq= 0B
Code:
[mpeg4 @ 000002184d9377b0] The dropchanged flag is deprecated.
[mpeg4 @ 000002184d97eb80] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
[mpeg4 @ 000002184d97b5d0] The dropchanged flag is deprecated.
[mpeg4 @ 000002184d97bcb0] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B
BSSource("myAvi.avi", -1, -1, false, -1, 1, false, 0, 20, false, false, 1, "", 100, 1000, "", 9, "time.txt", 1, -1, 0) Code:
[avisynth @ 0000012382d187a0] Script error: Invalid arguments to function 'BSSource'. (AudioBoost.avs, line 8) AudioBoost.avs: Unknown error occurred BSSetDebugOutput(false) Code:
[avisynth @ 000001869e344350] AviSynth script did not return a clip AudioBoost.avs: Unknown error occurred I don't know how to use it. Edit: Probably too modern a solution for ffmpeg in gcc 15.0.0. When I have time I will test C++17 with std::to_string. https://www.sendspace.com/file/rxka3g Last edited by Jamaika; 26th October 2024 at 08:06. |
|
|
|
|
|
#35 | Link | |
|
Formerly davidh*****
![]() Join Date: Jan 2004
Posts: 2,890
|
Quote:
Not sure what it would be guessing about though. Edit: just tried the same tracks remuxed back to an MKV. The framerate is correct, but once opened, it was like it was seeking linearly all the way through to whatever frame I was trying to jump to on the timeline. Jumping forward 50 frames takes less than a second. Jumping forward 1000 frames takes ~17 seconds. Jumping forward 5000 frames takes ~90 seconds. No such issue with MP4 container. Last edited by wonkey_monkey; 21st February 2025 at 01:48. |
|
|
|
|
|
|
#36 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
No idea why the framerate is that much off in mp4. I need the file to figure that one out.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#37 | Link | |
|
Formerly davidh*****
![]() Join Date: Jan 2004
Posts: 2,890
|
Quote:
I'll see if there's a smaller one with the same issue.Indexing my 89 blu-ray rips is going quicker than expected and should be finished by the end of today Apart from that one-off niggle (necessity?), BestSource is living up to its name so far! ![]() Can you provide any hints as to the format of the index file? I have a need to extract a list of IDR frames. Last edited by wonkey_monkey; 21st February 2025 at 13:58. |
|
|
|
|
|
|
#38 | Link | |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
|
#39 | Link | |
|
Formerly davidh*****
![]() Join Date: Jan 2004
Posts: 2,890
|
Quote:
![]() ------------------------------------ Here's a 1-second cut from one of the files reporting a wrong framerate with BSSource (other rips report correctly so I'm not sure what the difference might be). Others from the same boxset also report incorrect rates: https://horman.net/cut.mp4 Exactly what framerate is reported seems to vary - sometimes more than 25fps, sometimes less - depending both on the source file and which part of it I cut out with ffmpeg (you can see the wrong framerate in the screenshots below). But it's always the same framerate for the same file. The same tracks in an MKV container report the correct framerate (25fps). ------------------------------------ Here's an example of audio being corrupt/silent on first load (immediately after indexing): https://i.imgur.com/ar25c5Z.png This is demonstrated using the same file as linked above. If you step forward and then back, VirtualDub redraws the corrupted frame's audio as silent. Here's the correct audio, which is always shown on subsequent loads (no indexing required since it's already done): https://i.imgur.com/8Pgp8Uo.png This happens with both MKV and MP4 containers. ------------------------------------ Also to report BSSource has fixed all of the audio sync issues I thought I was having with FFMpegSource and have already "corrected". So I need to undo all of that ![]() ![]()
Last edited by wonkey_monkey; 22nd February 2025 at 23:48. |
|
|
|
|
|
|
#40 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Your FPS sample is weird. I've implemented a fix but it's possible the individual frame timestamps weren't properly reordered to match the b-frame reordering or something => Your file is subtly broken but most things go by container framerate and get it mostly right anyway.
Will investigate the audio issue next.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#42 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
It's more or less for debugging purposes only. Don't touch it unless you think there's a very good reason.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#44 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
R12-RC1 is now available and fixes even more odd corner cases.
It also adds automatic fallback to CPU decoding if no hardware decoder exists for the current format.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#46 | Link |
|
Registered User
Join Date: Nov 2008
Posts: 72
|
Hi, tried BestSource2 v10 and latest v13 and both gives silent audio when opening .VOB with AC3 (tried both 5.1: atrack=1 and 192k stereo: atrack=2):
v= BSSource( "VTS_05_8.vob", atrack=1, cachepath="/") return v żany ideas? Thanks, and great work! |
|
|
|
|
|
#47 | Link |
|
Registered User
Join Date: Nov 2008
Posts: 72
|
Found an issue: VID1.AVI (yuvj422p) was joined with VID2.AVI (yuv420p) using VirtualDub: "VID1-2.AVI". Opening it with BestSource will only return first part of the merged video. Fortunately I still had the originals, so made a script opening each in Avisynth and merging them there (after converting VID2 with ConvertToYUV422). Anyway, maybe in a future version BestSource might be able to deal with mixed AVI inner content, because neither VirtualDub or Player complained.
|
|
|
|
|
|
#48 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
Provide a sample
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#49 | Link |
|
Registered User
Join Date: Sep 2006
Posts: 1,676
|
I ran into a problem with bestsource having frame accurate issue with VOB files. I used DGIndexNV as reference. These are the video length that I got from the different methods, all methods were opened with VD2.
Code:
DGIndexNV -> dgi -> load with DGSource: 24:09.248 DGIndexNV -> demux m2v -> mux to mkv: 24:09.248 DGIndexNV -> demux m2v -> mux to mkv -> BestSource: 19:20.960 mkvtoolnix -> mux vob -> mkv: 24:11.183 mkvtoolnix -> mux vob -> mkv -> BestSource: 19:20.960 vob -> BestSource: 19:20:960 |
|
|
|
|
|
#50 | Link |
|
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
|
How do you know it's wrong? Different from DG stuff by a few frames but that does not a bug make in either of the tools.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
|
|
|
|
#54 | Link | |
|
Registered User
Join Date: Sep 2006
Posts: 1,676
|
Quote:
bs.VideoSource(rff=True) Code:
DGIndexNV -> dgi -> load with DGSource: 24:09.248 frame: 43434 (comb) DGIndexNV -> demux m2v -> mux to mkv: 24:09.248 frame: 43434 (progressive) DGIndexNV -> demux m2v -> mux to mkv -> BestSource: 24:09.248 frame: 43434 (comb) mkvtoolnix -> mux vob -> mkv: 24:11.183 frame: 43492 (progressive) mkvtoolnix -> mux vob -> mkv -> BestSource: 24:09.248 frame: 43434 (comb) vob -> BestSource: 24:09:348 frame: 43437 (comb) |
|
|
|
|
![]() |
|
|