Automating video generation by adding an intro and a trailing video to the main video

Posted by DevDewboy on Super User See other posts from Super User or by DevDewboy
Published on 2013-11-01T23:15:19Z Indexed on 2013/11/05 9:59 UTC
Read the original article Hit count: 379

Filed under:
|
|

I have a video project I am trying to compile. Here is the overview:

  1. I have many videos which are 5 minute training sessions - Main video.
  2. The Intro Video will be a standard 5 second video that will have the Video title and Author. This will be concatenated to the main video.
  3. The Trailing Video will pretty much be a stock video that will be concatenated to the main video and have all the legaleze etc.
  4. The Intro Vid will smoothly fade into the main vid as well as when you get to end of the main video it will fade into the Trailing video nicely.
  5. The product is a new video with a Intro, Main & Trailer video all in one!

The concept is really that simple. In fact I found an example of a person who has solved this and is doing exactly what I want.

This solution is a Bash script that takes a config file that has the title, author, etc. and generates the Intro, the Ending and creates the resulting video with them concatenated.

I am using Ubuntu 12.04 Server. I have been trying to take this as a sample and just running it with no luck because of incompatibility errors. I even attempted to convert it using .MP4 containers or .MKV. I am running into error after error or incompatibility issues. I went as far as changing out the ffmpeg binary using the 25 Oct 2013 version from http://ffmpeg.gusari.org/static/64bit/ which I like as I don't have to worry about rebuilding the binary. Almost successful but again I have some error which I cannot solve.

I know part of the problem is the fact that video production, codecs, formats is a completely new field for me so I am attempting to work through this new territory.

Perhaps an expert here has something similar that I can use as a guideline that uses MP4 or h.264 format. Or take the solution above from the URL and make it work with a more up-to-date version of ffmpeg.

I will include the script and its parameter file and the output (abbreviated because of limitation) below. Basically as the script stands right now, when run I get the error [matroska,webm @ 0x27bbee0] Read error. This error is return from the 'reasembleVideo' routine from the first ffmpeg command.

The following is the Parameter File:

#!/bin/bash
INPUTFILE="ssh_main.mp4"
LOGO="logo.png"
LOGOLENGTH="1"
SPEAKER="Jason"
TITLE="Basic SSH Video"
DATE="October 28, 2013"
SCENESTART="00:00:01"
SCENEDURATION="00:00:09"
OUTPUTFILE="ssh_basic_1"
}

The following is the script I am running. The ${OUTPUTFILE} being used is a small 2 minute video I create in screen-o-matic in MP4 format.

Script on PasteBin (too long for Super User post)

© Super User or respective owner

Related posts about bash

Related posts about ffmpeg