Log in

View Full Version : FFMS2000 - The experimental future of FFMS2


Pages : 1 2 [3] 4 5

Myrsloik
16th July 2017, 17:17
I knew it was coming. ;)

Exactly how are you using it? What's the simplest script to reproduce?

stax76
16th July 2017, 18:52
FFVideoSource("file")

Only opening and closing avs+ in VirtualDub x64.

burfadel
16th July 2017, 19:05
It isn't releasing memory when a project is closed and another one is loaded in the same instance.

lansing
27th August 2017, 04:01
How do I dump the keyframe to a text file?

Atak_Snajpera
27th August 2017, 13:54
ffmsindex.exe -k input.mkv

StainlessS
27th August 2017, 14:58
How do I dump the keyframe to a text file?

ffmsindex.exe -k input.mkv

I could not get above to work, "ffmsindex.exe is not a valid Win32 application". (on XP32, EDIT: In alert box)
[EDIT: Followed by "Access is Denied" in command line]

Maybe I did something wrong.

but this works from within avs script


# From InitExternalPlugins.avsi in Plugins"
#fn4= "C:\Program Files\AviSynth\plugins\FFMS2000_CPP\ffms2_26.dll" # FFMpegSource CPP Plugin
#Exist(fn4) ? LoadPlugin(fn4) : NOP

VNAM = ".\test.mpg"
FRAMES = ".\Frames.txt"
WRITETYPE = "I" # Write I Frames, for types see http://avisynth.nl/index.php/FFmpegSource
###
WRITE = (FRAMES!="")
FRAMES = (WRITE) ? RT_GetFullPathName(FRAMES) : ""
VNAM = RT_GetFullPathName(VNAM)

(WRITE) ? RT_FileDelete(FRAMES) : NOP

FFIndex(VNAM)
FFVideoSource(VNAM)

ScriptClip("""
Type=Chr(FFPICT_TYPE)
(WRITE && TYPE==WRITETYPE) ? RT_WriteFile(FRAMES,"%d",current_frame,Append=True) : NOP
RT_Subtitle("FrameNumber: %d of %d\nPicture Type: %s",current_frame,FrameCount,Type)
""",after_frame=true)


EDIT: And writing frame types to an RT_Stats DBase:- http://forum.doom9.org/showthread.php?p=1775515#post1775515

Groucho2004
27th August 2017, 15:14
I could not get above to work, "ffmsindex.exe is not a valid Win32 application". (on XP32)
That error usually indicates that the binary was built with VC2015/17 without the XP compatibility switches or you're using the 64 bit version.

StainlessS
27th August 2017, 15:35
ffmsindex.exe references Kernel32.dll, so I assume is 32 bit.

Also get in DependencyWalker, "FFMS2.DLL, Error opening file. The system cannot find the file specified (2)".
Although dll is in same directory as both exe and command line.
But clicking on the dll error line within DW, brings up the DW report on the dll (so it does find it).

Does not really matter, I dont need it working, thanx G2K4.

Groucho2004
27th August 2017, 15:45
ffmsindex.exe references Kernel32.dll, so I assume is 32 bit.On Win64 it's also kernel32.dll (system32, not syswow64).

StainlessS
27th August 2017, 15:56
I was using old (probably supplied with W2K setup disks) version of Dependency Walker, just downed v2.2 latest:- http://www.dependencywalker.com/
for both x86 and x64, loaded ffmsindex.exe into the DW 32 bit,
"Error: At least one required implicit or forwarded dependency was not found."
Down to not being able to find the dll again.

Loaded 64bit DW into 32bit DW, and got

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

So, looks like missing XP compiler switches.

Groucho2004
27th August 2017, 16:02
Loaded 64bit DW into 32bit DW:confused:

StainlessS
27th August 2017, 16:05
Just a test to see if 64bit exe gave additional error messages about CPU, which it did (but additional not present for ffmsindex.exe, so assume is 32bit).

EDIT: Maybe a wrong assumption.

EDIT: Loading 32bit DW into 32bit DW,
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

No CPU warnings.

TheFluff
27th August 2017, 17:36
I have some foggy memory telling me that there's some LoadLibrary path customization thing that doesn't work on XP. Clearly you should just put everything into system32.

StainlessS
27th August 2017, 18:02
Just tried copying the ffmsindex.exe and ffms2_26.dl to system32, and repeat

ffmsindex.exe -k test.mpg

Same result, "ffmsindex.exe is not a valid Win32 application".

Thanx anyway Fluffy, but not of any great necessity for me, I've never attempted (prior to today) to use ffmsindex.exe on its own.

Groucho2004
27th August 2017, 18:08
I have some foggy memory telling me that there's some LoadLibrary path customization thing that doesn't work on XP. Clearly you should just put everything into system32.
LoadLibraryEx() (https://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx) does support some flags that are not supported on XP/Server 2003. Without seeing the code we can of course only assume that this may be the problem.

lansing
28th August 2017, 03:06
Must be a broken mkv/ffmpeg bug. The parser really does report all the frames as keyframes. I'll poke it a bit more but definitely not my fault.

Any update on this issue? I have the same problem with a m2ts file, it's reporting keyframe every 24 frames. If it's a bug, where do I report it?

george84
19th September 2017, 14:24
Test5 and Test6 from first post not found on dropbox

Atak_Snajpera
19th September 2017, 20:33
Any update on this issue? I have the same problem with a m2ts file, it's reporting keyframe every 24 frames. If it's a bug, where do I report it?

What happens if you remux .m2ts to .mkv using eac3to?

Myrsloik
20th September 2017, 11:13
Download link fixed. No idea why dropbox decided to break it.

Atak_Snajpera
20th September 2017, 17:57
Does anybody know why ffms duplicates frames in Interlaced h.264 streams using Separated fields as store method?

video-Duplicated-frames.mkv
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings, CABAC : Yes
Format settings, RefFrames : 2 frames
Format settings, GOP : M=2, N=13
Muxing mode : Container profile=@0.0
Codec ID : V_MPEG4/ISO/AVC
Duration : 33 s 160 ms
Bit rate mode : Variable
Bit rate : 20.8 Mb/s
Maximum bit rate : 22.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Separated fields
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.400
Stream size : 82.0 MiB (98%)
Default : No
Forced : No


video-no-duplicated-frames.mkv
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4
Format settings, CABAC : Yes
Format settings, RefFrames : 2 frames
Format settings, picture structure : Frame
Muxing mode : Container profile=@0.0
Codec ID : V_MPEG4/ISO/AVC
Duration : 22 s 720 ms
Bit rate : 11.7 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Interleaved fields
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.226
Stream size : 31.7 MiB (98%)
Default : No
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709



https://www.mediafire.com/file/1o0bjcd9vlnoio1/FFMS%20bug.7z
Open video-Duplicated-frames.avs and video-no-duplicated-frames.avs in 32 bit MPC-HC and use combination CTRL+arrows to see what I mean.

Myrsloik
20th September 2017, 18:14
Hint: look at the known issues

stax76
20th September 2017, 18:47
I've reported this some years ago, my workaround:


Dim miFPS = MediaInfo.GetFrameRate(p.FirstOriginalSourceFile)
Dim avsFPS = p.SourceScript.GetFramerate

If (CInt(miFPS) * 2) = CInt(avsFPS) Then
Dim src = p.Script.GetFilter("Source")
src.Script = src.Script + BR + "SelectEven().AssumeFPS(" & miFPS.ToInvariantString + ")"
p.SourceScript.Synchronize()
End If

Atak_Snajpera
20th September 2017, 19:20
Yes I do the same if mediainfo reports Separated Fields.

hello_hello
5th October 2017, 17:57
Does anybody know why ffms duplicates frames in Interlaced h.264 streams using Separated fields as store method?

I wonder if that relates to the problem with enabling "rffmode" I've been experiencing.

I was fiddling around with the old FFMpegsource2 script (changing the function name to avoid conflicts) in order to enable audio by default, and I also set rffmode=1 as the default, but I discovered for progressive h264 it causes ffms2/ffms2000 to output half the source frame rate. For the sources I tested, Info() said the frame rate was 24000/2002 instead of 24000/1001 (with one exception where it reported 1.#inf (1/0) as the frame rate).
rffmode=0 fixed the problem.

hello_hello
5th October 2017, 18:06
While I'm here, although I probably don't care anyway, was the utf8=true/false argument removed from this version of ffindex/ffms2 for a reason? Just curious...

Cheers.

Myrsloik
5th October 2017, 18:07
While I'm here, although I probably don't care anyway, was the utf8=true/false argument removed from this version of ffindex/ffms2 for a reason? Just curious...

Cheers.

Yes, it was removed.

burfadel
5th October 2017, 19:33
Any new test versions? The test 6 is approaching 7 months old and I see there have been multiple commits :)

Myrsloik
6th October 2017, 10:54
Any new test versions? The test 6 is approaching 7 months old and I see there have been multiple commits :)

I guess I'll make one in a bit. Should have lots of interesting new bugs to find as well by now...

burfadel
6th October 2017, 11:10
Happy to test :)!

stax76
6th October 2017, 22:18
Me too, especially file extensions h264, h265 and ts.

kypec
7th October 2017, 06:16
I have been using FFMS2000 in VapourSynth until I found out recently that it is not reliable for MKV sources (https://forum.doom9.org/showthread.php?p=1820545#post1820545). :(
Luckily, L-SMASH replacement proved to be 100% deterministic so that's what I'm going to use further.

Atak_Snajpera
10th October 2017, 16:01
The only huge problem for me with newer versions of FFMS is broken seeking on VC-1 (each frame is detected as keyframe?!)

Myrsloik
23rd October 2017, 13:05
New build

Atak_Snajpera
30th October 2017, 12:53
Great! This version fixes crashing on some .aac audio files!

burfadel
30th October 2017, 16:16
Has worked so far here great as well!

AKBabel
29th November 2017, 17:50
Hi to all,
I am new here, but I have used avisynth for a couple of years now and coded some filters for it.
So in the past it was possible to load DPX image files (10Bit per channel) into avisynth via FFImageSource, that doesn’t work anymore with FFMS2000 and avisynth+.
I have tried to load them via FFVideoSource and that works, but the output is RGB32 instead of RGBP10 or other higher bit depth formats.
Also FFMS2000 seems not to support DNG files.
Is it possible to find some solutions for this problems?

Myrsloik
30th November 2017, 14:06
Hi to all,
I am new here, but I have used avisynth for a couple of years now and coded some filters for it.
So in the past it was possible to load DPX image files (10Bit per channel) into avisynth via FFImageSource, that doesn’t work anymore with FFMS2000 and avisynth+.
I have tried to load them via FFVideoSource and that works, but the output is RGB32 instead of RGBP10 or other higher bit depth formats.
Also FFMS2000 seems not to support DNG files.
Is it possible to find some solutions for this problems?

Loading dpx should work. Can I have a simple file? Which is the most recent FFMS2 version where it worked?

Did DNG ever work in any FFMS2 version?

AKBabel
30th November 2017, 15:51
I have tried to open the DPX files directly in VirtualDub Mod, it seems to work, they are interpreted as RGBA64.
If I encode them as ffv1 in mkv container, I can load that mkv into VirtualDub, same result RGBA64.
But when I open the DPX files through FFMS2000 they are interpreted as RGB32.
Here is a file: https://www.file-upload.net/download-12842158/NEH183trim2_0974533.DPX.html

I'll try to found out, which version it was, that could open them via FFImageSource().

Did DNG ever work in any FFMS2 version?No, DNG was never supported by FFmpeg. I found that out recently.
I still hope that it may happen too.

AKBabel
30th November 2017, 16:44
Loading dpx should work. Can I have a simple file? Which is the most recent FFMS2 version where it worked?
I have checked.
The version where FFImageSource could open DPX is 2.17.0.0 (obviously it returns RGB32).
When trying to open DPX with FFImageSource from FFMS2000, it returns the Error:
FFVideoSource does not have a named argument ''utf8''

Myrsloik
30th November 2017, 16:45
I have tried to open the DPX files directly in VirtualDub Mod, it seems to work, they are interpreted as RGBA64.
If I encode them as ffv1 in mkv container, I can load that mkv into VirtualDub, same result RGBA64.
But when I open the DPX files through FFMS2000 they are interpreted as RGB32.
Here is a file: https://www.file-upload.net/download-12842158/NEH183trim2_0974533.DPX.html

I'll try to found out, which version it was, that could open them via FFImageSource().

No, DNG was never supported by FFmpeg. I found that out recently.
I still hope that it may happen too.

You didn't update ffms2.avsi. The utf8 argument was removed.

18fps
30th November 2017, 17:58
I have checked.
The version where FFImageSource could open DPX is 2.17.0.0 (obviously it returns RGB32).
A single DPX image or a DPX images sequence?

AKBabel
4th December 2017, 20:02
You didn't update ffms2.avsi. The utf8 argument was removed.
Now I have done that. So it works with FFImageSource now, but the result is still RGB32.
A single DPX image or a DPX images sequence?
It is a sequence but I use a GScript to load them via FFImageSource.

poisondeathray
5th December 2017, 02:51
@AKBabel -
In the meantime, you could use FFMS2 in vapoursynth which supports RGB30 and image sequences with python , or imagemagick plugin for vapoursynth which will return RGB float

Since FFMS2 in vpy supports it properly , and avisynth+ supports "RGBP10" , I suspect it should be possible

PS. can you post your GScript image sequence loader script ? How is the performance / seeking latency ?

lansing
6th December 2017, 03:40
With the test7 version, I have a animation vob file that was being auto ivtced to 23.976fps on load, but other similar vobs were unaltered. Issue exist in both avs+ and vapoursynth.

ffms2('sample.vob')

Myrsloik
6th December 2017, 08:48
With the test7 version, I have a animation vob file that was being auto ivtced to 23.976fps on load, but other similar vobs were unaltered. Issue exist in both avs+ and vapoursynth.

ffms2('sample.vob')

See rff handling and soft telecine

AKBabel
6th December 2017, 09:28
PS. can you post your GScript image sequence loader script ? How is the performance / seeking latency ?

This is the script:
inf=FFImageSource(dir+filename+String(startframe, lcdigits)+filetype)
v_width = inf.Width
v_height = inf.Height
v_type = inf.PixelType
video = BlankClip((endframe-startframe), v_width, v_height, pixel_type=v_type).KillAudio()
video = video.ScriptClip("""FFImageSource(String(current_frame+startframe, dir+filename+lcdigits)+filetype)""")

It is really slow. I guess there are better options, but I only had to deal with short sequences until now. So if you have tips, please tell me.

lansing
6th December 2017, 16:22
See rff handling and soft telecine
##### int rffmode = 0

- **0**: Ignore all flags (the default mode).
- **1**: Honor all pulldown flags.
- **2**: Equivalent to DVD2AVI's "force film" mode.
It was already default to 0, but it still ivtc my video. Setting it to 1 would ignore the flag instead. Is it the problem with the dvd itself?

TheFluff
6th December 2017, 21:29
##### int rffmode = 0

- **0**: Ignore all flags (the default mode).
- **1**: Honor all pulldown flags.
- **2**: Equivalent to DVD2AVI's "force film" mode.
It was already default to 0, but it still ivtc my video. Setting it to 1 would ignore the flag instead. Is it the problem with the dvd itself?

There is no problem, it's doing exactly what the manual says its supposed to be doing, you just got the meaning of "ignore pulldown flags" backwards. Soft telecined DVD's using RFF flags ("pulldown flags") only have 23.976 coded progressive pictures per second in the stream. An analog NTSC TV can't play 23.976fps progressive so the player telecines on-the-fly on playback by outputting some fields twice. Which fields it repeats is controlled by the "repeat field flag", RFF - each frame has a flag that can say repeat top or repeat bottom field. FFMS2 defaults to ignoring these flags (that is, it doesn't duplicate fields) and showing you the coded progressive frames only. If you want to load the VOB in telecined form (sometimes desirable if it's hybrid material and you want to do IVTC with postprocessing yourself) you tell it to honor the RFF flags.

Most DVD's are hard telecined and actually have 29.97 coded fields per second instead, but no RFF flags so there's nothing to ignore.

Atak_Snajpera
8th December 2017, 11:26
Would be possible to have those options available in ffms2 for HDR to SDR conversion?
https://ffmpeg.org/ffmpeg-filters.html#tonemap

Myrsloik
8th December 2017, 13:31
Would be possible to have those options available in ffms2 for HDR to SDR conversion?
https://ffmpeg.org/ffmpeg-filters.html#tonemap

No, that's format conversion and not decoding. If you read the fine print you realize it's a wrapper for zimg.