Skip to main content
Participating Frequently
January 20, 2022
Resuelto

How to automatically remove scenes when nothing happens

  • January 20, 2022
  • 4 respuestas
  • 5608 visualizaciones

Hi! I am working a lot with painting footage in which the brush leaves the scene and the clip just shows the painting and nothing happens in the frame. I was wondering if there is an automated tool that can detect frames where nothing happens - no movement - and extract or mark these parts on the clip for me. 

Until now I have been editing those manually out and with footage that is up to 12 hours long it takes a really long time. Does any of you know if there's a workaround, tool or extension that can do such thing?

Many thanks in advance!

 

 

 

Mejor respuesta de basil1891

Wow! @basil1891 ! This script is so amazing! It literally works like magic! I am gonna try this now out with some other footage but I wanted to ask you if there is any way for me to put multiple clips on the bat file and see how long it will take them to render? So I could maybe dump 50 files on the bat overnight and then get a info showing me it takes like 5 hours or something? Is this possible?

 

 


Glad to hear it worked eventually :).
As to how long it will take, you can only assess it roughly. Assuming all of your videos are of the same resolution, you can remember the speed while processing some typical clip (see attachment), and then just divide total duration in minutes (for all clips in a batch) at that 'speed' value.

4 respuestas

Inspiring
January 20, 2022

There are some 3rd party tools that is able to remove frame duplicates. While their original intent was not for your case, it may work. Below is a sample of a batch-script configured for removing non-exactly dublicate (but very close to) frames:
1) you put it along with the ffmpeg.exe in some folder
2) create a shortcut to the bat-file on a desktop
3) drop your file on the shortcut
4) after encoding is finished check the folder 'NoStaticScenes'
Later in Premiere you have to change it's FPS to some std value (via interpret footage). This method should work, assuming you don't use audio track from the video in question.

 

 

@4628292 off
TITLE %~nx0
SETLOCAL ENABLEEXTENSIONS
set t0=%TIME%, %DATE%

for %%F in (%*) do call :main %%F
goto finalmessage

:main
 SetLocal
  echo -----------------------------------------------------------------------------------
  echo. Processing file: %~f1
  echo.
  set "newdir=NoStaticScenes"
  if not exist "%~dp1\%newdir%" mkdir "%~dp1\%newdir%"

  rem [ cmf: -1=auto, 1=bt709, 6=bt601, 9=bt2020 ]
:: set "cmf=-1"
:: set "bsf=-bsf:v h264_metadata=colour_primaries=%cmf%:transfer_characteristics=%cmf%:matrix_coefficients=%cmf%"

  ffmpeg.exe -y -i "%~f1" -vf mpdecimate=hi=64*30:lo=64*15:frac=0.1 -vsync vfr -pix_fmt yuv420p -c:v libx264 -crf 18 -preset veryfast -x264-params ref=1:bframes=0:keyint=15:min-keyint=1:qcomp=0.7:no-dct-decimate=1 -c:a copy -map 0:v:0 -map 0:a? "%~dp1\%newdir%\%~nx1 [nostats].mov"

 EndLocal
 goto :eof

:finalmessage
powershell write-host -fore cyan  ======================== Processing is FINISHED =========================
echo ----------------------------
echo Batch processing start time: %t0%
echo Batch processing end time:   %TIME%, %DATE%
echo ----------------------------
pause

 

 

Participating Frequently
January 21, 2022

Thank you, Basil for the Script! I'm gonna try these things out and let you guys know if any of that works! 💫

Kevin-Monahan
Community Manager
Community Manager
January 24, 2022

Looking forward to hearing back from you so we can mark one of these solutions as the correct one. Good luck!

 

Kevin

Kevin Monahan - Sr. Community & Engagement Strategist – Pro Video and Audio
chrisw44157881
Inspiring
January 20, 2022

if you set scene detection threshhold low, any scene detection plugin should work. free shutter encoder has a scene detect feature that exports out a XML of edit points, then just remove the clips in the middle.

 

some other options are resolve's scene detection, aescripts magnum 3 or rough cut. I even rolled my in AE for fun with transfer modes and a bit of trickery with pixel sampling, pretty fun. I'm actually surprised Premiere doesn't have a native function for this, its relatively simple to make.

Participating Frequently
January 21, 2022

Thank you, Chris! I haven't worked with AE yet, but i will try out a scene detection Plugin for Premier! !!

Peru Bob
Community Expert
January 20, 2022

Some folks say the tool to use is called "intern."

Just joking - no disrespect intended. 

Jeff Bugbee
Community Expert
January 20, 2022

Premiere does not have any native functionality to detect movement/motion. You'd need to use a third party plugin. I personally do not know of any that include this sort of (lack of) motion detection.