View Full Version : FFmpegSource
tebasuna51
21st March 2024, 09:46
If the MP4 is timestamp VFR variety - It does not drop frames if you omit the fpsnum, fpsden options . You only get the encoded frames and average FPS.
AFAIK now, to preserve the audio sync, you must add the (...,timecodes = "timestamp.txt",... ) in order to mux video/audio with that in a container.
poisondeathray
21st March 2024, 14:47
AFAIK now, to preserve the audio sync, you must add the (...,timecodes = "timestamp.txt",... ) in order to mux video/audio with that in a container.
Yes, and that will give you a file similar to the original in terms of VFR timing . You can also extract timestamps with other methods such as ffmpeg, mkvextract (for mkv), mp4fpsmod (for mp4)
One benefit of not using fpsnum, fpsden is you get unique frames - this is beneficial if you were using temporal filtering, or if you were using "slow" filters such as some machine learning - there is no reason to use duplicates
You can add ChangeFPS to add the duplicates frames and make it CFR afterwards . There are also VFR to CFR avs plugins that read the timestamp/timecodes file if you needed CFR
hello_hello
22nd March 2024, 11:04
And that's what I want to avoid. I just want all frames (without duplicating or dropping) like VirtualDub does. So I want to treat VFR as CFR. I'll change the FPS later anyway, and the audio doesn't matter.
FFMS2 can write the timecodes to a text file while indexing. You can use the TimeCodes argument to specify the name/location of the timecodes file.
The video is decoded at the average frame rate, but if you happen to be encoding with the x264 encoder, you can add the timecodes to the command line and it'll encode in VFR mode.
--tcfile-in "D:\timecodes.txt"
It's been a while since I've encoded anything as VFR, but the first line of the timecodes file should look like this:
# timecode format v2
or this:
# timestamp format v2
I can't remember if x264 accepts both these days, but if the timecodes file isn't recognized, try changing the first line.
hello_hello
22nd March 2024, 11:12
You can add ChangeFPS to add the duplicates frames and make it CFR afterwards . There are also VFR to CFR avs plugins that read the timestamp/timecodes file if you needed CFR
At the risk of being argumentative, ChangeFPS can't convert VFR to CFR correctly. If you had an imaginary video where the first half was 15fps and the second half was 30fps, the average frame rate would be 25fps. If you used ChangeFPS(30) to convert it to 30fps, the extra frames would be inserted evenly throughout the video, but to keep the A/V sync, the extra frames all need to be inserted in the first half.
poisondeathray
22nd March 2024, 14:59
At the risk of being argumentative, ChangeFPS can't convert VFR to CFR correctly. If you had an imaginary video where the first half was 15fps and the second half was 30fps, the average frame rate would be 25fps. If you used ChangeFPS(30) to convert it to 30fps, the extra frames would be inserted evenly throughout the video, but to keep the A/V sync, the extra frames all need to be inserted in the first half.
Correct - and that's important to clarify. I only mentioned ChangeFPS because rgr didn't need audio or sync . He could use AssumeFPS without drops or duplicates as well
I also mentioned avs plugins that read the timecodes when converting to CFR, which is better way to do it when you have audio.
https://github.com/Asd-g/TimecodeFPS
https://github.com/jojje/VfrToCfr-the-other-one
ravewulf
25th March 2024, 13:55
yep, fixed. :)
You... can't, I'm afraid. You can only output a certain framerate and to obtain that ffms2 will either drop or duplicate.
The best bet is to set fpsnum and fpsden to get the maximum output framerate so that it will never drop frames.
Sure, there will be dups scattered here and there, but that's not a problem.
Why? Simple. It's because it's exactly what you would see if you were to open a VFR video on any other player.
Simply put, if you have a video with VFR that oscillates from 10fps to 60fps as the example I mentioned above and you were to play it on your computer connected to a 60Hz monitor, the player would output 60fps all the time to the monitor (that's excluding FreeSync/GSync monitors which are not that common anyway).
In other words, trust me, just set fpsnum and fpsden to the maximum FPS of the video and you're gonna be fine.
Encoding it as CFR is gonna be fine anyway 'cause x264 is really good at spotting duplicated frames so it will just put a B frame there with a reference to the former frame, thus wasting virtually no bitrate. Besides, if you still wanna re-encode it to VFR instead of CFR post Avisynth, you still can anyway as FFMpeg->libx264 can automatically remove dups and encode it as VFR for you. ;)
Just to make sure this is explicitly corrected:
int fpsnum = -1, int fpsden = 1
Controls the framerate of the output; used for VFR to CFR conversions. If fpsnum is less than or equal to zero (the default), the output will contain the same frames that the input did, and the frame rate reported to Avisynth will be set based on the input clip's average frame duration. If fpsnum is greater than zero, FFVideoSource will force a constant frame rate, expressed as a rational number where fpsnum is the numerator and fpsden is the denominator. This may naturally cause FFVideoSource to drop or duplicate frames to achieve the desired frame rate, and the output is not guaranteed to have the same number of frames that the input did.
https://github.com/FFMS/ffms2/blob/master/doc/ffms2-avisynth.md#int-fpsnum---1-int-fpsden--1
FranceBB
25th March 2024, 21:53
Fair enough.
Myrsloik
3rd April 2024, 18:57
Let me present the successor to FFMS2: BestSource...2!
It has Avs+ and VS support. Guaranteed frame/sample accurate seeking for both audio and video. The seeking is also very fast for almost all files.
https://github.com/vapoursynth/bestsource/releases/tag/R2-RC1
Due to these great advances the future of FFMS2 is quite bleak. There will probably be a final release in a few months and then I'll abandon the project.
But FFMS2 opens video and audio without AudioDub...
Myrsloik
3rd April 2024, 19:27
But FFMS2 opens video and audio without AudioDub...
Orly?
https://github.com/FFMS/ffms2/blob/master/src/avisynth/avisynth.cpp#L311
Orly?
https://github.com/FFMS/ffms2/blob/master/src/avisynth/avisynth.cpp#L311
Rly! I swear I don't have to write!
FranceBB
3rd April 2024, 19:36
The question now remains whether StvG will keep going with his builds or not.
Ideally we could end up in a place where:
- FFVideoSource() / FFAudioSource() / FFMpegSource2() is maintained by StvG
- LWLibavVideoSource() / LWLibavAudioSource() / LSMASHVideoSource() / LSMASHAudioSource() is maintained by asd-g
- BSVideoSource() / BSAudioSource() is maintained by Myrsloyk
That on top of the old last resort DirectShowSource() would allow quite some choices for Avisynth users in general.
After all those years, it seems unthinkable to see ffms2 follow NicAudio in the graveyard...
As to BestSource, I'll test it through, but I have so many workflows relying on ffms2 that I'm really skeptical at the moment to migrate.
Myrsloik
3rd April 2024, 20:13
Rly! I swear I don't have to write!
I've sneakily updated the release so you don't have to write ever again!
StvG
9th April 2024, 21:42
The question now remains whether StvG will keep going with his builds or not.
There are recent updates on the upstream. If in the end my fork doesn't bring something additional, I will have no reason to continue with the builds otherwise I will keep the fork alive. At the moment these are the differences (https://forum.doom9.org/showthread.php?p=1998674#post1998674).
kedautinh12
9th April 2024, 23:54
You can continue keep it updates cause updates on the upstream don't have x86 version
rgr
10th April 2024, 11:13
1. ffms2-5.0-RC3-msvc.7z -- can't open files with national characters (for example "ąćęłńóśż"), reverting to ffms2_r2390.7z fixes the problem.
https://imgur.com/VXSMx5J
2. ffms2_r2390.7z -- cannot read VFR files correctly with ffms2("test-ąćęłńóśżź.mp4",atrack=-1,fpsnum=50), video and audio are desynchronized (about 0,5s after 2-3h). Reverting to ffms2-2.40-msvc.7z unfortunately does not cure the problem. I can send a sample, but only privately, and it has 22GB... I'm trying to find the reason and workaround, but players and VirtualDub play the file correctly. Edit: The VFR issue also affects ffms2-5.0-RC3-msvc.7z
Edit: I tested LWLibavVideoSource. Video and audio are synchronized.
Edit 2: I tried using ffms2("file.mp4",atrack=-1).changeFPS(50) but it doesn't work (there is the same audio delay). The problems lie somewhere deeper in ffms2.
rgr
10th April 2024, 11:18
I've sneakily updated the release so you don't have to write ever again!
Super! But I don't see it in the manual :) (Edit: But I see now.)
Edit: However, it would be worth starting a new thread for BS :)
I tried running BestSource:
a=BSVideoSource("test.mp4",fpsnum=50)
b=BSAudioSource("test.mp4")
AudioDub(a,b)
but nothing has happened for several minutes, 50MB/s disk load (4% on SSD) and 23% CPU usage... (MPC).
Edit: After 30(!) minutes, playback started. I guess it takes too long... Unfortunately, the audio delay is the same as in the case of ffms2. Only LWLibavVideoSource can handle this VFR.
rgr
10th April 2024, 15:29
I checked all plugins when reading VFR. This is the video offset relative to the correct one (Libav) in ffms2 and Best (it is identical in both).
plugin: frame number:
Libav: 182 631 21846 100294 200945 553462
Best: 182 631 21845 100289 200935 553435
ffms2: 182 631 21845 100289 200935 553435
In VirtualDub, the ffmpeg plugin reads like libav (-1 frame), while the Cache Input Driver plugin reads like ffms2/best.
It looks like ffms2/best completely ignores this parameter.
The video actually deviates only slightly from 50fps, maybe that's the reason?
Frame rate: 50,000 FPS
Minimum frame rate: 42.735 FPS
Maximum frame rate: 60.241 FPS
https://i.imgur.com/ZkLO0ke.png
Myrsloik
10th April 2024, 19:24
Super! But I don't see it in the manual :) (Edit: But I see now.)
Edit: However, it would be worth starting a new thread for BS :)
I tried running BestSource:
a=BSVideoSource("test.mp4",fpsnum=50)
b=BSAudioSource("test.mp4")
AudioDub(a,b)
but nothing has happened for several minutes, 50MB/s disk load (4% on SSD) and 23% CPU usage... (MPC).
Edit: After 30(!) minutes, playback started. I guess it takes too long... Unfortunately, the audio delay is the same as in the case of ffms2. Only LWLibavVideoSource can handle this VFR.
THere is a forum thread here: https://forum.doom9.org/showthread.php?t=185408
Eactly what did you open that took 30 minutes? And what did you read it from? I'm curious now
rgr
10th April 2024, 22:47
If the MP4 is timestamp VFR variety - It does not drop frames if you omit the fpsnum, fpsden options . You only get the encoded frames and average FPS .
If you enter fpsden, fpsnum, it will add duplicates and/or drop frames to achieve the desired CFR
Thanks -- that's what I meant.
rgr
10th April 2024, 22:51
Eactly what did you open that took 30 minutes? And what did you read it from? I'm curious now
Video from HDMI recorder -- 22GB, 4h long, H265.
Opened from .avs file via BSSource. Creating the cache file took so long.
https://i.imgur.com/CCD1KQE.png
LigH
11th April 2024, 08:53
Well, there are file formats which are hard to parse, because it requires sequential reading across the whole file, due to the lack of a header which contains a lot of useful information (like a list of GOP start positions) right in the beginning. TransportStreams, as used in Digital Broadcast, are such a case. Raw H.264/H.265 video streams too, they would strictly even require parsing bit by bit, fortunately most are conveniently aligned at least at byte boundaries.
rgr
11th April 2024, 11:03
Yes, but ffms2 or Libav do it much faster, so there is room for improvement.
LigH
11th April 2024, 13:42
Ah, okay; I guess BestSource needs its own thread then, I did not notice you mean "BS in contrast to FFMS2 and LSW".
rgr
11th April 2024, 15:30
So to be in line with the topic, I will write that ffms2 does not want to support long paths -- with 219 characters (including national ones) I get:
[in#0 @ 000002752ddb7a00] Error opening input: Unknown error occurred
Error opening input file testXXX.avs.
Error opening input files: Unknown error occurred
rgr
25th April 2024, 11:31
5.0 RC3 (https://github.com/FFMS/ffms2/releases/tag/5.0-RC3)
Now with FFmpeg that has zlib and some other fun libraries included.
Don't bother reporting any of the listed known issues. They'll probably be resolved before the next release.
He does not accept this path. "Unknown error occurred".
D:\_na pena\_klienta247(mDV-exp)\Adaś Komarnicki nad morzem (25.06.2002 14.52).avi
Version 2.40 works ok.
Version ffms2 r2390 - I haven't tested it yet.
Myrsloik
8th May 2024, 21:11
5.0 RC4 (https://github.com/FFMS/ffms2/releases/tag/5.0-RC4)
Lots of fixes and probably the final RC because now we're completely out of people who give a shit.
5.0 RC4 (https://github.com/FFMS/ffms2/releases/tag/5.0-RC4)
Lots of fixes and probably the final RC because now we're completely out of people who give a shit.
As in my post above -- RC4 does not want to open files with national characters. This wasn't a problem with long paths, my error.
Now I'm testing VFR file support.
Edit: Yes, there is still a shift of 35 frames with a clip of approximately 4 hours.
1st row - original VFR
2nd row - LWlibavSource
3rd row - ffms2
FranceBB
10th May 2024, 12:46
we're completely out of people who give a shit.
One last thing, I can see that you updated the APIs to 6.1.1
Before you give up on ffms2 and move to BestSource, may I ask you to update the APIs one last time to integrate with FFmpeg 7.x so that we're gonna be safe for a while relinking against newer ffmpeg version ourselves coming this new release cycle? :)
Myrsloik
10th May 2024, 13:23
You won't be "safe" at all. Every new ffmpeg version usually requires new workarounds or that an old hack is removed. 5.0 is tested with ffmpeg 6.1.x and that's how it is.
Daemon404
10th May 2024, 16:30
FWIW, I will still be around to maintain FFMS2, as I have been for ~10 years now, even if/when Myrsloik has moved on to BestSource.
(It was no easy feat to log in here... You last visited: 18th August 2019 at 19:09).
pandv2
29th June 2024, 16:17
FWIW, I will still be around to maintain FFMS2, as I have been for ~10 years now, even if/when Myrsloik has moved on to BestSource.
Thanks, the alternatives are not well suited for my project.
FranceBB
8th July 2024, 16:34
Hey StvG,
I have two files exported from AVID after the editor edited a LiveU internet stream (i.e the initial quality was poor).
They're XDCAM-50, which means FULL HD MPEG-2 High Profile Main Level 4:2:2 yv16 25i TFF BT709 SDR.
The audio is CH.1 Left Italian CH.2 Right Italian carried as discrete mono PCM 24bit 48000Hz.
The container is an mxf.
So far so good, I've seen plenty of similar files, however what I'm wondering is why ffms2 seems to be populating the frame properties with some bogus values in terms of matrix, primaries and transfer.
Those are the two files:
Sample 1: https://wetransfer.com/downloads/0c94e12942d0a0a3d9c17bf7c1d3acd420240704122313/272718
Sample 2: https://we.tl/t-AJU0XLq86w
When I index them with:
video=FFVideoSource("A:\MEDIA\temp\FL RUGBY.mxf")
ch1=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=1)
ch2=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=2)
audio=MergeChannels(ch1, ch2)
AudioDub(video, audio)
I get the following frame properties:
https://i.imgur.com/FEPt19z.png
As you can see, Matrix, Primaries and Transfer are set to 3 which is a bogus value, while I expected them to be set to 1 as they're BT709.
If I do something like:
video=FFVideoSource("A:\MEDIA\temp\FL RUGBY.mxf")
ch1=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=1)
ch2=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=2)
audio=MergeChannels(ch1, ch2)
AudioDub(video, audio)
AssumeTFF()
Bob()
ConverttoRGB24()
it errors out with "Unknown matrix" 'cause it doesn't recognize the value 3, so either I nuke frame properties like:
video=FFVideoSource("A:\MEDIA\temp\FL RUGBY.mxf")
ch1=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=1)
ch2=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=2)
audio=MergeChannels(ch1, ch2)
AudioDub(video, audio)
propclearall()
AssumeTFF()
Bob()
ConverttoRGB24()
or I manually specify the values like so:
video=FFVideoSource("A:\MEDIA\temp\FL RUGBY.mxf")
ch1=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=1)
ch2=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=2)
audio=MergeChannels(ch1, ch2)
AudioDub(video, audio)
propSet("_Matrix", 1) #BT709
propSet("_Transfer", 1) #BT709
propSet("_Primaries", 1) #BT709
AssumeTFF()
Bob()
ConverttoRGB24()
and of course I could always just manually populate ConverttoRGB24(matrix="Rec709") like so:
video=FFVideoSource("A:\MEDIA\temp\FL RUGBY.mxf")
ch1=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=1)
ch2=FFAudioSource("A:\MEDIA\temp\FL RUGBY.mxf", track=2)
audio=MergeChannels(ch1, ch2)
AudioDub(video, audio)
AssumeTFF()
Bob()
ConverttoRGB24(matrix="Rec709")
In other words, as long as I'm encoding things manually, that's not really an issue, but the problem is that those are part of an automated workflow, so they keep failing and I *have to* encode them manually all the time.
https://i.imgur.com/ysongyR.png
If I perform a mediainfo on the file, matrix, transfer and primaries are correctly identified as BT709, so I wonder why ffms2 is marking them as 3 rather than 1 in the frame properties...
General
Complete name : A:\MEDIA\temp\FL RUGBY.mxf
Format : MXF
Commercial name : XDCAM HD422
Format version : 1.3
Format profile : OP-1a
Format settings : Closed / Complete
File size : 1.02 GiB
Duration : 2 min 46 s
Overall bit rate : 52.7 Mb/s
Frame rate : 25.000 FPS
Package name : Source Package
Encoded date : 2024-07-08 08:21:58.088
Writing application : Avid Technology, Inc. Avid MediaProcessor Plug-In 1.0.60.10070.1
Writing library : MXF::SDK (4.7.14) on Win64 4.7.14.10177.1
Video
ID : 512
Format : MPEG Video
Commercial name : XDCAM HD422
Format version : Version 2
Format profile : 4:2:2@High
Format settings : BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Default
Format settings, GOP : Variable
Format settings, picture structure : Frame
Format settings, wrapping mode : Frame
Codec ID : 0D01030102046001-0401020201040300
Duration : 2 min 46 s
Bit rate mode : Constant
Bit rate : 50.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.965
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Open
Stream size : 994 MiB (95%)
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio #1
ID : 768
Format : PCM
Format settings : Little
Format settings, wrapping mode : Frame (AES)
Codec ID : 0D01030102060300-0402020101000000
Duration : 2 min 46 s
Bit rate mode : Constant
Bit rate : 1 152 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 22.9 MiB (2%)
Locked : Yes
Audio #2
ID : 1024
Format : PCM
Format settings : Little
Format settings, wrapping mode : Frame (AES)
Codec ID : 0D01030102060300-0402020101000000
Duration : 2 min 46 s
Bit rate mode : Constant
Bit rate : 1 152 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 22.9 MiB (2%)
Locked : Yes
Other #1
ID : 1-Material
Type : Time code
Format : MXF TC
Frame rate : 25.000 FPS
Time code of first frame : 10:00:00:00
Time code of last frame : 10:02:46:17
Time code settings : Material Package
Time code, stripped : Yes
Title : Timecode
Other #2
ID : 0-Source
Type : Time code
Format : MXF TC
Frame rate : 25.000 FPS
Time code of first frame : 10:00:00:00
Time code of last frame : 10:02:46:17
Time code settings : Source Package
Time code, stripped : Yes
Other #3
Type : Time code
Format : SMPTE TC
Muxing mode : SDTI
Frame rate : 25.000 FPS
Time code of first frame : 10:00:00:00
ffprobe -show_frames "FL RUGBY.mxf" > log.txt shows that these frame properties have value "reserved" - https://i.ibb.co/C8Hvz6P/Untitled1.png
FranceBB
8th July 2024, 22:51
Ah... Gotcha.
So it is an ill created file after all!
At this point I'm not even sure where Mediainfo is getting BT709 from eheheheh.
Emulgator
8th July 2024, 23:23
Could it be that there was guesswork implemented like width<720 -> 601, width>=720-> 709 ?
Zenitram (Martinez from Mediainfo) should know.
isidroco
6th August 2024, 07:00
Tried both ffms2-5.0-RC4-msvc and final ffms2-5.0-msvc, can't get audio working:
When using FFAudioSource or ffms2( X, atrack=-1 ) I get: "System Exception - Access Violation"
Tried small videos: .MOV (with wav PCM) .MP4 (with AAC) and .MKV (with Flac), all fails in the same way.
Works fine with ffms2_r1369 or other older versions.
Tested both in W10 20h2 x64 and Win7 x64, with Avysynth+ v3.7.2 r3661 with same results.
rgr
6th August 2024, 17:52
Tried both ffms2-5.0-RC4-msvc and final ffms2-5.0-msvc, can't get audio working:
When using FFAudioSource or ffms2( X, atrack=-1 ) I get: "System Exception - Access Violation"
Tried small videos: .MOV (with wav PCM) .MP4 (with AAC) and .MKV (with Flac), all fails in the same way.
Works fine with ffms2_r1369 or other older versions.
Tested both in W10 20h2 x64 and Win7 x64, with Avysynth+ v3.7.2 r3661 with same results.
I use ffms2_r2390.7z. It doesn't work very well with VFR, but there are no other problems. Your versions don't work for me either, but for different reasons.
isidroco
7th August 2024, 02:12
I use ffms2_r2390.7z. It doesn't work very well with VFR, but there are no other problems. Your versions don't work for me either, but for different reasons.
Thanks, worked great. I don't use VFR, most processing from my camera, and some digitilazations from analog sources (all fixed frame rate).
Tima
6th October 2024, 03:01
My results:
https://i.imgur.com/S2Y6JY3.png
Could you please run your seeking test suite against FFMS2 v5.0 and share the results?
ChaosKing
7th October 2024, 10:26
My results for ffms2 5.0
https://i.imgur.com/6Fj6o3d.png
rgr
9th October 2024, 15:07
What does it mean?
"Fixed all issues with FFmpeg 6.1 which is now the minimum requirement"
Can I load the avs file into "ffmpeg version 2024-02-26-git-a3ca4beeaa-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project)" ?
LigH
9th October 2024, 15:12
FFmpegSource contains an own core of FFmpeg (libavcodec, libavformat) to be able to read different source media formats into AviSynth. It does not matter where you load that AviSynth script into.
Version 6.1 of FFmpeg is the minimum requirement for FFmpeg sources to build the FFmpegSource AviSynth plugin with. If you don't compile it, it doesn't matter to you.
wonkey_monkey
15th January 2025, 21:20
Is there any way (for me, as a user) to speed up FFmpegSource audio seeking?
I'm opening some blu-ray rips (my own) with multiple DTS-MA/DTS tracks and I'm getting significant pauses, sometimes of several seconds, when jumping around in the video and hitting play in VirtuaDub2. It seems to be due to audio, because if I open the files without audio, or remove the audio track in Avisynth, the pauses disappear.
LSmashSource2 failed to open it; LibavSource2 worked and doesn't have any pauses. I've always used FFmpegSource up until now though, and it's quite a bit quicker to load initially.
Myrsloik
16th January 2025, 17:52
Is there any way (for me, as a user) to speed up FFmpegSource audio seeking?
I'm opening some blu-ray rips (my own) with multiple DTS-MA/DTS tracks and I'm getting significant pauses, sometimes of several seconds, when jumping around in the video and hitting play in VirtuaDub2. It seems to be due to audio, because if I open the files without audio, or remove the audio track in Avisynth, the pauses disappear.
LSmashSource2 failed to open it; LibavSource2 worked and doesn't have any pauses. I've always used FFmpegSource up until now though, and it's quite a bit quicker to load initially.
Not without extra steps, no. You can reencode the audio to flac and use either ffms2 or bestsource which will be fast.
But why are you even using this for latency sensitive previewing?
wonkey_monkey
16th January 2025, 19:00
But why are you even using this for latency sensitive previewing?
You make it sound like it's an unreasonable thing to do. It's not; LibavSource2 manages it just fine. I just thought there might be a way FFmpegSource could match it.
Edit: I don't think FFmpegSource is indexing audio properly in MKV files.
pintcat
26th January 2025, 20:47
I'd also love to see a 32bit version of this plugin since I'm forced to use a couple older programs which do support AVISynth, but are only availabe as 32bit/x86 making me stick to the older v2.40 of FFMS2.
rgr
30th January 2025, 09:51
FFMS2 (last version) can't open a file when the AviSynth script is encoded in e.g. CP-1250, not UTF.
The old version of FFMS2 (2390), LWLibavVideoSource and BestSource don't have this problem (but the latter has been indexing my file for a few minutes and there's no end in sight - but at least it works).
https://gcdnb.pbrd.co/images/36YfWpReI8mx.png?o=1
StvG
31st January 2025, 21:33
I don't know what you're referring by "newer version than r2390" but there is no newer version than r2390. The plugin from github and this from codeberg are different so they shouldn't be treated as just "older / newer".
tebasuna51
1st February 2025, 12:50
Of course are different versions, but your r2390 (https://codeberg.org/StvG/ffms2/releases/tag/r2390) is older (2020) than 5.0 (https://github.com/FFMS/ffms2/releases/tag/5.0) (2024) from Myrsloik.
The question is this file:
LoadPlugin("C:\Test\StvG\ffms2.dll")
FFVideoSource("C:\Ñu.mkv")
saved like ANSI or UTF8 (without BOM) work fine.
But using C:\Test\5.0\ffms2.dll only work saved as UTF8 (without BOM).
There are other differences (see the links and the ChaosKing tests #2617 and #2941) and select your preference.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.