= Tracker Cutting Howto

When we talk about “cutting a video”, we mean a highly automated process how the intro and outro get added to a recorded lecture using the CRS Ticket Tracker. Cutting in our case bascially only consists of setting the actual start and end of the lecture. Everything else is an automated process.

This page is meant to describe the steps involved when everything else is already prepared. See Intro-Outro-Generator for a way to generate intros based on a talk schedule and Project setup for the steps to set up a new tracker project (which is usually done by the “VOC event lead/ resposible person”).

== Cutting with FUSE

There are two main ways of cutting a video: Using the KDEnlive or Shotcut open source video editors or by manually writing frame numbers to obtained from a video player like mpv the in- and outframe files.

General preconditions:

Access to VOC VLAN or ethernet network

via DHCP or

fixed IP configured as secondary ethernet interface

Account on https://tracker.c3voc.de

Have VLC installed

On Linux: Install cifs-utils (or similar) to mount the SMB share

On Linux: Install Shotcut (version 22.12.21 is known to work) or KDEnlive (version 17.x or 18.x)

On Windows/ macOS: Install Shotcut as described at their website (Version 22.12.21 is known to work)

=== General Workflow

storage.lan.c3voc.deencoderX.lan.c3voc.deminionX.lan.c3voc.de

We use three different file share mounts, due to different read/write permissions. $USER is already set by your OS.

First of all, you need to mount the storage device's SMB file share to access the files:

Linux: <code>sudo mkdir -p /video; sudo chown $USER /video

mount -t cifs -o uid=$USER,password=,ro “storage.lan.c3voc.de/video” /video mount -t cifs -o uid=$USER,password=,rw “storage.lan.c3voc.de/tmp” /video/tmp mount -t cifs -o uid=$USER,password=,rw “//storage.lan.c3voc.de/fuse” /video/fuse </code>

macOS: Open Finder, click “Connect to Server” (cmd+K) in the “Go To” menu and connect to smb://Guest:@storage.lan.c3voc.de/fuse

Windows: Connect to the \\storage.lan.c3voc.de/video/ network drive

If you can see files in fuse/<EVENT>/<ROOM>/<Talk-ID>, you're ready to go.

To cut a lecture:

Open https://tracker.c3voc.de and open an event/ project

Click “recording task to cut” on the right to get a list of open cutting tickets

Press the “cut” button and remember the talk ID

Open /video/fuse/<EVENT>/<ROOM>/<Talk-ID>/ in some file explorer

Open the uncut.ts with VLC:

Check if the start and end are present in the file. If not, go back to the tracker and click “extend timeline”

If translations are provided at the event: Check which tracks contain audio and which languages are spoken

Start cutting with KDEnlive, Shotcut or mpv (see below)

Check if audio and video are in sync

Go back to the tracker to finish cutting:

Select language(s) from the drop-down using the right order (audio track 1, 2, 3)

If there was A/V-delay, enable the corresponding checkbox and set the number (VLC and mpv values need to be inverted)

click “finish”

=== Notes on Using KDEnlive

Open the project.kdenlive project file to start cutting:

Find start and end of the lecture and resize the bar by dragging the start and end with your mouse

When hovering over the ends, a green arrow should appear. Use this to change the length. It may snap at your current playback position.

Be careful to not move the video in the timeline

Save the project file

If you have a poor connection to the storage, deactivate the video and audio thumbnails using the buttons on the right side of the lower window border.

=== Notes on Using Shotcut

Open the project_shotcut.mlt project file to start cutting:

Skim through the recording (use <space> for play/pause)

Set start (in-point) with shortcut i

Set end (out-point) with shortcut o

Save the project file

More shortcuts:

i: Set start/ in-point

o: Set end/ out-point

<space>: play/ pause

<page-up> <page-down>: Jump +/- 1 second (combine <Ctrl> or <ALT> to jump 2 or 5 seconds)

<ALT>+<arrow-left>: Jump to start

<ALT>+<arrow-right>: Jump to end

<arrow-left> <arrow-right>: Jump 1 frame back/ forwards

j / l: Fast back/ forwards (gets faster, if pressed multiple times)

Possible issues at installation:

Error “This application failed to start because it could not find or load the Qt platform plugin “xcb” in […]”:

apt-get install libQt5Gui

(see http://stackoverflow.com/questions/17106315/failed-to-load-platform-plugin-xcb-while-launching-qt5-app-on-linux-without)

=== Notes on Using mpv

mpv is a command line media player, which can also be used in our cutting workflow. nicoo wrote an mpv script which automates our cutting workflow.

See the ''mpv'' manual for the default keybinds.

==== Setup

Install the script, typically by copying c3voc-cutter.lua to ~/.config/mpv/scripts/. If using a mountpoint other than /video, it needs to be set in ~/.config/mpv/script-opts/c3voc.conf.

The script does not add keybindings by default, and those must be configured in ~/.config/mpv/input.conf like so:

% script-binding c3voc-cutter-jump-in
^ script-binding c3voc-cutter-jump-out
Ctrl+5 script-binding c3voc-cutter-set-in
Ctrl+6 script-binding c3voc-cutter-set-out

mpv can also be configured to show frame numbers by adding these settings in ~/.config/mpv/mpv.conf:

osd-level=3
osd-status-msg=${playback-time/full} / ${duration} (${percent-pos}%)\nframe: ${estimated-frame-number} / ${estimated-frame-count}

If using nix / home-manager, the script repository is a flake providing the necessary configuration as NixOS and HM modules; just add the following to your (NixOS) imports, replacing nicoo with your local username:

{
imports = [ c3voc-scripts.nixosModules.default ];
home-manager.users.nicoo.imports = [ c3voc-scripts.homeModules.default ];
c3voc.user = "nicoo";
}

==== Usage (with script)

Open uncut.ts in mpv to start cutting

Skim through the video to find the start

mark it by hitting Ctrl+5 (or whichever keybind you set)

jump back to it with Shift+5

you can hit Ctrl+5 again at any point to set a new startpoint

Same for the end

mpv will write the inframe and outframe file when exiting or switching to a new file.

==== Usage (manual)

Open the uncut.ts in mpv to start cutting:

Skim through the video to find the start

Write the frame number to the inframe file using echo <FRAME> > /video/fuse/<EVENT>/<ROOM>/<Talk-ID>/inframe

Do the same for the end using the outframe file

Using echo works best since some text editors like to create temporary lock files which isn't allowed on the FUSE file system.

==== Tips

thumbfast can generate thumbnails live, for instance when hovering over a seek bar, which can help find the start and end of a talk faster. (Note: it needs to be used with a UI script, and supports most MPV UIs)

evafast gives fast-forward and seeking on the same key, which is rather convenient.

quack reduces the volume when seeking, to avoid torturing one's ears during cutting

For nix users: those are all packaged, and can be added with

programs.mpv.scripts = with pkgs.mpvScripts; [
evafast
quack
thumbfast # NOTE: useless on its own, combine with its builtin osc.lua, or with alt. OSCs like uosc
];

== Known Issues and Solutions

Shotcut or VLC don't show a time during playback:

The uncut.ts has broken timestamps because the recording was stopped to early or started to late. See defekte_timestamps.

Skimming though the video leads to jumps or some parts of the video can't be jumped to:

The uncut.ts has broken timestamps because the recording was stopped to early or started to late. See defekte_timestamps.

SMB connect fails on OS X 10.11 El Capitan: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821730

Add an SMB password to the voc user with smbpasswd -a voc to that one can be used instead of the guest user

== Remote Cutting using a Proxy File

The uncut.ts can get quite large as we're still recording using the MPEG2 codec. If you need to cut via the VPN, it may be useful to generate smaller low-resolution “proxy” files and cut based on that:

press “cut” in the tracker to assign the ticket to yourself

create a proxy file from /video/fuse/…/uncut.ts: webcut_lores_mp4

copy the KDEnlive or Shotcut project file to your local file system and replace the video URL

open the project and cut

upload the project file to the FUSE file system, e.g. by:

loading the file to your home directory on the storage server/ encoder

cat meinfile.mlt > /video/fuse/…/project_shotcut.mlt (or similar for KDEnlive)

click “finish” in the tracker