1. Home
  2. Tutorials
  3. Video
  4. Video Editors
Yolinux.com Tutorial

Linux Video Editors

GUI and command line video editing

This covers Linux non-linear video editing solutions including GUI and command line applications.
Included are YouTube tips for posting your edited video.



Free Information Technology Magazines and Document Downloads
TradePub link image

Nonlinear Video Editing Software:

Fully integrated video editing GUI suites are available for Linux. The integrated GUI environment tends to be developed independently of the libraries which support the various codecs. I find that choosing the library which is at the foundation of the application is ultimately what defines the experience.

  • OpenShot - Simple interface and easy to use. Integrates Blender for 3D animation support and Inkscape for titles. Supports Chroma-key (blue/green screen to remove a color), layer and composite, key frame animation, stop motion (importing of images), audio support. Python/Gtk GUI using MLT video editing framework. MLT gives OpenShot the ability to mix multiple formats, Frame Rates, Frame Sizes, Video Codecs and Video Containers. Powerful yet simple.
    Ubuntu installation: apt-get install openshot
    See our OpenShot video editor tutorial
  • Kdenlive - KDE4 based Non-Linear Video Editor which is fully featured and easy to use - Uses FFmpeg as the decoding engine, MLT as its frame server with EDL for the backbone. Configurable GUI. Handles regular DV and HD. Built-in effects. Supports video capture.
    Ubuntu installation: apt-get install kdenlive
    LJ review 10/01/07
  • Avidemux - very simple editor supporting filtering, encoding, simple cuts. Supports AVI, MP4. Scriptable mode as well. Not enough features to do many basic video editing tasks.
    Ubuntu installation: apt-get install avidemux
  • Heroine Virtual: Cinelerra - MPEG/Quicktime viewing/editing/development. Open source video editor Broadcast 2000, Cinelerra. No longer under development.
  • Kino - Record, create, save, edit and play movies from DV camcorder. Cuts only editor. Includes playback.
  • Lives: Linux Video Editing System. GTK+, cut/paste frames, capture/playback, time stretch, resizing, audio and effects.
  • LVE: Linux Video Editor - outputs PAL only. (Under development)
  • MainConcept - Commercial transcoding, encoding tools, codecs for Linux.
  • Matterial - non-linear editing and compositing for movies. Create sound effects, animations or 3-D graphics. (Alpha)
  • Novacut - Collaborative, cloud enabled and real time screencast, collaborative network editing software
    ppa.novacut.com/stable
  • Open Movie Editor - FLTK GUI, FFmpeg or libquicktime decoding engine support. Can run audio through JACK Audio Connection Kit for Linux pro audio tools connectivity. Supports video asset management. Titles using Inkscape. Can use multiple formats, Frame Rates, Frame Sizes, Video Codecs and Video Containers. Support for filters, color adjustment, effects and node based composting. Written in C++.
  • Pitivi - uses GStreamer Multimedia Framework for ingestion and output of video. Supports many formats (audio and video codecs) and aspect ratios. Supports clip insertion/moving/trimming, effects, transitions.
    Ubuntu installation: apt-get install pitivi
Support Tools: LJ video editor review 11/29/05

Commercial Linux Video and digital effects software

Note that the Kdenlive and OpenShot editors are GUI front-ends to the Media Lovin' Toolkit (MLT) Framework. Many other video tools are also based upon this framework.

For screen writing software see Celtx.

See our OpenShot video editor tutorial

[Potential Pitfall]: AVCHD MTS format video gets out of sound-video sync when output by the video editor even though the input MTS file was in sync. It also seems like many of the video players like vlc can't even play the MTS video format without the sound and video being out of sync. I find that mplayer will play the video and sound in sync but its related mencoder program does not seem to convert MTS to an output file and format which remains in sync. Luckily ffmpeg seems to do the trick.
Try: ffmpeg -i 00038.MTS -f avi -b:v 16000k -b:a 192k 00038.avi
This will result in a much smaller file size and there is some notable reduction in video quality.
Also: ffmpeg -i 00038.MTS -f avi -vcodec mpeg4 -b:v 17104k -b:a 384k 00038-ffmpeg-2.avi
(What I specified for my Sony Nex-5 MTS video format.)

  • -i = input file
  • -s = size eg "-s = 1280x760" Place after input file specification.
  • -f = format, appeared neccessary
  • -b:v = videobitrate A larger number inflates the file size. A low number decreases the file size but also reduces quality
  • -b:a = audiobitrate

Video Libraries:

Video editors and applications are built upon the following libraries:

  • a52dec: [Home Page] Library for decoding ATSC A/52 (aka AC-3) audio streams (required by ffmpeg)
  • faad2: [Home Page] Library and frontend for decoding MPEG2/4 AAC (required by ffmpeg)
  • faac: [Home Page] Reference encoder and encoding library for MPEG2/4 AAC audio strams (required by ffmpeg)
  • ffmpeg: [Home Page]
  • id3lib: [Home Page]
  • imlib2: [Enlightenment]
  • lame: [Home Page] MP3 Encoder
  • libquicktime: [Home Page]
  • libsamplerate: (SRC - Secret rabiit code) [Home Page]
  • libsndfile: [Home Page] (required by libsamplerate):
  • xvidcore: [Home Page] OpenDivX video codec (required by ffmpeg)

Command Line Video Manipulation And Editing:

mplayer:

(Download RPM from the MPlayer website: http://www.mplayerhq.hu/)
  • Extract audio stream from a video: mplayer -dumpaudio video-file.mpg -dumpfile audio-file.mp3
  • Enhance video sharpness: mplayer video-file.avi -vf smartblur=.6:-.5:0,unsharp=l5x5:.8:c5x5:.4
  • Convert a video file of arbitrary format to a sequence of images:
    • JPEG: mplayer -nosound -vo jpeg video-file
    • PNG: mplayer -nosound -vo png:z=[0-9] video-file
    • Animated GIF to PNGs: mplayer -nosound -vo png animated.gif
  • Play at 4x speed and 50% more brightness: mplayer -speed 4 -brightness 50 -fs video-file.avi

mencoder:

(Download RPM from the MPlayer website: http://www.mplayerhq.hu/)
  • Rotate Video:
    mencoder -vf rotate=1 -ovc lavc -oac copy mvi_Carolee.avi -o CaroleeVideo.avi
    Rotate:
    • 0 Rotate by 90 degrees clockwise and flip (default).
    • 1 Rotate by 90 degrees clockwise.
    • 2 Rotate by 90 degrees counterclockwise.
    • 3 Rotate by 90 degrees counterclockwise and flip.

  • Concatenate video clips: mencoder -oac copy -ovc copy -o outputfile inputfiles*
    • Works great on AVI files: mencoder -oac copy -ovc copy -o file-name-out.avi inputfiles*.avi
      I found that audio messes up on MOV files. Thus if you want to maintain sound synchronization with MOV files, first convert to AVI, concatenate the AVI files, than convert back to MOV.
    • Force a common framerate, codec and aspect: mencoder -noodml -oac copy -ovc lavc -of avi -ofps 30 -aspect 16:9 -o fileAB.avi fileA.avi fileB.avi
    • If videos are not identical: mencoder -noodml -oac lavc -ovc lavc -of avi -ofps 30 -aspect 16:9 -o fileAB.avi fileA.avi fileB.avi
      (If the video codecs of the clips you wish to concatenated vary slightly then a "copy" will not work, thus specify a common codec)
    Mencoder Options:
    • -ovc copy: Video Codec - instructs that you want to leave the video as it is and simply copy it into the new video file that uses the audio track you specified - no encoding, just streamcopy.
    • -oac copy: Audio Codec - no encoding, just streamcopy

  • Lay down audio track: mencoder -audiofile new-audio-track.wav -oac mp3lame -ovc copy file-name-in.avi -o file-name-out.avi
    • -oac mp3lame: Audio Codec - Encode to MP3 (using LAME)
    • -oac pcm: Audio Codec - Encode to uncompressed PCM
    • -oac lavc: Audio Codec - Encode with a libavcodec codec
    If this does not work for you because the release you are using did not compile in support for your codec of interest, try ffmpeg (see below).

    See the YoLinux.com list of Public Domain Music sources

  • Create video from image file sequences (JPEG to AVI): mencoder -ovc lavc -mf fps=25:type=jpg 'mf://*.jpg' -vf harddup -ofps 25 -noskip -o file-name-out.avi
    To read JPEG image list from a file specify the following: -mf fps=25:type=jpg "mf://@temp.txt"

  • Create video from a single image (JPEG to AVI):
    1. First use one file to generate many unique images for use in video frames. The image resolution must match your target video resolution (eg: NTSC 720x480, PAL 720x576, HD720 1280x720, etc). Use a symbolic link so that it does not fill up your hard drive.
      File: img2video
      #!/bin/bash
      for i in {1..100}
      do
         counter=$(printf %03d $i);
         ln -s $1 img"$counter".jpg
      done
                       
      Usage: img2video file-name.jpg
      This generates one hundred files (actually all symbolic links to the original file file-name.jpg with names from img001.jpg to img100.jpg
    2. Aggregate the images into a video: mencoder -ovc lavc -mf fps=25:type=jpg 'mf://img*.jpg' -vf harddup -ofps 25 -noskip -o file-name-out.avi
      Can also add "lavc" encoding options and HDTV aspect ratio: mencoder -ovc lavc -mf fps=30:type=jpg 'mf://img*.jpg' -vf harddup -ofps 30 -noskip -aspect 16:9 -lavcopts vcodec=mjpeg -o file-name-out.avi
      This generated about 4 seconds of video.

    Complete script:
    #!/bin/bash
    
    for jpgfile in $@
    do
    PDIR=`echo $jpgfile | awk -F"." '{print $1}' `
    mkdir $PDIR
    
    for i in {1..100}
    do
       counter=$(printf %03d $i);
       ln -s $jpgfile $PDIR/img"$counter".jpg
    done
    
    cp $jpgfile $PDIR
    
    cd $PDIR
    /usr/bin/mencoder -ovc lavc -mf fps=30:type=jpg 'mf://img*.jpg' -vf harddup -ofps 30 \
                      -noskip -aspect 16:9 -lavcopts vcodec=mjpeg -o ../$PDIR.avi 
    
    cd ../
    # rm -Rf $PDIR
    done
                     
    Usage: img2video fileA.jpg fileB.jpg
    This will generate two video clips fileA.avi and fileB.avi
    Note that the images in this example are of a resolution 1280 x 720 and result in a HD aspect video. When done remove the working directory.

mencoder man page - movie encoder

ffmpeg:

  • Convert Video File Formats:
    • MOV to AVI: ffmpeg -i file-name-in.mov -sameq -vcodec msmpeg4v2 -acodec pcm_u8 file-name-out.avi
      Note this will maintain audio during the video translation.
    • MTS to MOV: ffmpeg -i file-name-in.mts -vcodec mjpeg -b 100M -acodec pcm_s16be file-name-out.mov
      I often have to perform this translation to repair video from my Sony Nex-5 so that video editors can maintain sound sync. It works.
    • MPG to AVI: ffmpeg -i file-name-in.mpg file-name-out.avi
    • FLV to AVI: ffmpeg -i file-name-in.flv file-name-out.avi
    • AVI to FLV: ffmpeg -i file-name-in.avi file-name-out.flv
      or: ffmpeg -i file-name-in.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv file-name-out.flv

  • Add sound to a video and convert AVI to MPEG: ffmpeg -i sound-file.wav -i file-name-in.avi file-name-out.mpg

    See the YoLinux.com list of Public Domain Music sources

  • Extract audio track from a video: ffmpeg -i video-file-in.avi audio-file-out.mp3

  • Create a snaphshot of a flash video: ffmpeg -i file-name-in.flv -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320×240 snapshot.jpg

  • Create a jpeg snapshot every 12.5 seconds (1/0.08) from video: ffmpeg -i file-name-in -r 0.08 -s 320x240 f%06d.jpg

  • Overlay an image (eg a logo) over an entire video: ffmpeg -i video-in.avi -sameq -vhook '/usr/lib/vhook/watermark.so -f transparent-frame-logo.gif' -an video-out.avi
    Note: /usr/lib/vhook/*.so is part of package ffmpeg.
    Also, use a transparent image the size of the frame with logo in corner of frame.

ffmpeg man page - video converter

Video File Discovery/Interrogation:

  • ffmpeg -i file-name.avi
  • mplayer -vo null -vc null -ao null -identify file-name.avi
    Will print video information before playing.

YouTube Video tips:

The typical YouTube video is embedded as an "iframe" or as an embedded "object":

IFrame:
<iframe width="520" height="293" src="http://www.youtube.com/embed/Ya5FbVhWNa0" frameborder="0" allowfullscreen></iframe>
Where "Ya5FbVhWNa0" is an example of a Video-ID

Embedded object:
<object width="640" height="360">
  <param name="movie" value="http://www.youtube.com/watch_popup?v=Ya5FbVhWNa0&vq=large&aamp;utoplay=1&mamp;odestbranding=1&ramp;el=0"></param>
  <param name="allowFullScreen" value="true"></param>
  <param name="allowScriptAccess" value="always"></param>
  <embed src="http://www.youtube.com/watch_popup?v=Ya5FbVhWNa0&vamp;q=large&aamp;utoplay=1&mamp;odestbranding=1&ramp;el=0" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></embed>
</object>

YouTube iframe vs embedded object: The embedded object is delivered in Adobe Flash format which is not readily available on iPad and iPhone products and is only available on other platforms with a plugin. The iframe delivery mechanism compensates for the platform and if the platform does not support Flash format then and HTML5 compliant video format is used. On Android platforms the plugin is usually not installed by default and has to be downloaded.
For more on Flash support detection and video format selection see swfobject

YouTube video URL options:

OptionDescription and choices
video id Use full browser window: http://www.youtube.com/v/Video-ID
Typical: http://www.youtube.com/embed/Video-ID
autoplay 0: default. Do not start video play when player is loaded.
1: Start playing video when player is loaded.
Auto start the video: http://www.youtube.com/v/Video-ID?autoplay=1
loop 0: Default. Do not replay video or playlist over again
1: Continuously replay video or playlist
Loop the video: http://www.youtube.com/v/Video-ID?loop=1
modestbranding 0: Default. Show YouTube brand logo
1: Do not show YouTube brand logo
Example: http://www.youtube.com/v/Video-ID?modestbranding=1
autohide 0: Default. Show controls for play, sound control, progress etc
1: Auto hide controls when cursor leaves the video play screen.
Example: http://www.youtube.com/v/Video-ID?autohide=1
rel 0: Do not show related videos at end of video and do not show serach function.
1: Default. Show related videos
Turn off recomended videos: http://www.youtube.com/v/Video-ID?rel=0
#t Skip ahead 1 minute and 10 seconds of video: http://www.youtube.com/watch_popup?v=Video-ID#t=1m10s
Also see the "start" option.
start Specify the number of seconds time offset for start of video (Next video frame is the actual start)
iv_load_policy 1: Default. Show annotations
1: Do not show annotations.
Annotations can be added to your video while logged into YouTube. This feature not availabel on the HTML5 version of the player.
color red: Default color for the video progress bar
white:
theme dark: Dark theme controls. Dark control bar.
light: Light control bar
controls 0: Default. Do not enable the YouTube Javascript API
1: Enable the Javascript API
enablejsapi 0: Do not show player controls
1: Default. Show player controls
Requires use of the "playerapiid" option.
fs 0: Do not enable the full screen button
1: Default. Enable the full screen button
Not supported in the HTML5 API
showinfo 0: Do not show into.
1: Default. Show video title and rating before video starts.
Not supported in the HTML5 API
Note that some features are not yet available in the pure HTML5 video player.

Full list of YouTube embedded player parameters
YouTube Javascript API

Twitter Video tips:

Twitter has the following restrictions:
  • Max video length is 2 minutes and 20 seconds
  • Max video size is 512 Mb
  • Videos that are 6.5 sec or shorter will automatically loop
  • Formats:
    • MP4:
      • H264 video encoding
      • AAC audio encoding. MP4 videos using any other audio codec will be silent. You can un-mute the video but you won't be able to hear the sound.
    • MOV
  • Resolution:
    • Minimum resolution: 32 x 32
    • Maximum resolution: 1920 x 1200 (and 1200 x 1900)
    • Maximum frame rate: 40 fps

Book imageBooks:

Broadcast 2000 : A Free Digital Moviemaking Kit
by Curtis Lee Fulton
ISBN #1886411700, No Starch Press

If you want to learn how to use the Broadcast 2000 video editor for Linux from HeroineWarrior.com, you will need this book.

The Official Blender 2.3 Guide
by Ton Roosendaal, Stefano Selleri
ISBN #1593270410, No Starch Press

Manual to the 3-D graphics and animation program Blender.

Amazon.com
The Blender Book
by Carsten Wartmann
ISBN #1886411441, No Starch Press

Manual to the 3-D graphics and animation program Blender. This helps decipher the Blender interface.

Amazon.com
Mbone: Interactive Multimedia on the Internet
by Vinay Kumar
ISBN #1562053973, New Rider Publishing

What it is and how to use the MBone multicast video conferencing system.

Amazon.com
No image available Digital Video Camcorders: Open source programmers guide
by Tewell
ISBN #0750677619, Newnes

For programmers and embedded systems engineers and professionals.

Amazon.com

   

    Bookmark and Share

Advertisements