1. The Problem
Video files, once finalized, can usually not be used across different devices and applications without further format conversion. DVD players, DLNA clients and set-top boxes have different requirements in terms of their acceptable input format.
- Receivers that play network media via DLNA require their own special format input format they can decode. While this is vendor specific, there is also a difference whether you play media from a USB stick or via a DLNA shared network share.
- DVD burn programs accept a limited number of input formats. In addition, software like Apples iDVD has the nasty habit of re-encoding the provided source material and this does not necessarily improve the video quality, very often the opposite is the case. I recommend to keep control over the burn process without using application that can only be partially controlled, i.e. let’s go back to the good old command line.
2. A (specific) solution
It is impossible to provide a recipe for converting all input formats into all output formats. In the following I will describe one way to create suitable video files for use with
- DVD media, containing a video track and data in parallel, without quality degradation of the video;
- HUMAX iCORD+ digital satellite receiver, playing media via USB and network DLNA;
The goal is to provide a OS independent solution, which can be applied on Mac OSX, Windows and Linux platforms. You may however be able to easily adapt the process to your needs through changing some parameters.
To be able to burn from the command line, a suite of good old tools are required: ffmpeg, dvdauthor, mkisofs and hdiutils.
2.1. Preparing the source material
2.2 Imagery and the slideshow
I am shooting in Nikon raw format and import the .nef files into Adobe’s Lightroom software. In this process Lightroom 4 is used. Once the images have been select and processed to my satisfaction in Lightroom, a slide show is created using the export video option. When saving the video, I used the 1080i video template, which produces full HD video in the format of an mp4 video file. Make sure the transitions between the slides look great, if you see artifacts here, they will be worse in the final mpg video due to the conversion process.
Deliverable of this process : file.mp4
A great tool to check the video format is ffmpeg.
ffmpeg -i file.mp4
will output plenty of detail about your video file.
2.3 Creating .wav files from the recording
From within Cubase, the recorded, edited and master files will be exported as 16bit, 44kHz .wav files. This format is standard CD format and be burned to an audio CD without further modification, and also imports into most other applications.
2.3.1 Creating an audio CD from *.wav files using command line tools
$ cdrecord -v -speed=4 -dao -audio ./audio.wav
writes the audio.wav file to CD with 4x speed and in digital audio format, and closes the session.
$ cdrecord -v -speed=4 -dao -audio ./subdir/*.wav
writes all *.wav files from directory “subdir” to CD and closes the session.
2.3.2 Converting .wav files into other formats
$ ffmpeg -i $1.wav -ab 320000 $1.mp3 $1.flac -c alac
will convert $1.wav into an mp3 file with 320kbps and to the flac lossless audio file format.
Converting mp4 into avi -> DLNA distribution
Creating an audio CD from discrete audiotracks
Converting mp4 into mpg and vob -> DVD creation
Building the DVD structure
Building the DVD structure works best with dvdauthor. It will create an AUDIO_TS and VIDEO_TS folder structure and create the *.vob files from the mpeg file given. The command is the following:
$ dvdauthor -o outputdir -f file.mpg
Creating an ISO image containing the DVD structure
$ mkisofs -dvd-video -o image.iso -R -J -r DIRECTORY/
The line above creates a dvd compliant isofile with Windows (-J) and UNIX (-R) compatible file names and at least readable (-r) dvd content.
Burning the DVD structure
$ hdiutil burn image.iso -noverifyburn -speed 8 -forceclose
The line above burns the image to the default burner without verification, with speed 8 and will close the session.
In case of a DVD RW the medium can be formatted adding the erase switch:
$ hdiutil burn image.iso -erase -noverifyburn -speed 8 -forceclose
========================================================================
In the following short post, i will look into how to convert raw DSLR images into files that can be further processed.
Devices and Software participating in this process are:
- Nikon DSLR producing .NEF output files;
- MacOS Lightroom 4;
- ffmpeg open source video conversion software (available on any platform);
- iDVD authoring software on MacOSX ( of course );
- HUMAX ICORD+ Digital Set-top box playing DLNA resources;
Here is the process step by step
- Take pictures with your digital camera import them into Lightroom;
- Export your selection via the slideshow option into a movie using a 1080i 25fps format. The latter will produce a mp4 file. It is important that the output does already have the right format, i.e. converting from NTSC to PAL does not make the quality necessarily better. Stay in one world. This file will be your source for the next steps. Make sure it is great!
- Converting this video file and making a perfectly looking DVD of it, is a humble process, which can be best taken using open source tools.
- HUMAX on the other side requires a DIVX or AVI type input file. Recognize something ? We may be lucky and can get away with producing a single intermediate format. -> we will have to produce a good avi file. Let’s go…
- The best program to convert any file into anything is ffmpeg. The following simple command line will do the job:
- $ ffmpeg -i input_file.whatever -y -sameq output.avi
- The output file, once made available via the DLNA server, can now be played by the Humax receiver.
- For the iDVD processing we have to launch iDVD and drag and drop the file to the DVD production. iDVD has the nasty habit or re-encoding whatever it gets and the avi format – assuming it has maximum quality – will serve well for this purpose.
- Burn your DVD and off you go!
References:
http://mikiwiki.org/wiki/mkisofs