<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: How to convert matroska MKV to AVI on Linux ?</title>
	<atom:link href="http://www.larsen-b.com/Article/261.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.larsen-b.com/Article/261.html</link>
	<description>Titanium Exposé</description>
	<pubDate>Thu, 20 Nov 2008 14:16:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: DaveC</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6826</link>
		<dc:creator>DaveC</dc:creator>
		<pubDate>Thu, 23 Oct 2008 22:39:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-6826</guid>
		<description>mencoder has long been the most flexible OSS tool for producing and repacking AVI's ... ffmpeg is more useful at low level stuff where you need to re-encode.

using -ovc copy is both better and much faster, as it avoids re-encoding the video .... also mencoder's default settings for video encoding are designed around non-HD quality and internet streaming, and you'll end up having to dink around. I'm sticking with -oac lavc and leaving it to re-encode to the default non-Dolby "DVD style" audio (2 x 48kHz) since I don't have surround sound set up yet and the file sizes are about 10% smaller.

My goal is to get stuff to play on the Sony PS3 which has become our DVD player - it happily plays files from CD-R and DVD-R (and presumably BD-RE though the blanks are kind pricey :-) and it will play AVI's in HDTV formats, but it does not (as of the latest PS3 OS build) speak Matroska and likely never will (Sony being pro-proprietary)</description>
		<content:encoded><![CDATA[<p>mencoder has long been the most flexible OSS tool for producing and repacking AVI&#8217;s &#8230; ffmpeg is more useful at low level stuff where you need to re-encode.</p>
<p>using -ovc copy is both better and much faster, as it avoids re-encoding the video &#8230;. also mencoder&#8217;s default settings for video encoding are designed around non-HD quality and internet streaming, and you&#8217;ll end up having to dink around. I&#8217;m sticking with -oac lavc and leaving it to re-encode to the default non-Dolby &#8220;DVD style&#8221; audio (2 x 48kHz) since I don&#8217;t have surround sound set up yet and the file sizes are about 10% smaller.</p>
<p>My goal is to get stuff to play on the Sony PS3 which has become our DVD player - it happily plays files from CD-R and DVD-R (and presumably BD-RE though the blanks are kind pricey :-) and it will play AVI&#8217;s in HDTV formats, but it does not (as of the latest PS3 OS build) speak Matroska and likely never will (Sony being pro-proprietary)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evert</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6821</link>
		<dc:creator>Evert</dc:creator>
		<pubDate>Mon, 13 Oct 2008 16:35:45 +0000</pubDate>
		<guid isPermaLink="false">#comment-6821</guid>
		<description>So which is better/quicker to use? ffmpeg or mencoder?  8-)</description>
		<content:encoded><![CDATA[<p>So which is better/quicker to use? ffmpeg or mencoder?  8-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timo</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6814</link>
		<dc:creator>Timo</dc:creator>
		<pubDate>Tue, 07 Oct 2008 21:58:30 +0000</pubDate>
		<guid isPermaLink="false">#comment-6814</guid>
		<description>Martin: that also re-encodes the streams, better use copy. Also, basename matches first '.', which means that foo.bar.mkv becomes foo.avi..

Maybe use best of both approaches, and modify the original to just have:

message("Converting %s to %s.avi" % (filename, basename))
os.system("mencoder %s -ovc copy -oac copy -o %s.avi" % (filename, basename) )</description>
		<content:encoded><![CDATA[<p>Martin: that also re-encodes the streams, better use copy. Also, basename matches first &#8216;.&#8217;, which means that foo.bar.mkv becomes foo.avi..</p>
<p>Maybe use best of both approaches, and modify the original to just have:</p>
<p>message(&#8221;Converting %s to %s.avi&#8221; % (filename, basename))<br />
os.system(&#8221;mencoder %s -ovc copy -oac copy -o %s.avi&#8221; % (filename, basename) )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6782</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Tue, 16 Sep 2008 13:47:22 +0000</pubDate>
		<guid isPermaLink="false">#comment-6782</guid>
		<description>::SIGH:: 

I realize that people tend to "think" in their favorite language, but isn't using python for this sort of like swatting a fly with a sledgehammer?

#!/bin/bash
[[ -z "$1" ]] &#38;&#38; echo "usage: $0 filename" &#38;&#38; exit
mencoder $1 -ovc lavc -oac lavc -o `basename $1 .${1#*.}`.avi</description>
		<content:encoded><![CDATA[<p>::SIGH:: </p>
<p>I realize that people tend to &#8220;think&#8221; in their favorite language, but isn&#8217;t using python for this sort of like swatting a fly with a sledgehammer?</p>
<p>#!/bin/bash<br />
[[ -z "$1" ]] &amp;&amp; echo &#8220;usage: $0 filename&#8221; &amp;&amp; exit<br />
mencoder $1 -ovc lavc -oac lavc -o `basename $1 .${1#*.}`.avi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6702</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 02 Aug 2008 13:26:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-6702</guid>
		<description>To import the sub you can use Avidemux. I used this software a couple of times without issue.</description>
		<content:encoded><![CDATA[<p>To import the sub you can use Avidemux. I used this software a couple of times without issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel P. Clark</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6701</link>
		<dc:creator>Daniel P. Clark</dc:creator>
		<pubDate>Sat, 02 Aug 2008 13:19:28 +0000</pubDate>
		<guid isPermaLink="false">#comment-6701</guid>
		<description>What about importing the subtitles into the target avi?</description>
		<content:encoded><![CDATA[<p>What about importing the subtitles into the target avi?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6670</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Sun, 13 Jul 2008 16:19:55 +0000</pubDate>
		<guid isPermaLink="false">#comment-6670</guid>
		<description>To Yoshii, this script needs you to tab in some things to work...

#!/usr/bin/python
# Little script to depack Matroska file, and repack them
# in a AVI + subtitle format.

import sys
import os

def message(msg):
TAB---&#62;print "=" * 78
TAB---&#62;print "= %s" % msg
TAB---&#62;print "=" * 78

def usage():
TAB---&#62;print "Mastroka repacker script"
TAB---&#62;print "  Usage: "+sys.argv[0]+ " filename"

if __name__ == "__main__":
TAB---&#62;if len(sys.argv) TAB---&#62;usage()
TAB---&#62;else:
TAB---&#62;TAB---&#62;filename = sys.argv[1]
TAB---&#62;TAB---&#62;basename = filename[:-4]

message("Unpacking file: %s" % filename)
os.system("mkvextract tracks %s 1:temp_video.avi 2:temp_audio.ogg 3:%s.srt" % (filename,basename) )

message("Repacking file: %s.avi" % basename)
os.system("ffmpeg -i temp_audio.ogg  -i temp_video.avi  -vcodec copy  %s.avi" % (basename) )

message("Cleaning files")
os.system("rm temp_video.avi temp_audio.ogg")</description>
		<content:encoded><![CDATA[<p>To Yoshii, this script needs you to tab in some things to work&#8230;</p>
<p>#!/usr/bin/python<br />
# Little script to depack Matroska file, and repack them<br />
# in a AVI + subtitle format.</p>
<p>import sys<br />
import os</p>
<p>def message(msg):<br />
TAB&#8212;&gt;print &#8220;=&#8221; * 78<br />
TAB&#8212;&gt;print &#8220;= %s&#8221; % msg<br />
TAB&#8212;&gt;print &#8220;=&#8221; * 78</p>
<p>def usage():<br />
TAB&#8212;&gt;print &#8220;Mastroka repacker script&#8221;<br />
TAB&#8212;&gt;print &#8221;  Usage: &#8220;+sys.argv[0]+ &#8221; filename&#8221;</p>
<p>if __name__ == &#8220;__main__&#8221;:<br />
TAB&#8212;&gt;if len(sys.argv) TAB&#8212;&gt;usage()<br />
TAB&#8212;&gt;else:<br />
TAB&#8212;&gt;TAB&#8212;&gt;filename = sys.argv[1]<br />
TAB&#8212;&gt;TAB&#8212;&gt;basename = filename[:-4]</p>
<p>message(&#8221;Unpacking file: %s&#8221; % filename)<br />
os.system(&#8221;mkvextract tracks %s 1:temp_video.avi 2:temp_audio.ogg 3:%s.srt&#8221; % (filename,basename) )</p>
<p>message(&#8221;Repacking file: %s.avi&#8221; % basename)<br />
os.system(&#8221;ffmpeg -i temp_audio.ogg  -i temp_video.avi  -vcodec copy  %s.avi&#8221; % (basename) )</p>
<p>message(&#8221;Cleaning files&#8221;)<br />
os.system(&#8221;rm temp_video.avi temp_audio.ogg&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: earthforce_1</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6661</link>
		<dc:creator>earthforce_1</dc:creator>
		<pubDate>Tue, 01 Jul 2008 15:53:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-6661</guid>
		<description>Ok, figured out an answer to my own question, and got it down to one line with no intermediate files.  Your modified .py script becomes:

#!/usr/bin/python
# Little script to depack Matroska file, and repack them
# in a AVI + subtitle format.

import sys
import os

def message(msg):
	print "=" * 78
	print "= %s" % msg
	print "=" * 78

def usage():
	print "Mastroka repacker script"
	print "  Usage: "+sys.argv[0]+ " filename"

if __name__ == "__main__":
	if len(sys.argv) &#60; 2:
		usage()
	else:
		filename = sys.argv[1]
		basename = filename[:-4]
 		message("Converting file: %s" % filename)
		os.system("mencoder %s -ovc lavc -oac lavc -o %s.avi" % (filename,basename) )</description>
		<content:encoded><![CDATA[<p>Ok, figured out an answer to my own question, and got it down to one line with no intermediate files.  Your modified .py script becomes:</p>
<p>#!/usr/bin/python<br />
# Little script to depack Matroska file, and repack them<br />
# in a AVI + subtitle format.</p>
<p>import sys<br />
import os</p>
<p>def message(msg):<br />
	print &#8220;=&#8221; * 78<br />
	print &#8220;= %s&#8221; % msg<br />
	print &#8220;=&#8221; * 78</p>
<p>def usage():<br />
	print &#8220;Mastroka repacker script&#8221;<br />
	print &#8221;  Usage: &#8220;+sys.argv[0]+ &#8221; filename&#8221;</p>
<p>if __name__ == &#8220;__main__&#8221;:<br />
	if len(sys.argv) &lt; 2:<br />
		usage()<br />
	else:<br />
		filename = sys.argv[1]<br />
		basename = filename[:-4]<br />
 		message(&#8221;Converting file: %s&#8221; % filename)<br />
		os.system(&#8221;mencoder %s -ovc lavc -oac lavc -o %s.avi&#8221; % (filename,basename) )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yoshii</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-6631</link>
		<dc:creator>Yoshii</dc:creator>
		<pubDate>Mon, 16 Jun 2008 07:54:11 +0000</pubDate>
		<guid isPermaLink="false">#comment-6631</guid>
		<description>Hi i got an error when i tried this script,
I put this script into a file called mkvtoavi and made it executeable
then in bash#


./mkvtoavi
  File "./mkvtoavi", line 9
    print "=" * 78
        ^
IndentationError: expected an indented block


And i am not really good with scriptprogramming. but it seems it's something thats missing :( please reply to my email as soon as you can :)</description>
		<content:encoded><![CDATA[<p>Hi i got an error when i tried this script,<br />
I put this script into a file called mkvtoavi and made it executeable<br />
then in bash#</p>
<p>./mkvtoavi<br />
  File &#8220;./mkvtoavi&#8221;, line 9<br />
    print &#8220;=&#8221; * 78<br />
        ^<br />
IndentationError: expected an indented block</p>
<p>And i am not really good with scriptprogramming. but it seems it&#8217;s something thats missing :( please reply to my email as soon as you can :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.larsen-b.com/Article/261.html#comment-4270</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 22 May 2008 06:06:14 +0000</pubDate>
		<guid isPermaLink="false">#comment-4270</guid>
		<description>No, the quality remains the same. In fact, it's only a repack, not a real convert</description>
		<content:encoded><![CDATA[<p>No, the quality remains the same. In fact, it&#8217;s only a repack, not a real convert</p>
]]></content:encoded>
	</item>
</channel>
</rss>
