Need simple video editor to crop beg/end of video

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
earthlingkc
Level 3
Level 3
Posts: 110
Joined: Fri Oct 14, 2016 2:22 pm

Need simple video editor to crop beg/end of video

Post by earthlingkc » Sat Jan 07, 2017 11:12 am

I'm looking for a simple video editor that chops off beginning/end of a video and that's it. Would be nice to save in various codecs but keeping original format is fine. I've tried a few but too many steps to do this task. Have many to do, if it can be via CLI, scripting it even better as I want to chop off same amount of time on every video.

User avatar
chrisuk
Level 5
Level 5
Posts: 593
Joined: Thu Jun 12, 2008 6:16 am

Re: Need simple video editor to crop beg/end of video

Post by chrisuk » Sat Jan 07, 2017 12:47 pm

You can use the trim filter] with ffmpeg, it's in the repositories (or already installed)
Chris

Manjaro MATE - MX Linux - LMDE MATE

User avatar
Flemur
Level 17
Level 17
Posts: 7388
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Need simple video editor to crop beg/end of video

Post by Flemur » Sat Jan 07, 2017 12:53 pm

earthlingkc wrote:I'm looking for a simple video editor that chops off beginning/end of a video and that's it. Would be nice to save in various codecs but keeping original format is fine.
avidemux can do that, has a simple effective GUI and can copy w/o re-encoding (any frame for some formats, at key frames for other*). Unfortunately...often the audio is out of sync.
https://www.avidemux.org/admWiki/doku.p ... ng:cutting
I've tried a few but too many steps to do this task. Have many to do, if it can be via CLI, scripting it even better as I want to chop off same amount of time on every video.
ffmpeg (avconv) can do it, but the syntax is sometimes pretty funky. google some stuff like this (and avconv instead of ffmpeg):
linux ffmpeg clip
linux ffmpeg trim video without reencoding
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
racer-x
Level 4
Level 4
Posts: 323
Joined: Sun Oct 02, 2016 9:05 am
Location: Area 51

Re: Need simple video editor to crop beg/end of video

Post by racer-x » Sat Jan 07, 2017 4:52 pm

ffmpeg is definitely the way to go here. But for those that don't like commandline encoding/trimming, here is another alternative. Install winff from the depository or terminal with this command:

Code: Select all

sudo get install winff


You'll need to either re-boot or log off and back on to use it. Now copy and paste this code into your text editor and save as "preset.xml".

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<presets>
  <WavStereo>
    <label>Wav for dvd</label>
    <params>-vn -ar 48000</params>
    <extension>wav</extension>
    <category>Audio</category>
  </WavStereo>
  <ac3dvd256>
    <label>Ac3 DVD - 256kbps Stereo</label>
    <params>-f ac3 -acodec ac3 -b:a 256k -ar 48000 -ac 2</params>
    <extension>ac3</extension>
    <category>Audio</category>
  </ac3dvd256>
  <ac3dvd384>
    <label>Ac3 DVD - 384kbps Stereo</label>
    <params>-f ac3 -acodec ac3 -b:a 384k -ar 48000 -ac 2</params>
    <extension>ac3</extension>
    <category>Audio</category>
  </ac3dvd384>
  <wma>
    <label>WMA</label>
    <params>-vn -acodec wmav2 -b:a 190k -ac 2</params>
    <extension>wma</extension>
    <category>Audio</category>
  </wma>
  <HQavc>
    <label>HQ AVC</label>
    <params>-c:v libx264 -level 41 -pix_fmt yuv420p -preset medium -crf 20 -bufsize 15000k -maxrate 30000k -g 24 -threads 8 -c:a aac -strict experimental -ar 48000 -ab 256k -f mp4</params>
    <extension>mp4</extension>
    <category>AVC</category>
  </HQavc>
  <HEVC>
    <label>HEVC - mp4</label>
    <params>-c:v libx265 -aspect 16:9 -pix_fmt yuv420p -preset medium -x265-params crf=25 -c:a aac -strict experimental -ar 48000 -ab 128k -f mp4</params>
    <extension>mp4</extension>
    <category>HEVC</category>
  </HEVC>
  <WebVideo>
    <label>Web Video - AVC</label>
    <params>-c:v libx264 -level 40 -pix_fmt yuv420p -preset slow -crf 22 -threads 8 -c:a aac -strict experimental -ar 48000 -ab 128k -f mp4</params>
    <extension>mp4</extension>
    <category>AVC</category>
  </WebVideo>
  <VP9>
    <label>VP9 webm</label>
    <params>-c:v libvpx-vp9 -pix_fmt yuv420p -qmin 0 -qmax 50 -crf 5 -b:v 5M -threads 8 -c:a libvorbis -b:a 128k -f webm</params>
    <extension>webm</extension>
    <category>webm</category>
  </VP9>
  <AGIF>
    <label>Animated GIF</label>
    <params>-vf scale=640:-1:sws_dither=a_dither -pix_fmt rgb8 -loop 0 -an</params>
    <extension>gif</extension>
    <category>Animation</category>
  </AGIF>
  <APNG>
    <label>Animated PNG RGBA</label>
    <params>-f mov -c:v png -pix_fmt rgba -movflags faststart -an</params>
    <extension>mov</extension>
    <category>Animation</category>
  </APNG>
  <muxmp4>
    <label>Mux mp4</label>
    <params>-c:v copy -c:a copy -f mp4</params>
    <extension>mp4</extension>
    <category>Mux</category>
  </muxmp4>
  <muxmkv>
    <label>Mux mkv</label>
    <params>-c:v copy -c:a copy</params>
    <extension>mkv</extension>
    <category>Mux</category>
  </muxmkv>
  <muxts>
    <label>Mux Mpeg-TS</label>
    <params>-c:v copy -c:a copy -f mpegts</params>
    <extension>ts</extension>
    <category>Mux</category>
  </muxts>
  <muxmov>
    <label>Mux MOV</label>
    <params>-c:v copy -c:a copy -f mov</params>
    <extension>mov</extension>
    <category>Mux</category>
  </muxmov>
</presets>
Then put it in place of the "preset.xml" found in Home/User/.winff (you'll need to enable hidden files via Ctrl+H). Select preset "Mux" and whatever format you need. This will stream copy, so no re-encoding will be done. It will be very fast.....

Image

The above example will trim off the first 30 seconds of each clip.

User avatar
phd21
Level 19
Level 19
Posts: 9516
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Need simple video editor to crop beg/end of video

Post by phd21 » Sat Jan 07, 2017 5:57 pm

Hi "earthlingkc",

I just read your post and the good replies to it. Here are my thoughts on this as well.

It would help to know more about your system setup. If you run "inxi -Fxzd" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.

Most of the good video editors can easily do this without altering the original file. The excellent "Kdenlive" video editor can easily do this as well. If you are not using Linux Mint KDE, you might want to install the "kde-runtime" as well which is perfectly safe to do in any edition of Linux Mint.

With "Kdenlive", you start it, pick a resolution (you can use the same as the original video or change it), then add your video clip to the project, you will usually be asked to change the default profile (output) format to match the video clip or choose another, then click the video clip on the left to highlight it, and on the right side is the "clip monitor" where you can click play and mark the beginning point (zone start) of the clip you want to save (excluding the beginning part you do not want), click towards the end of the video clip's timeline to jump to the end, go forward or backwards if need be, then mark then ending point (zone end) excluding the ending part you do not want, then click your mouse and hold it down in the "clip monitor" and drag it to a project time line below, move it with your mouse to the far left if it is not already, then click "Render" to render the video into various video formats that you can choose from the drop down list box. Rendering usually takes awhile depending upon your computer hardware.

Another option is to choose an application (like "tsMuxeR Gui" (Super fast) , "WinFF" as suggested by "racer-x", "MKVToolNix Gui" (Fast), etc...) to "split" or "Cut" (crop or trim) the video file in various ways which can be much faster, if you do not need to convert (transcode), or render, the video into another video format. If you know the starting time and ending time to keep, or to exclude, or a starting time (excluding the beginning portion you do not want) and duration (length of video - excluding the ending part of the video you do not want), etc... There are various options. Here is a good link below on this topic.

I want to chop up a big MPEG-4 video into smaller chunks
viewtopic.php?f=47&t=236441&hilit=tsmuxer

For instance using "tsMuxeR GUI", add the video and wait until it appears, click "M2TS muxing", click the "Split & Cut" tab, under "Cutting", select a start time of like "10 seconds" to remove the part in the beginning you do not want, and the end time is the length of time of the video without (minus) the portion at the end of the video you do not want to keep, click start muxing, click ok. Just rename the final video from "something.m2ts" to "something.mp4", and you are done with that video. Took around a minute on a 1.5gb video file to do this.

It may take a little practice. You can use almost any good multimedia player to view and determine the times you will need for the start and ending time values, and or duration time, in these programs. In the screenshots below, when I add the video, it shows the run time length of the video. In the example below the total video run time is 42min 33.9 (34) secs., so if I wanted to start 21 seconds into the video (trim the beginning), subtract 21 seconds from 42min34 sec resulting in 42min 13 secs and if I wanted to exclude the last 3min of the video (trim the end), then the total time I want to keep is 39 minutes (42 min -3 min), so for "tsMuxeR" the start time is 21 seconds, and the end time is 39 minutes 13 secs (give or take a few seconds).

Hope this helps ...
txMuxeR_GUI_VideoTrimming1_copy.jpg
txMuxeR_GUI_VideoTrimming2_copy.jpg
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, 256gb SDD, only Intel 4 Graphics. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
phd21
Level 19
Level 19
Posts: 9516
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Need simple video editor to crop beg/end of video

Post by phd21 » Sun Jan 22, 2017 2:51 pm

Hi "earthlingkc",

This just showed up in my email, and I thought I would share it with you and everyone else. I tried it and it is super simple to use, very fast, just works really well. Just add your video, click play, click the start marker button (set clip start marker) where you want the new video to start, drag the bar in the playing timeline towards the end of the video to mark the end of the clip (set clip end marker), click save. It uses the same video format as the original video, so it is quick because there is no conversion (transcoding) involved.

VidCutter - simple video editing application
https://mintguide.org/video/733-vidcutt ... ation.html

Hope this helps ...
VidCutter1.jpg
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, 256gb SDD, only Intel 4 Graphics. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
InkKnife
Level 5
Level 5
Posts: 728
Joined: Mon Apr 30, 2012 5:24 pm

Re: Need simple video editor to crop beg/end of video

Post by InkKnife » Sun Jan 22, 2017 3:19 pm

The lengthy instructions above give sad sentiment to the simple truth that there is no good, easy to use, basic video editor for Linux.
I have been searching for one since I switched to Linux 5 years ago and everything is at least an order of magnitude more complicated than it needs to be with video.
I can visualize an easy to use editor, it looks a lot like the old Quicktime6 which made it dead simple to do the kind of basic edits that will cover the needs of the casual video editor. As near as I can tell no one is even trying to make one because I have been steady on looking for one for 5 years now and am sick to death about having to put what ever vids I want to edit on a stick and walking it upstairs to my mom's old Mac to do the simple edits I need in iMovie.
20 years ago I was importing, editing and exporting vids using super easy to use, basic software on the Mac I had back then, here we are twenty years latter and you still can't do under Linux what I was doing on a Mac way the hell back in the 90s.
i7 3770, 12GB of ram, 256GB SSD, 64GB SSD, 750GB HDD, 1TB HDD, Cinnamon.

User avatar
racer-x
Level 4
Level 4
Posts: 323
Joined: Sun Oct 02, 2016 9:05 am
Location: Area 51

Re: Need simple video editor to crop beg/end of video

Post by racer-x » Sun Jan 22, 2017 4:38 pm

Seriously?? C'mon, It's dirt simple to edit videos in Linux. Do you want to stream-cut edit, or do you want to Frame-Cut edit?

The answer to that question will give you the best response............

One thing you need to understand is that long GOP formats such as AVC and HEVC will require cuts made on Key-Frames (I-Frames) in order to stream-cut (copy without re-encoding) Contrary to some opinions, AviDemux does not have that ability.

*edit, well it does, but it has many issues that I won't go into in here. Much better to use ffmpeg in my opinion. The other alternative is to use wine with a smart editor.

Post Reply

Return to “Software & Applications”