1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Tool to mass remove x seconds of video at the beginning and y seconds at the end

Discussion in 'Video Production' started by lostinseo, Jul 21, 2018.

Tags:
  1. lostinseo

    lostinseo Newbie

    Joined:
    Jun 30, 2011
    Messages:
    17
    Likes Received:
    1
    Hey !

    Often videos have a beginning with an intro and sometimes with an outro.

    In a folder, I have 20, 30 or 100 videos from the same source. Videos have different lenght but intros and outros are always the same.

    I would need a tool capable of removing x seconds (x to be defined) at the beginning and y seconds (y to be defined) at the end.
    Also to do it in batch mode.

    I am ready to go command line if necessary.

    There is a tool in the blastersuite that can almost do it. Works for intros and mass editing.
    Problem is that it can cut the videos at the end also but you have to indicate cut at 10min 30 secondes for instance. And videos on the same model do never have the same length. I need to cut at (total time - 5 seconds) because the outro is always the same and has a duration of 5 seconds.

    Any tool available for this ?
     
    Last edited: Jul 21, 2018
  2. All you hab to do dear is to search for "ffmpeg" on google and maybe "cut" and you ready.
     
  3. lostinseo

    lostinseo Newbie

    Joined:
    Jun 30, 2011
    Messages:
    17
    Likes Received:
    1
    Thanks.

    I managed to do so using ffmpeg.
    All the files are in one folder, with one php script, i generate a bat file for cutting the files.

    I use getid3.php that allows to have information on video file.

    $getID3 = new getID3();
    $filename = $dir_nom . $fichier[$k];
    $fileinfo = $getID3->analyze($filename);

    $fin = $fileinfo['playtime_seconds'] - $end_offset;

    ffmpeg -i file.mp4 -ss $startoffset -to $fin -c copy out.mp4
     
    • Thanks Thanks x 1