Differences between revisions 3 and 4
Revision 3 as of 2010-09-30 12:26:11
Size: 1161
Editor: csr
Comment:
Revision 4 as of 2010-10-15 07:02:04
Size: 1985
Editor: csr
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== The Naive Approach ==
Line 12: Line 14:

== The Seamless Approach ==

The naive approach sometimes fails. It produces demuxed files which cause HandBrake to stall at the breaks between the original files. (One example is {{{drhd_2009-11-13_21-15-00.xml}}}.)

An alternative is to concatenate the raw transport stream files prior to demuxing. A command line example for the given program looks like
{{{
#!/bin/bash

cat /bitarkiv/0244/files/mux2.1258142400-2009-11-13-21.00.00_1258146000-2009-11-13-22.00.00_dvb1-2.ts /bitarkiv/0244/files/mux2.1258146000-2009-11-13-22.00.00_1258149600-2009-11-13-23.00.00_dvb1-2.ts | dd bs=1880 skip=1191177 count=4367650 | vlc - --program=2030 --demux=ts --intf dummy --play-and-exit --noaudio --novideo --sout '#std{access=file,mux=ts,dst=seamless.ts}'
}}}
This seems to work much better.

The Naive Approach

The following recipe works for mux2:

dd if=mux2.ts bs=1024 skip=488281 | vlc - --program 2000 --demux=ts --intf dummy --play-and-exit --noaudio --novideo --sout '#std{access=file,mux=ts,dst=foobar_first.ts}'
vlc mux2.ts --program 2000 --demux=ts --intf dummy --play-and-exit --sout-file-append --noaudio --novideo --sout '#std{access=file,mux=ts,dst=foobar_first.ts}'
dd if=mux2.ts bs=1024 count=488281 | vlc - --program 2000 --demux=ts --intf dummy --play-and-exit --sout-file-append --noaudio --novideo --sout '#std{access=file,mux=ts,dst=foobar_first.ts}'
HandBrakeCLI -i foobar_first.ts -r 24 -e x264 -E faac --crop 0:0:0:0 --height 240 --vb 400 --optimize -o foobar.mp4

Note that it uses vlc as a demuxer and HandBrake as a transcoder. The bitrate (-r 24) video codec (-e x264) and audio codec (-E faac) are all necessary for successful streaming in Wowza. The test was with vlc 1.1.2 and HandBrakeCLI version svn3510 on Ubuntu Linux.

To speed up HandBrakeCLI one can pass additional x264 options: -x subq=1:nob_adapt:bframes=1:threads=auto:keyint=1000. This seems to give about a 50% total speedup compared with default values.

The Seamless Approach

The naive approach sometimes fails. It produces demuxed files which cause HandBrake to stall at the breaks between the original files. (One example is drhd_2009-11-13_21-15-00.xml.)

An alternative is to concatenate the raw transport stream files prior to demuxing. A command line example for the given program looks like

cat /bitarkiv/0244/files/mux2.1258142400-2009-11-13-21.00.00_1258146000-2009-11-13-22.00.00_dvb1-2.ts /bitarkiv/0244/files/mux2.1258146000-2009-11-13-22.00.00_1258149600-2009-11-13-23.00.00_dvb1-2.ts | dd bs=1880 skip=1191177 count=4367650 | vlc - --program=2030 --demux=ts --intf dummy --play-and-exit --noaudio --novideo --sout '#std{access=file,mux=ts,dst=seamless.ts}'

This seems to work much better.

ClipAndGlue (last edited 2010-11-01 11:37:20 by csr)