Old 05-14-2019, 05:59 AM   #41
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by X-Raym View Post
@dysrock
You will have to write your own functions, based on pixel difference from one frame to another... That why it just 'in theory'.

But there is no real advantage of having this in video processor : you will be limited by playback speed, while ffprobe (used in this script) can do way faster analysis.
Video processor method has been used to compare difference versions of same video to spot VFX changes.

https://forum.cockos.com/showthread.php?t=204568

I wonder if that process could also be made quicker using ffprobe/ffmpeg? Instead of comparing to last frame you comparing to another video. You could put markers where they differ.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 05-14-2019, 06:35 AM   #42
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,716
Default

Quote:
Originally Posted by X-Raym View Post
@dysrock
You will have to write your own functions, based on pixel difference from one frame to another... That why it just 'in theory'.


But there is no real advantage of having this in video processor : you will be limited by playback speed, while ffprobe (used in this script) can do way faster analysis.
Edit: moved this to https://forum.cockos.com/showthread.php?t=220900

Last edited by Justin; 05-14-2019 at 07:32 AM.
Justin is offline   Reply With Quote
Old 05-14-2019, 09:26 PM   #43
Sonorityscape
Human being with feelings
 
Sonorityscape's Avatar
 
Join Date: Aug 2016
Posts: 91
Default

Awesome work!

I was testing with a video that had a lot of bright flashing which was triggering the cuts, but I think generally it will save a good amount of time.
Sonorityscape is offline   Reply With Quote
Old 05-15-2019, 02:20 AM   #44
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

Quote:
Originally Posted by Sonorityscape View Post
Awesome work!

I was testing with a video that had a lot of bright flashing which was triggering the cuts, but I think generally it will save a good amount of time.
I wonder if the script should have a minimum time before next detection to help with this then?

Also, it's definitely a scene rather than shot detector but that's still very useful!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 05-17-2019, 08:53 PM   #45
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 564
Default

Quote:
Originally Posted by mrlimbic View Post
It's basically set to 40% of change in colour space since last frame. I could make that a tweakable parameter. For some videos it may not work well at all not matter what threshold you set. Fades will never work well I think.
I have a question about ffprobe. As you said, the script base on the detection of change in colour space. There are so many values in the result of -show_frames. So do you know which value does ffprobe actually comparing and tell their difference?

Last edited by dsyrock; 05-17-2019 at 10:36 PM.
dsyrock is offline   Reply With Quote
Old 05-26-2019, 12:40 PM   #46
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 508
Default

Awesome script. Thanks!!

So, what is exactly needed to add the thumbnails?
reapero is offline   Reply With Quote
Old 06-01-2019, 07:31 PM   #47
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default

I just tried this out for the first time and WOW! This is incredible. I've been wanting this for a looooong time.

What is the likelihood of some type of sensitivity threshold parameter settings being added? I just did detection for a 90min feature and it got most everything correctly, but maybe 10% of the film has scene cuts that FFProbe missed.
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 06-02-2019, 12:39 AM   #48
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by analogexplosions View Post
I just tried this out for the first time and WOW! This is incredible. I've been wanting this for a looooong time.

What is the likelihood of some type of sensitivity threshold parameter settings being added? I just did detection for a 90min feature and it got most everything correctly, but maybe 10% of the film has scene cuts that FFProbe missed.
Threshold is currently set to .4 (40%) but I could make it easier to change.

The relevant lines are 123 (mac) and 127 (windows) if you want to hack it.

Code:
-show_frames -of compact=p=0 -f lavfi 'movie=%s,select=gt(scene\\,.4)' > %s && mv %s %s &
the select=gt(scene\\,.4) part determines the threshold.

EDIT: You will also need to delete the scene cut list text file in the project folder to refresh the list.
__________________
Vordio - Post Production Toolkit
http://vordio.net

Last edited by mrlimbic; 06-02-2019 at 05:39 AM.
mrlimbic is offline   Reply With Quote
Old 06-02-2019, 10:19 PM   #49
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default

Quote:
Originally Posted by mrlimbic View Post
Threshold is currently set to .4 (40%) but I could make it easier to change.

The relevant lines are 123 (mac) and 127 (windows) if you want to hack it.

Code:
-show_frames -of compact=p=0 -f lavfi 'movie=%s,select=gt(scene\\,.4)' > %s && mv %s %s &
the select=gt(scene\\,.4) part determines the threshold.

EDIT: You will also need to delete the scene cut list text file in the project folder to refresh the list.

Hot.

I also have Nuendo, not sure what method they are using for its cut detection, but 70-80% seemed to be the sweet spot that caught everything.
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 05-27-2020, 07:17 PM   #50
PabloSorribes
Human being with feelings
 
Join Date: Oct 2019
Posts: 2
Default

Hey @mrlimbic, first off: This script is awesome! Good job!

Also, is there any ETA on Thumbnails for the analyzed video scenes? That's like the one feature I'm missing from working in Logic all those years ago.

Thanks for sharing these awesome workflow savers!
PabloSorribes is offline   Reply With Quote
Old 05-27-2020, 07:43 PM   #51
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by PabloSorribes View Post
Hey @mrlimbic, first off: This script is awesome! Good job!

Also, is there any ETA on Thumbnails for the analyzed video scenes? That's like the one feature I'm missing from working in Logic all those years ago.

Thanks for sharing these awesome workflow savers!
I did try but at the time it was not easily doable as thumbnails looked really strange due to scaling.

https://forum.cockos.com/showthread.php?t=216516

However since then a prefs option to scale better for thumbnail purposes has been added to reaper.

I don't have an ETA on any scripts as I can't work on that much at the moment. But I probably could update some scripts & FX after Vordio 6.0 is out (so hopefully not long).

I suspect for thumbnailing/preview like you'd see typically in an NLE you should probably cut evenly on time, not based on scene changes.

That might be better done with a different script.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 05-28-2020, 01:46 PM   #52
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I've added a script to do the thumbnail extraction: js_Video - Extract thumbnails of video items to empty, MIDI or video processor items


Last edited by juliansader; 12-18-2020 at 03:16 PM.
juliansader is offline   Reply With Quote
Old 05-28-2020, 01:59 PM   #53
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by juliansader View Post
That's great. Thanks. Do you put your scripts in Reapack so they are easier to install/update?
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 05-29-2020, 08:35 AM   #54
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by mrlimbic View Post
Do you put your scripts in Reapack so they are easier to install/update?
I do!
juliansader is offline   Reply With Quote
Old 05-29-2020, 09:08 AM   #55
dahya
Human being with feelings
 
Join Date: Oct 2019
Posts: 229
Default

Quote:
Originally Posted by mrlimbic View Post
Just released a free video scene detection script in the mrlimbic reapack repository.

It's called "mrlimbic_ffprobe scene detect.lua"...

http://vordio.net/wp-content/uploads...ect-Script.m4v
Many thanks for sharing @mrlimbic , it looks quite useful !
dahya is offline   Reply With Quote
Old 01-30-2021, 08:24 AM   #56
magrotten
Human being with feelings
 
Join Date: Jun 2020
Posts: 7
Default

Hey folks.

I've ben playing with MrLimbic's script and have found that 20% threshold gives great results, catching every cut without going too crazy during action sequences.

Happy to share the LUA if you wanna PM me..... thanks again to MrLimbic for putting this together!

Last edited by magrotten; 01-30-2021 at 08:57 AM.
magrotten is offline   Reply With Quote
Old 11-28-2021, 09:12 AM   #57
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

The script works for me wonderfully too. But little thing makes me sad - it cuts not by exact frames, it's close but not precisely, it cuts not further than a half of frame(tried with mp4 and dnxhd 25fps video). If it could be fixed somehow it would be very appreciated! Thanks a lot mrlimbic! I'll make a donation anyway, the most needed script in my post production work! And yes, value "2" is just perfect!
McSound is offline   Reply With Quote
Old 11-28-2021, 09:22 AM   #58
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by McSound View Post
The script works for me wonderfully too. But little thing makes me sad - it cuts not by exact frames, it's close but not precisely, it cuts not further than a half of frame. If it could be fixed somehow it would be very appreciated! Thanks a lot mrlimbic! I'll make a donation anyway, the most needed script in my post production work! And yes, value "2" is just perfect!
The script uses ffprobe to find the cuts. Unfortunately by default times are reported back in seconds. I think it only counts time per block of tramsport stream data not necessarily exact frames.

I'll see if it is possible to force times from exact frame counting instead. There may be filters/parameters that can do it more precisely.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 11-28-2021, 10:17 AM   #59
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

In that case the additional script that moves cuts to the nearest frame would be enough I think. If it's not very difficult for you - just tell me how much it would cost? I'll add this to my donation for scene detection script. I assure you it's important to me to have this script working the best way.

Also a side question to you as expert of ffmpeg: Is there any way to make Reaper plays video through Blackmagic Decklink card? I've tried some ways but unlucky.

Last edited by McSound; 11-28-2021 at 10:22 AM.
McSound is offline   Reply With Quote
Old 11-28-2021, 04:17 PM   #60
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by McSound View Post
Also a side question to you as expert of ffmpeg: Is there any way to make Reaper plays video through Blackmagic Decklink card? I've tried some ways but unlucky.
The devs are currently working on this in the pre-releases -- please check it out. I'm sure they would appreciate feedback about compatibility with different cards.
juliansader is offline   Reply With Quote
Old 11-29-2021, 04:08 AM   #61
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

Wonderful news! It can't believe it's happening! Could you give me the link to that, please? I've searched all prerelease threads but couldn't find info about blackmagic cards support (
McSound is offline   Reply With Quote
Old 11-29-2021, 04:20 PM   #62
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 587
Default

can't wait
permeke is offline   Reply With Quote
Old 11-30-2021, 02:45 AM   #63
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

mrlimbic: Sorry, but I've just added a line in your code

local cut = tonumber(cols["pkt_dts_time"]) - videoOffset -- your line
cut = reaper.BR_GetClosestGridDivision(cut) -- my new line

And instantly it cuts on exact frames. Done!
McSound is offline   Reply With Quote
Old 06-24-2022, 03:17 AM   #64
brkncd
Human being with feelings
 
Join Date: Apr 2022
Posts: 17
Default

This is a real life saver!
But when I try to run the script is says: C:\Users\Gian\Desktop\detect scenes.lua:155: attempt to call a nil value (field 'ULT_SetMediaItemNote')
brkncd is offline   Reply With Quote
Old 06-24-2022, 03:49 AM   #65
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by brkncd View Post
This is a real life saver!
But when I try to run the script is says: C:\Users\Gian\Desktop\detect scenes.lua:155: attempt to call a nil value (field 'ULT_SetMediaItemNote')
It requires SWS extensions installed. Is it?

Also just noticed this on SWS webpage which may have affected this script - "Deprecate ULT_GetMediaItemNote and ULT_SetMediaItemNote (use GetSetMediaItemInfo_String instead)"
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 06-24-2022, 03:49 AM   #66
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by McSound View Post
mrlimbic: Sorry, but I've just added a line in your code

local cut = tonumber(cols["pkt_dts_time"]) - videoOffset -- your line
cut = reaper.BR_GetClosestGridDivision(cut) -- my new line

And instantly it cuts on exact frames. Done!
Thanks. I'll add that to the script and push an update to reapack.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Old 06-24-2022, 09:59 PM   #67
brkncd
Human being with feelings
 
Join Date: Apr 2022
Posts: 17
Default

Quote:
Originally Posted by mrlimbic View Post
It requires SWS extensions installed. Is it?

Also just noticed this on SWS webpage which may have affected this script - "Deprecate ULT_GetMediaItemNote and ULT_SetMediaItemNote (use GetSetMediaItemInfo_String instead)"
Oh, I'm sorry, I thought I read all the messages and descriptions, but I think I've missed the part where it says that SWS extensions are required!
Now it works, but it creates an empty clips with no markers or scene splitting. Am I missing something else perhaps? Thank you so much
Attached Images
File Type: png Cattura.PNG (8.5 KB, 97 views)
brkncd is offline   Reply With Quote
Old 06-25-2022, 06:24 AM   #68
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

These empty clips are indeed scenes of video. Every clip is new video scene. What else? If you want your video be splitted by these items edges - there must be a script for that.

Oh, btw, I changed default detection parameter from 2 to 1 cause of better scene detection(when 2 some scenes change were skipped and considered as one scene). Though it had nasty habit of making 1 or 2 frame cut in the beginning of some new scenes. I solved it by inserting some code in the script that stops creating cuts if its length less than 2 frames. Works fast as a lightning! Thanks again mrlimbic for that wonderful script!
Just to compare - in Nuendo 11 video scene detection takes about 30-40 minutes for 90 minutes video. In Reaper the same video scene detection takes about 1,5 minutes with your script! Ha!

Last edited by McSound; 06-25-2022 at 06:44 AM.
McSound is offline   Reply With Quote
Old 06-27-2022, 12:03 PM   #69
brkncd
Human being with feelings
 
Join Date: Apr 2022
Posts: 17
Default

Quote:
Originally Posted by McSound View Post
These empty clips are indeed scenes of video. Every clip is new video scene. What else? If you want your video be splitted by these items edges - there must be a script for that.
The video is more than 2 mins long with many scenes and only one scene at the beginng of the video was cutted. Could it be an issue with the "threshold" the script has to determine when a scene is changed?

The video I tried is the following: https://www.youtube.com/watch?v=Nv9nUNw5OLY
brkncd is offline   Reply With Quote
Old 06-28-2022, 10:27 PM   #70
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

Maybe yes. You should try to change sensivity of scene difference(there's parameter in the script. It's 2 by default. Change it to 1 and try again) Btw your video is mostly of grey tones and the script based on color difference of scene detecting. Maybe that's the case of low detection.

mrlimbic, could ffmpeg have other scene detection ways than by color? Just for the cases like this?
McSound is offline   Reply With Quote
Old 06-29-2022, 01:15 AM   #71
brkncd
Human being with feelings
 
Join Date: Apr 2022
Posts: 17
Default

Quote:
Originally Posted by McSound View Post
Maybe yes. You should try to change sensivity of scene difference(there's parameter in the script. It's 2 by default. Change it to 1 and try again) Btw your video is mostly of grey tones and the script based on color difference of scene detecting. Maybe that's the case of low detection.

mrlimbic, could ffmpeg have other scene detection ways than by color? Just for the cases like this?
Thank you so much, I'll try tweak the script a bit. I hope I won't break anything, but I can't promise that
brkncd is offline   Reply With Quote
Old 06-30-2022, 12:25 PM   #72
McSound
Human being with feelings
 
McSound's Avatar
 
Join Date: Jun 2021
Location: Moscow, Russia
Posts: 278
Default

Look for this piece of code:
....local arguments = " -show_frames -of compact=p=0 -f lavfi 'movie=%s,select=gt(scene\\,.2)' > %s && mv %s %s &"
if windows then
file = file:gsub("", "/")
file = file:gsub(":", "\\:")
arguments = [[ -show_frames -of compact=p=0 -f lavfi "movie='%s',select=gt(scene\,.2)" > %s && move %s %s &]]....

Don't be afraid) Change these both two places of ",.2" in the script to ",.1"
McSound is offline   Reply With Quote
Old 07-05-2022, 02:24 AM   #73
brkncd
Human being with feelings
 
Join Date: Apr 2022
Posts: 17
Default

Quote:
Originally Posted by McSound View Post
Look for this piece of code:
....local arguments = " -show_frames -of compact=p=0 -f lavfi 'movie=%s,select=gt(scene\\,.2)' > %s && mv %s %s &"
if windows then
file = file:gsub("", "/")
file = file:gsub(":", "\\:")
arguments = [[ -show_frames -of compact=p=0 -f lavfi "movie='%s',select=gt(scene\,.2)" > %s && move %s %s &]]....

Don't be afraid) Change these both two places of ",.2" in the script to ",.1"
Thank you so much once again, very useful
brkncd is offline   Reply With Quote
Old 08-03-2022, 08:37 PM   #74
TobyAM
Human being with feelings
 
Join Date: Feb 2017
Location: Hollywood, CA
Posts: 125
Default

Quote:
Originally Posted by mrlimbic View Post
Thanks. I'll add that to the script and push an update to reapack.
I can't find this script on ReaPack, is it still available??
TobyAM is offline   Reply With Quote
Old 08-04-2022, 02:12 AM   #75
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by TobyAM View Post
I can't find this script on ReaPack, is it still available??
Did you import the repository?
https://github.com/mrlimbic/reascrip...ster/index.xml
From this page: https://reapack.com/repos
vitalker is offline   Reply With Quote
Old 08-04-2022, 02:57 PM   #76
TobyAM
Human being with feelings
 
Join Date: Feb 2017
Location: Hollywood, CA
Posts: 125
Default

Thanks, I didn't realize that was necessary, TIL.
TobyAM is offline   Reply With Quote
Old 08-11-2022, 02:06 AM   #77
brkncd
Human being with feelings
 
Join Date: Apr 2022
Posts: 17
Default

I would like to ask, has anyone ever tried to use the created .txt with the detected scenes in any cool way? Is it possible to use it for something?
brkncd is offline   Reply With Quote
Old 02-09-2023, 11:28 AM   #78
maxcomposer
Human being with feelings
 
Join Date: Jan 2020
Location: Canada
Posts: 84
Default

Quote:
Originally Posted by McSound View Post
Look for this piece of code:
....local arguments = " -show_frames -of compact=p=0 -f lavfi 'movie=%s,select=gt(scene\\,.2)' > %s && mv %s %s &"
if windows then
file = file:gsub("", "/")
file = file:gsub(":", "\\:")
arguments = [[ -show_frames -of compact=p=0 -f lavfi "movie='%s',select=gt(scene\,.2)" > %s && move %s %s &]]....

Don't be afraid) Change these both two places of ",.2" in the script to ",.1"


Heeeeeeeey!!! That worked like a charm!!!! I wish I could contribute and create a UI to tweak this parametere on the fly. Is there some ressouces some people could point out for someone who wants to start learning this? (Or I'll just ChatGPT it!)

I also want to thank you mrlimbic for Vordio 6 in general. Excellent tool that saved my a** recently.
maxcomposer is offline   Reply With Quote
Old 09-05-2023, 04:20 AM   #79
Thomas Richard
Human being with feelings
 
Join Date: Sep 2021
Posts: 4
Default

Hi there
I do post in reaper, and would love to have a tool like this !

Bur when i run it I only get one file ( no cuts ) :-(
any ideas ?

thanks

Last edited by Thomas Richard; 09-05-2023 at 04:36 AM.
Thomas Richard is offline   Reply With Quote
Old 09-06-2023, 04:34 AM   #80
mrlimbic
Human being with feelings
 
mrlimbic's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 669
Default

Quote:
Originally Posted by Thomas Richard View Post
Hi there
I do post in reaper, and would love to have a tool like this !

Bur when i run it I only get one file ( no cuts ) :-(
any ideas ?

thanks
One file? It doesn't cut the file just creates empty items. Do you mean one long item/clip?

If so then sensitivity is wrong. It detects cuts based on % change between frames. So things like video crossfades won't be detected because change is not much. What kind of video is it?

You can change sensitivity using tip above.
__________________
Vordio - Post Production Toolkit
http://vordio.net
mrlimbic is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.