Page 1 of 1

Video Processing v.1.0

Posted: 28 May 2015 14:26
by waqu
Extract frames video files in JPEG format with an interval of 1 second, to become familiar with the contents of the video. For a quick access to the desired frame using MPV player.

Code: Select all

"Extract Frame: 1 sec interval"
 foreach($token,<get SelectedItemsPathNames |>){
  $base=getpathcomponent($token,"base");
  runret("cmd /c mklink ""<xydrive>\SL\$base"" ""$token""");
  new("<xydrive>\Temp\$base","dir");
  $hh=0;
  $mm=0;
  $ss=0;
  while($hh<10){
   $r=0;
   $i++;
   if($i==15){
    $i=0;
    $r=2;
   }
   $hh=format($hh,"00");
   $mm=format($mm,"00");
   $ss=format($ss,"00");
   // run "<xydrive>\Bin\MPV\mpv.exe ""$token"" --no-sub --no-audio --start=$hh:$mm:$ss --vf=yadif,scale=0:0 --vo=image --frames=1 --o=""<xydrive>\Temp\$base\$hh'$mm'$ss.png""",,$r,0;
   run "<xydrive>\Bin\ffmpeg.exe -ss $hh:$mm:$ss -i ""$token"" -vframes 1 -y -f image2 -q:v 1 ""<xydrive>\Temp\$base\$hh'$mm'$ss.jpg""",,$r,0;
   if($r==2){
    $exist=exists("<xydrive>\Temp\$base\$hh'$mm'$ss.jpg");
    if($exist==0){
     sound "WindowsLogoff",,1;
     status "Done.";
     break;
    }
   }
   $ss++;
   if($ss==60){
    $mm++;
    $ss=0;
   }
   if($mm==60){
    $hh++;
    $mm=0;
   }
  }
 }
 sound "%SystemRoot%\media\tada.wav";
 status "Done!";

"Extract All Frame"
 new("I:\Temp\<curbase>. Frame","dir");
 run "<xydrive>\Bin\ffmpeg.exe -i ""<curitem>"" -q:v 1 ""I:\Temp\<curbase>. Frame\%d.jpg""";
Usage:
1. Need http://ffmpeg.zeranoe.com/builds/
2. Make folder: <xydrive>\Bin\ - place here ffmpeg.exe, <xydrive>\Temp\ - need for extracted image, <xydrive>\SL\ - need for symbolik link.
3. For playing preview need MPV player http://mpv.srsfckn.biz/mpv-x86_64-20150505.7z and file association:

Code: Select all

*'*.jpg>$name=getpathcomponent("<curitem>","parent"); $min=replacelist("<curbase>","'",":"); run """<xydrive>\Bin\MPV\mpv.exe"" ""<xydrive>\SL\$name"" --screenshot-template=""<curpath>\%wH'%wM'%wS.%wT"" --title=""$name"" --start=+$min";
mpv.exe and other files from archive mpv-x86_64-20150505.7z place in <xydrive>\Bin\MPV\

Re: Video Preview Maker v.1.0

Posted: 29 May 2015 02:30
by eil
need more description, at least what variables/pathes should be changed or where everything should be placed...