Video Timeline and Monitoring

The integration of a video timeline and video monitoring into Ardour 3.x allows for convenient audio mixing and editing to video ie soundtracks, music videos, TV post production etc.

Ardour 3.x sessions provide facilities to:

  • Import a single video and optionally extract the soundtrack from it.
  • Provide a Video-monitor window, or full-screen display, of the imported video in sync with any of the available ardour timecode sources.
  • Display a frame-by-frame (thumbnail) timeline of the video.
  • time-offset the video
  • Lock audio-regions to the video: Move audio-regions with the video at video-frame granularity.
  • Export the video, cut start/end, add blank frames and/or mux it with the soundtrack of the current-session.

Furthermore setup is modular and can be configured in different ways, including:

  • One machine: all video decoding, video monitoring and Ardour audio
  • Two machines: separate video-monitor and Ardour
  • Three machines: separate video-server (for timeline decoding and file-archive), dedicated video-monitor and Ardour

Ardour does not :

  • allow for more than one video to be loaded at a time.
  • provide video editing capabilities

Setup

Ardour 3.x requires no configuration if you intend to run everything on a single machine, and if you acquired Ardour 3.x from http://www.ardour.org, everything is pre-configured and included with the download/install.

Single Machine

If you compile Ardour 3.x from source, or have installed it from a 3rd party, additional tools will need to be installed.

There are three separate standalone tools involved which are used by Ardour 3.x to provide video facilities.

Ardour 3.x requires xjadeo >= version 0.6.4, harvid >= version 0.7.0 and ffmpeg == 1.2.

The ardour-dev team is in control of the first two applications. ffmpeg can be a bit of a problem. To avoid conflicts with distribution packages, ardour looks for ffmpeg_harvid and ffprobe_harvid.

All four applications need to be found in $PATH (e.g. $HOME/bin or /usr/local/bin). For convenience the binary releases of harvid include ffmpeg_harvid and ffprobe_harvid, but if your distribution provides suitable ffmpeg commands you can also just create a symbolic link from ffmpeg → ffmpeg_harvid and ffprobe → ffprobe_harvid.

Binary releases are available from ardour.org as well as an installer script: install_video_tools.sh.

You can run it directly as:

sh -c "$(curl -s -L http://git.io/tVUCkw)"

Studio Setup

Please read the info in the previous section to familiarize yourself with the tools involved. Setting up a proper A/V post-production studio can be a complicated task. As much as we streamline and simply the single machine setup, the studio-setup is focused on modularity.

TODO

  • Synchronization ardour → video-display-box should be accomplished by external means jack-transport(netjack), MTC, LTC (OSC and/or ssh-pipe work but introduce additional latency + jitter)
  • Ardour launches XJREMOTE (environment variable, default 'xjremote' which comes with xjadeo also on OSX).
  • Either use a custom shell script that ssh'es into the remote box and launches/controls xjadeo there, selects the sync-source and passes though communication between ardour ⇔ xjadeo via ssh (xjadeo is launched stopped with the session).
  • ..or override xjremote's behavior – instead of IPC with a local running xjadeo-process, using OSC for example. xjadeo would run permanently and ardour will just tell it to load files and set offsets via OSC. see xjremote-osc example script.
  • If the video server runs remotely, Ardour needs to be configured in Ardour > Preference > Video (hostname of the video-server).

Ideally the machines have a common shared folder (NFS or similar). Ardour's import (audio-extract) and export (mux) functionality depends on having access to the video file. Also ardour video-import transcodes the file into a suitable proxy-format that allows reliable seeking to any frame…

Transcoding, Formats & Codecs

A short primer on video-files, formats and codecs – because it is often cause for confusion:

A video file is a container. It usually contains one video-track and one or more audio-tracks.

How these tracks are stored in the file is defined by the file-format. Common formats are avi, mov, ogg, mkv, mpeg, mpeg-ts, mp4, flv, vob

Each of the tracks by itself in encoded - using a Codec. Common Video-Codecs are h264, mpeg2, mpeg4, theora, mjpeg, wmv3. Audio-Codecs: mp2, mp3, dts, aac, wav/pcm.

Not all codecs can be packed into a given format. For example the 'mpeg' format is limited to mpeg2, mpeg4 and mp3 codecs (not entirely true) and generally naming conventions uses for format and codecs are cause for a lot of confusion. DVDs do have stringent limitations…

The export dialog includes presets for common format & codec combinations (such as DVD, web-video,..). If in doubt use one of the presets.

All in all it is a very wide and deep field. Suffice there are different uses for different codecs. When importing a video into ardour, it will be transcoded (transcoding: change from one format and codec to another) to avi/mjpeg for internal use (this allows reliable seeking to frames at low CPU cost - the file-size will increase, but hard-disks are large and fast).

As last note: Every time a video is transcoded the quality gets worse. Hence for the final mastering/muxing process always to back to the original source of the video.

Operations

  • Session > Open Video - add/replace a video to/on the timeline
  • Window > View Monitor open/close external video monitor window
  • View > Video Monitor > … settings of the video monitor
  • Session > Export > Video
  • Drag the video in the timeline - right click and choose 'lock' to prevent accidental drags
  • Audio-Region > context-menu > Position > Lock to video – audio-region(s) are moved along with the video.

Adding video

Adding video is a two-step process.

  1. Select video file
  2. Choose import-mode and optionally select an audio-track to extract


The first step is rather straight forward: The panel on the right side allows to seek through the video and displays basic file information. It is also useful to check if the video format/codec is supported:


The second step analyzes the video file in more detail and offers import options:

  • Import/Transcode to Session. This is the default. The video will be imported in a suitable video-format/codec for the timeline and video monitor and saved inside the session folder. A location different than the session folder can also be chosen (extrnal disk, network storage of the video server on a different machine…).
  • Reference from Current Location. Only useful for opening files that were previously encoded (are already in a good format/codec) use with care.
  • Do not Import Video - useful for extracting audio only.

By default the video is imported using the original width/height. If it is a large video (e.g. full-HD) it will make sense to scale it down to lighten CPU and disk I/O required to play it. For editing sound-tracks, a small representation is usually sufficient. The default bitrate is set to use 0.7 bits per pixel. Some key values: the average DVD medium uses 5000kbit/sec.

working with A/V

Well now,..

Exporting video

The video-export will take audio from the current Ardour session and multiplex it with a video-file.

By default the video file that is displayed on the timeline is used as video-source. This may not be the best option but is usually sufficient for dailies and demo snapshots. For high quality exports the original file (before it was imported in the timeline) should be used. Any existing audio tracks on the video-file are stripped.

The soundtrack of the video is taken from an audio-export of ardour's master bus.

The range selection allows to cut or extend the video. If the session is longer than the video duration, black frames are prefixed or appended to the video. If Ardour's session range is shorter the video will be cut accordingly.

Audio Samplerate and Normalize Audio are options for Ardour's audio exporter. The remaining settings are options that are directly passed on to ffmpeg.

 
wiki/a3video_manual.txt · Last modified: 20.04.2013 13:09 by rgareus