# Video editor



## balanga (Nov 26, 2018)

Any recommendations for editing a video?

I'm just looking for something straightforward - all I want to do is save a small part of an MP4 file.


----------



## yuripv (Nov 26, 2018)

Try multimedia/avidemux.


----------



## Deleted member 30996 (Nov 26, 2018)

I use multimedia/vlc to do simple video and audio editing.

Under the View tab set it to show Advanced Controls. Then you can play a video or audio file, hit Record and Stop when you've got the part you want.


----------



## b6s6d6 (Nov 26, 2018)

multimedia/kdenlive is pretty nice


----------



## scottro (Nov 27, 2018)

For something that simple, you could use ffmpeg.  

```
ffmpeg -ss <where you start> -i <input video> -t <time in seconds> out.mp4
```
 or whatever format you want for the video.  The -ss for start goes in front of -i for input because it works more quickly--if you do -i then -ss it looks through the whole video trying to find where to start, I believe.


----------



## ronaldlees (Nov 30, 2018)

I am very fond of graphics/blender for this purpose.  It's especially good for color grading, because it allows the use of curves (easy to drag around).  Splicing videos is also quite easy/good.  But, it only inputs/outputs in mjpeg with the default config on FreeBSD, so you'd need to move your vids to MJPEG somehow.  MJPEG is slightly higher quality than MP4, and is all I use anymore.  I only purchase cameras that can do that video format.


----------



## maurizio (Feb 19, 2019)

I would like to give a try to multimedia/shotcut
It seems it can be installed simply by pkg instead of port


----------



## olli@ (Feb 19, 2019)

ronaldlees said:


> I am very fond of graphics/blender for this purpose.  It's especially good for color grading, because it allows the use of curves (easy to drag around).  Splicing videos is also quite easy/good.  But, it only inputs/outputs in mjpeg with the default config on FreeBSD, so you'd need to move your vids to MJPEG somehow.  MJPEG is slightly higher quality than MP4, and is all I use anymore.  I only purchase cameras that can do that video format.


Note that MJPEG is nothing more than a concatenation of JPEG images. That means it does not make use of temporal redundancy, so it has very poor compression. MJPEG might be ok for editing (but you might even consider using a lossless format for this purpose), but when saving the final video it's better to use a real video codec like h.264 (a.k.a. MPEG4 AVC). It should also be noted that some hardware players don't support MJPEG because it's rather uncommon.

Regarding quality: That depends entirely on the encoding settings. An MJPEG file is not higher quality per-se. All of these video codecs are lossy, i.e. they remove a certain amount of information, depending on the quality / compression settings. In fact, if you store the same video clip as MJPEG and as MPEG4 with the same compression (i.e. same file size), the quality of the MJPEG one will be abysmal. And if you tune the encoder settings so that the quality is roughly the same, then then MPEG4 file will be considerably smaller (like a fraction of the size of the MJPEG file).


----------



## ronaldlees (Feb 20, 2019)

olli@ said:


> ... And if you tune the encoder settings so that the quality is roughly the same, then then MPEG4 file will be considerably smaller (like a fraction of the size of the MJPEG file).



I agree that the file sizes get to be enormous when using MJPEG.  But, I use large disks and then don't worry about it too much.  Also, I tend to shoot short clips and then concatenate them all into a video, so in the field I don't worry too much about filling a smaller SD drive.  Plus, I carry lots of spares.  With today's huge hard drives, I don't see the size thing as all that bad.

I know I get better color dynamic range from videos that were originally shot in MJPEG versus any other format except raw.  This is easy to discover when you're editing marginal videos, where poor lighting already limits the spectrum available in the shots.  MJPEG goes to pot less quickly in such cases, and I can "pull" bad histograms into shape without losing as much detail.  But ...

I agree that for exporting the final clips, if there's going to be any www uploading going on (i.e. Google) -  then some kind of compressed format is necessary.  I have uploaded MJPEGs to Youtube (Sometimes I can't believe how much data Google will take (no matter how long it takes to upload LOL)).

Also - MJPEGs are less encumbered, from the free software point of view.


----------



## daeron (Mar 13, 2019)

yuripv said:


> Try multimedia/avidemux.


The multimedia/avidemux port is effectively dead until somebody does a port for avidemux-qt5 which builds successfully but seems to need port work to function with avidemux-plugins.
  KDE4 ports have been deprecated by the KDE-FreeBSD team and will be removed at the end of 2018.


----------



## SirDice (Mar 14, 2019)

daeron said:


> and will be removed at the end of 2018.


You do realize it's March 201*9* and this has already happened a couple of months ago?


----------



## daeron (Mar 14, 2019)

The point is that  avidemux seems to be the only port that has been left hanging on a defunc qt4, every other port seems to be qt5 ready for when qt4 will be removed. 
Unfortunately I don't know of any port that comes close to matching the avidemux GUIs for letting people slice video files as easily with the user's choice of copy or encoding options... for the past year i've been forced to do my video work on MS-windows where I can use avidemux.


----------



## DoItDrive (Mar 29, 2019)

Sony Vegas - best piece of software that I ever used.


----------



## SirDice (Mar 29, 2019)

DoItDrive said:


> Sony Vegas - best piece of software that I ever used.


Does it run on FreeBSD? I suspect not, as it's Windows only software. We have nothing against Windows (some of use do but that's a different discussion) but we generally frown at suggesting Windows applications on a _FreeBSD_ forum.


----------



## rigoletto@ (Apr 1, 2019)

One could try to port LightWorks.


----------



## tingo (Apr 2, 2019)

No source code for LightWorks has been released yet: https://en.wikipedia.org/wiki/Lightworks
so porting isn't possible at this time.


----------



## daeron (Apr 2, 2019)

christhegeek said:


> i can't import media they crash after i try importing, shotcut,kdenlive,cinellera tested and don't work at all  !
> this is bad for this project


Openshot, kdenlive, cinellera (current) tested and all still work on 12-Stable (amd64), still import various media types. There were problems with shotcut a few weeks ago.
Update 9/April built current  Shotcut (shotcut-19.02.28_1) and now it also seems to be working.


----------



## rigoletto@ (Apr 2, 2019)

tingo said:


> No source code for LightWorks has been released yet: https://en.wikipedia.org/wiki/Lightworks
> so porting isn't possible at this time.



And probably never will, but that would not be the first proprietary software in the tree.


----------



## christhegeek (Aug 7, 2019)

Well after some tests i did with nvidia & amd graphics cards Openshot on freebsd is the best choice if you have to do video editing with hardware acceleration and actually have fast performance !!!
Cinellera is very slow . 
Shotcut & Kdenlive are nice choices but they can't work with hardware acceleration (mlt framework?) and if you turn on hardware acceleration they crashes right away.
I can suggest openshot because its performance made it the ONLY viable option for video editing for professional use and or uhd videos.
I don't know why kdenlive/shotcut has problem working with hardware acceleration but on linux shotcut with hardware acceleration enabled is blazing fast and can edit 4k videos easily or
1080p videos adding a ton of effects and additional multiple background/foreground video layers !!!
But for FreeBSD i can only suggest OpenShot !
At least we have an option :-(   :-(



daeron said:


> Openshot, kdenlive, cinellera (current) tested and all still work on 12-Stable (amd64), still import various media types. There were problems with shotcut a few weeks ago. Update 9/April built current Shotcut (shotcut-19.02.28_1) and now it also seems to be working.


----------



## kpedersen (Aug 7, 2019)

For certain things like placing stuff around a screen and text (which is the extent of my skills anyway), then multimedia/obs-studio is pretty useful.


----------



## toorski (Aug 8, 2019)

My fav. is kdenlive, but I don't use it in FreeBSD becuase its pkg installation birngs in too much of KF5 (KDE5) framework dependecies along with it. Tho, it's ok if one is already on KDE in FreeBSD.
Since I'm not KDE5 fan in FreeBSD, I use:

```
pkg install cinelerra-gg
```

`% cin
Cinelerra 5.1 - built: Aug  6 2019 06:16:17
git://git.cinelerra-cv.org/goodguy/cinelerra.git
(c) 2006-2018 Heroine Virtual Ltd. by Adam Williams
(c) 2007-2018 cin5 derivative by W.P. Morrow aka goodguy
Cinelerra is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. There is absolutely no warranty for Cinelerra.`

It works for me here
`FreeBSD 12.0-RELEASE-p9 GENERIC  amd64`


----------



## NapoleonWils0n (Aug 8, 2019)

On the command line as *scottro *suggested ffmpeg is the best option

Handbrake does have an option to select a range of seconds or different dvd chapters to export to a file.

But on Freebsd you cant install Handbrake because lame is a dependency and because of the mp3 license
there is no lame package on a port, and mixing ports and packages isnt recommended
so you would have to look at using something like poudriere to build the package

I have recently been doing some video editing on the Mac,
using the 30 day trial version of Final Cut Pro and DaVinci Resolve

On a funny side note the Final Cut Pro trial version creates a directory called .ffuserdata in ~/Library/Application Support,
if you remove the .ffuserdata directory can you guess what happens

I know FCP will never be ported to Freebsd
i only mention it because some Freebsd users may also be Mac users as well

DaVinci Resolve which is free to download but not open source does have a Linux version

So i dont know if it could every be ported to Freebsd but it is an excellent video editor,
it has really good colour correction tools, fairlight audio which is great for doing noise removal,
import export edit decision lists and it even has subtitle support

Blender can be used as a video editor but compared to FCP its performance is terrible,
in the preview window for the video you will get a frame rate of about 12 or 13

* ffmpeg can be used to extract part of a video clip but there are a couple of things you need to be aware of

You use the -ss option to seek to for example 30 seconds in the video
and the -t option to specify how many more seconds after you seek you want to record

for example if you want to seek to 30 seconds into the video,
and then record 1 minute of footage the command would look like this


```
ffmpeg -ss 00:00:30 -i infile.mp4 -t 00:01:00 -c copy outfile.mp4
```

Note to when using the -t option you specify how many seconds after the seek point,
and not the point in time in the video

Also if you are just copying the audio and video stream into a new container using the -c copy option,
then the seeking may not be accurate

I have found that for the -ss and -t options only really work if you re-encode the video

Not wanting to recommend using programs that only work on Linux,
it looks like ffmpeg is the best option


----------



## olli@ (Aug 9, 2019)

NapoleonWils0n said:


> Also if you are just copying the audio and video stream into a new container using the -c copy option,
> then the seeking may not be accurate
> 
> I have found that for the -ss and -t options only really work if you re-encode the video


The reason for that is how MPEG-based codecs work. An MPEG stream consists of a sequence of GOPs (group of pictures). Each GOP begins with a _key frame_ (often called I-frame), followed by several P-frames and B-frames. An I-frame is a self-contained unit and can be decoded independently from other frames. But P-frames and B-frames contain only the differences relative to other frames (this improves compression considerably), so they depend on other frames and cannot be decoded independently.

So, when copying part of a stream, it must begin with a key frame (I-frame). If you need to start with a different frame, then at least the GOP that contains that frame needs to be re-encoded (the following GOPs need not be re-encoded and can be copied as-is). Some programs call this feature “smart copying”. I think `avidemux` supports this, for example.

Typically, key frames are used by the encoder when there's a cut between two scenes, so the difference from one frame to the next is rather big. Also, there is an encoder setting for the maximum GOP size, so key frames cannot be more than that many frames apart. Often this is set to 10 seconds for archived video (DVD, Bly-Ray, video-on-demand) and 1 second for broadcast video (so you don't have to wait 10 seconds when switching channels).


----------



## NapoleonWils0n (Aug 9, 2019)

Spot on *olli@*

It depends on the keyframes in the video as to how accurate ffmpeg seeking is


----------



## christhegeek (Oct 5, 2019)

If Freebsd Devs see this post then i would like to ask them to give some time and try to port kdenlive and shotcut properly with hardware acceleration working (fre1r,mlt,movit frameworks)
It would be so good for freebsd users to actually have a decent video editor working with good performance for demanding video projects !


----------



## laufdi (Nov 15, 2019)

Yes, openbox and shotcut both crash on start, for example.


----------



## msplsh (Nov 15, 2019)

NapoleonWils0n said:


> But on Freebsd you cant install Handbrake because lame is a dependency and because of the mp3 license
> there is no lame package on a port, and mixing ports and packages isnt recommended
> so you would have to look at using something like poudriere to build the package



The MP3 patents expired in 2017 and LAME has been moved in the gstreamer GitLab repo from the "ugly" to "good" plugin directory around August of that year.  Why the FreeBSD port of gstreamer still has it in the "ugly" section is beyond me.


----------



## Phishfry (Nov 16, 2019)

Can we have audio/lame back?
					

This is in reference to the post https://forums.freebsd.org/threads/what-happened-to-lame.32124/. I know it is several years old hence I'm not necroing.  The MP3 patents expired in April 2017, and Fraunhoffer IIS had chosen to not renew...




					forums.freebsd.org
				



TL;DR
This file spells it out:
usr/ports/audio/lame/files/lame_patents.txt


> Linux distributions seem to go the "let's see if get sued" way,
> FreeBSD does not follow this.


----------



## `Orum (Nov 17, 2019)

I don't think that's entirely accurate.  There are other patent-encumbered things in ports, and while the packages might be built without the patented portions, compiling the port lets you do whatever you want.  So while I could see lame not being in packages, I see no reason why it couldn't be in ports.


----------



## christhegeek (Nov 17, 2019)

Nice ! Thanks for your advice using a windows software, apparently we have nothing to do here and go install windows and the rest is history. LoL
I don't like windows if i was about to go with proprietary operating system and applications i would build a hackintosh and install catalina mac osx.



DoItDrive said:


> Sony Vegas - best piece of software that I ever used.


----------



## drhowarddrfine (Nov 17, 2019)

`Orum said:


> So while I could see lame not being in packages, I see no reason why it couldn't be in ports.


Because it's patented!


----------



## Phishfry (Nov 17, 2019)

Please notice that the statement I quoted came directly from the /audio/lame port directory.
Notice that it is LICENSE_RESTRICTED on freshports and in /usr/ports/audio/lame/Makefile
That means distributing the pre-compiled binary package by FreeBSD is not allowed.
Lame is in ports and can be built by hand. The binary cannot be distributed by FreeBSD.


----------



## daeron (Dec 7, 2020)

Avidemux port have been updated with the Qt5 GUI, so a big thankyou to the ports team for great work.
The pkg install seems to be a bare minimal missing some codec and filter options; for example subtitle filter isn't available unless you build it with FriBibi bi-directional text support. But the port seems good even when all options are enabled, so just disable whichever sound servers and codecs you know you don't want and you should have access to the functions of whichever libraries you've enabled.


----------



## Phishfry (Nov 15, 2021)

Well it looks like the issue with lame binary packages was resolved non-violently.





						[ports] Revision 554970
					






					svnweb.freebsd.org


----------



## Phishfry (Nov 15, 2021)

lindsywes said:


> MPEG4(DivX4/DivX5)


I never considered the DivX formats as serious. They were originally lifted from Microsoft right?








						DivX - Wikipedia
					






					en.wikipedia.org


----------



## grahamperrin@ (Nov 22, 2021)

Phishfry said:


> … the issue with lame binary packages was resolved non-violently.



Further: <https://cgit.freebsd.org/ports/commit/LEGAL?id=0b673d6c5b2b727e108435637b6a3dc6eced561c> removed LEGAL.


----------



## kpedersen (Nov 22, 2021)

Phishfry said:


> I never considered the DivX formats as serious. They were originally lifted from Microsoft right?
> 
> 
> 
> ...


There was a time when every film you would grab from torrents was sodding DivX.
Luckily VLC's DivX support came along quite fast. I am glad that project never tiptoed around patents / trademarks like the others. It means many years later it is solid, useful and *everyone* uses it.


----------



## msplsh (Nov 22, 2021)

kpedersen said:


> There was a time when every film you would grab from torrents was sodding DivX.


This was primarily because bandwidth was scarce and it was the easiest available MPEG4-size-equivalent encoder.  Nobody liked Sorenson either.


----------

