Page 1 of 1

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Tue Apr 04, 2017 5:08 pm
by admin
It's in the binaries area called sparktank.rar. I supported all the video types. Let me know if it works and then I can slipstream it.

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Tue Apr 04, 2017 7:29 pm
by sparktank
Alright, it took a little bit to find clips.

For AVC and VC-1, it works perfectly!

Code: Select all

## VC1 source
LoadPlugin("D:\AVS\dgdecnv_test\DGDecodeNV.dll")
DGSource("G:\Clips\Inception\Inception-test.dgi", show=true)
ConvertToRGB32()

return ScriptClip("""(FFPICT_TYPE==3)
\         ? Last.ImageWriter("E:\Temp\Pics\Inception-3-", 
\                    start=current_frame, end=current_frame, type="png")
\         : Last""", 
\         after_frame=true)
^Giving me only screenshots of B frames in the VC-1 source.

Code: Select all

##AVC source
LoadPlugin("D:\AVS\dgdecnv_test\DGDecodeNV.dll")
DGSource("D:\MakeMKV\DARK_KNIGHT_TRILOGY_BONUS_DISC\00064.dgi", show=true)
ConvertToRGB32()

return ScriptClip("""(FFPICT_TYPE==5)
\         ? Last.ImageWriter("E:\Temp\Pics\TDK-", 
\                    start=current_frame, end=current_frame, type="png")
\         : Last""", 
\         after_frame=true)
^Giving me only screenshots of B frames in the AVC source.

Just trying to work out MPEG sourece, however.

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Tue Apr 04, 2017 7:58 pm
by admin
Don't worry, if it works for one it works for all. This is the first time I have set an Avisynth environment variable. ;)

Be aware that there can be some ambiguity if you have soft pulldown that you are honoring. FFMS returns 'U' for that. I return the type of the base frame, i.e., the coded frame whose field is not pulled down in the displayed frame. So be careful with soft pulldown. You're unlikely to want to select such frames for your PNGs, but I thought it was worth mentioning it.

Thank you, sparktank, for your suggestion and your testing. I'll slipstream it tomorrow.

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 5:58 am
by admin
Now I think I should use the character indicators 'I', 'P', and 'B' rather than the numbers, because the numbers are different for different video types. I'll do that before I slipstream it.

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 6:35 am
by hydra3333
admin wrote:set an Avisynth environment variable
Just checking on the off chance ... it won't break vapoursynth will it ? :)

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 7:24 am
by admin
I don't see why it would. You can test it for us. ;)

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 7:43 am
by sparktank
:bravo: :bravo: Awesome work!

Yeah, I thought about how it would work on DVD rips, so I'll definitely keep that in mind.


This will open up some new ways to look at things. I vaguely saw a script where you can return only I frames with scriptclip. It depended on FFMS2 largely, so I'll have to hammer it out to work for DGdecNV.

Thanks a bunch for this!

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 5:15 pm
by sparktank
:scratch: I wonder if it should be renamed to "DGPIC_TYPE" instead of "FFPIC_TYPE" for sake of clarity, in case someone has ffms2 in their auto-load plugin directory.

And maybe update the document? Those with sorcery skills can eventually start showing their work on the interwebs for more things to do with this.

So far, I am loving this function so much.
Already have over 4K images to siphon through for candidate wallpapers.

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 8:01 pm
by admin
I doubt the name matters because people won't be using FFMS2 and DGDecodeNV together.

There is an explanation at the start of the DGSource() section of the manual. Did you miss it or are you referring to something else?

Glad you like it and thanks for the suggestion.

Re: Any way to select specific frame types (ipb) only? (mostly AVC)

Posted: Wed Apr 05, 2017 8:51 pm
by sparktank
I did miss it. :oops:

That seems to be it. :D