<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Die Welt ist gar nicht so. &#187; mplayer</title>
	<atom:link href="http://blog.dieweltistgarnichtso.net/tag/mplayer/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.dieweltistgarnichtso.net</link>
	<description>Sie ist ganz anders.</description>
	<lastBuildDate>Mon, 23 Sep 2013 15:41:20 +0000</lastBuildDate>
	<language>de-DE</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.35</generator>
	<item>
		<title>Fixing dropped frames in digital video</title>
		<link>http://blog.dieweltistgarnichtso.net/fixing-dropped-frames-in-digital-video</link>
		<comments>http://blog.dieweltistgarnichtso.net/fixing-dropped-frames-in-digital-video#comments</comments>
		<pubDate>Sun, 10 Jun 2012 23:32:28 +0000</pubDate>
		<dc:creator><![CDATA[erlehmann]]></dc:creator>
				<category><![CDATA[Bastelei]]></category>
		<category><![CDATA[In eigener Sache]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[dv]]></category>
		<category><![CDATA[fotografiona]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[spackeriade]]></category>

		<guid isPermaLink="false">http://blog.dieweltistgarnichtso.net/?p=4795</guid>
		<description><![CDATA[Occasionally, when capturing DV, data is generated faster than it can be saved, thus audio and video frames are dropped. The resulting small gaps in the recording are noticeable at playback time as footage appears sped up and choppy, AV-sync &#8230; <a href="http://blog.dieweltistgarnichtso.net/fixing-dropped-frames-in-digital-video">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>
Occasionally, when capturing <a href="http://en.wikipedia.org/wiki/DV">DV</a>, data is generated faster than it can be saved, thus audio and video frames are dropped. The resulting small gaps in the recording are noticeable at playback time as footage appears sped up and choppy, <a href="http://en.wikipedia.org/wiki/Audio_to_video_synchronization"><abbr title="Audio-Video">AV</abbr>-sync</a> being lost occasionally. For most people, those recordings are unwatchable.
</p>
<p>
Obviously the lost data cannot be recovered. The symptoms however – stuttering and uncomfortable playback speed – can be remedied somewhat by interpolating the missing audio frames. Assuming a file with a nominal framerate of 25 <a href="http://en.wikipedia.org/wiki/Frame_rate"><abbr title="frames per second">FPS</abbr></a> that had every second frame dropped, this can easily be achieved using <a href="http://www.mplayerhq.hu/"><i>mplayer</i></a> for playback at half speed:
</p>
<kbd>mplayer -af scaletempo=stride=16:overlap=.25:search=10 -speed 0.5 -fps 25 example.dv</kbd>
<p>
The important piece is the <a href="http://scaletempo.sourceforge.net/0/"><i>scaletempo</i></a> filter, which can <a href="http://en.wikipedia.org/wiki/Audio_timescale-pitch_modification">change audio speed without altering the pitch</a>. Without it, speech played at half its original speed has more resemblance to <a href="http://en.wikipedia.org/wiki/Goa%27uld"><i>Goa&#8217;uld</i></a> utterances than to real-world language. Unfortunately, this approach is limited by the <a href="http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem">sampling theorem</a>: If too many audio frames are missing, the result will sound like it was created using a bad mobile phone.
</p>
<p>
Though missing video frames could also be interpolated to smooth jerky movements, simply duplicating frames is adequate for real-world usage. The following shell script utilizes <i>mplayer</i> and <i>mencoder</i> to interpolate audio and duplicate video frames, creating a file that should be easier on viewers&#8217; eyes and ears than the original – broken – recording.
</p>
<kbd>
mplayer -af scaletempo=stride=16:overlap=.25:search=10 -speed 0.5 -fps 25 example.dv -vc null -vo null -ao pcm:waveheader:file=example.wav &amp;&amp; mencoder -fps 12.5 -ofps 25 -ovc copy -oac copy -o example-fixed.dv example.dv -audiofile example.wav &#038;&#038; rm example.wav
</kbd>
<p>
For an example recording processed using this method, see the <a href="http://daten.dieweltistgarnichtso.net/video/talks/fickileaks.ogv">video</a> of the <a href="http://lanyrd.com/2011/spack0/smrrw/"><i>Fickileaks</i> talk</a> me and <a href="http://mobile.twitter.com/fotografiona"><i>fotografiona</i></a> gave at the <a href="http://blog.spackeria.org/0-spackeriade/"><i>Spackeriade</i></a>; the original file was missing about every second frame.
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.dieweltistgarnichtso.net/fixing-dropped-frames-in-digital-video/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://daten.dieweltistgarnichtso.net/video/talks/fickileaks.ogv" length="148123843" type="video/ogg" />
		</item>
		<item>
		<title>Mehrfachvideo mit Gstreamer</title>
		<link>http://blog.dieweltistgarnichtso.net/mehrfachvideo-mit-gstreamer</link>
		<comments>http://blog.dieweltistgarnichtso.net/mehrfachvideo-mit-gstreamer#comments</comments>
		<pubDate>Fri, 12 Mar 2010 14:01:04 +0000</pubDate>
		<dc:creator><![CDATA[erlehmann]]></dc:creator>
				<category><![CDATA[Bastelei]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[gstreamer]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[theora]]></category>
		<category><![CDATA[totem]]></category>
		<category><![CDATA[vlc]]></category>

		<guid isPermaLink="false">http://blog.dieweltistgarnichtso.net/?p=1915</guid>
		<description><![CDATA[Der wetter meinte neulich, es könnte doch ganz nützlich sein, mehrere Videostreams in einem Container zu verkapseln; auf diese Weise wäre es etwa bei Vorträgen möglich, eine Ansicht mit Folien und eine weitere mit den Dozenten zu haben. Glücklicherweise geht &#8230; <a href="http://blog.dieweltistgarnichtso.net/mehrfachvideo-mit-gstreamer">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>
Der <a href="http://twitter.com/wetterfrosch"><i>wetter</i></a> meinte neulich, es könnte doch ganz nützlich sein, mehrere Videostreams in einem Container zu verkapseln; auf diese Weise wäre es etwa bei Vorträgen möglich, eine Ansicht mit Folien und eine weitere mit den Dozenten zu haben. Glücklicherweise geht das tatsächlich.
</p>
<p>
Um ein derartiges Video zu erhalten, habe ich zunächst mit <a href="http://www.gstreamer.net/"><i>Gstreamer</i></a> ein Testbildvideo produziert (<a href="http://noraisin.net/~jan/diary/?p=40">dieser Blogeintrag</a> war sehr hilfreich) und dieses dann mit Hilfe der <a href="http://www.xiph.org/oggz/"><i>oggz-tools</i></a> auf 20 Sekunden geschnitten und mit einem von mir vorher aufgenommenen Video zu einem zweispurigen Video (<del datetime="2010-03-12T16:52:50+00:00"><a href="http://daten.dieweltistgarnichtso.net/video/testbild-stereo.ogv">Download</a></del>) gemixt:
</p>
<p>
<kbd>gst-launch-0.10 videotestsrc ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! theoraenc bitrate=500 ! oggmux ! filesink location=testbild.ogv
^C
oggz-chop -o testbild-20s.ogv -e 20 testbild.ogv
oggz-merge -o testbild-stereo.ogv MD000410.ogv testbild-20s.ogv</kbd>
</p>
<p>
Schneller kann man ein eigenes Video mit zwei Testbildern mit folgendem Pipelinemonster erstellen:
</p>
<kbd>gst-launch-0.10 videotestsrc <ins datetime="2010-03-12T17:09:58+00:00">pattern=circular</ins> ! queue ! videorate ! video/x-raw-rgb,rate=15/1 ! ffmpegcolorspace ! theoraenc ! oggmux name=mux ! filesink location=testbild2.ogv videotestsrc ! queue ! videorate ! video/x-raw-rgb,rate=15/1 ! ffmpegcolorspace ! theoraenc ! mux.
^C</kbd>
<p>
Testweise abspielen kann man dieses dann wiederum mit:
</p>
<kbd>gst-launch-0.10 filesrc location=testbild2.ogv ! decodebin name=d ! queue ! xvimagesink d. ! queue ! xvimagesink</kbd>
<p>
Ein praktisches Problem derartiger Dateien ist die Behandlung der Videostreams durch gewöhnliche Abspielsoftware, die im Allgemeinen davon ausgeht, dass verschiedene Streams gleichen Typs nicht gleichzeitig abgespielt werden sollen: Nur <a href="http://videolan.org"><i><abbr title="Videolan Client">VLC</abbr> media player</i></a> öffnet für jeden Videostream ein weiteres Fenster, während <a href="http://www.gnome.org/projects/totem/"><i>Totem</i></a>, <a href="http://www.mplayerhq.hu/design7/info.html"><i>mplayer</i></a> und Webbrowser mit Unterstützung für das <code>&lt;video/&gt;</code>-Element jeweils immer nur einen der beiden Videostreams anzeigen — im besten Fall ist ein Wechsel des abgespielten Streams möglich, ähnlich dem Wechsel der ausgewählten Audiospur.
</p>
<ins datetime="2010-03-12T16:52:50+00:00">
<p>
Das obige, mit <i>oggz-merge</i> erstellte Video ist laut <i>oggz-validate</i> leider nicht valide, ein guter Grund für ein Abspielprogramm, den Dienst zu verweigern. Ein valides, mit der Gstreamer-Monsterpipeline erstelltes Video findet ihr <a href="http://daten.dieweltistgarnichtso.net/video/testbild2-stereo.ogv">hier</a>.
</p>
</ins>
<ins datetime="2010-03-12T17:00:15+00:00">
<p>
Ich werd nicht mehr: Das valide Video wird zwar immer noch von der passenden Gstreamer-Pipeline abgespielt, VLC hingegen stürzt in den meisten Fällen ab — oder <a href="//daten.dieweltistgarnichtso.net/pics/screenshots/fail/vlc-totalversagen.png">versagt sowas von komplett</a> …
</p>
</ins>
<ins datetime="2010-03-12T17:09:58+00:00">
<p>
So, das <a href="http://daten.dieweltistgarnichtso.net/video/testbild2-stereo.ogv">valide Testvideo</a> hat jetzt zwei unterschiedliche Streams, einer zeigt jetzt konzentrische Kreise. Nur, damit niemand verwirrt wird.
</p>
</ins>]]></content:encoded>
			<wfw:commentRss>http://blog.dieweltistgarnichtso.net/mehrfachvideo-mit-gstreamer/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://daten.dieweltistgarnichtso.net/video/testbild-stereo.ogv" length="3402457" type="video/ogg" />
<enclosure url="http://daten.dieweltistgarnichtso.net/video/testbild2-stereo.ogv" length="3540130" type="video/ogg" />
		</item>
	</channel>
</rss>
