You are not logged in.

#1 2008-01-22 22:45:40

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

mkv to something

I, umh, have a question regarding Video convertion...
I have a certain friend whose machine (he uses windows...) for some reason won't play mkv no mater which codec he installs (the strange thing is that his machine runs nice ogm...)
So he asked me to convert for him some anime series which are in mkv to something:
ogm with both audio streams and the several sub options perserved OR
avi with japanese audio stream and the english subtitles applied.

I did some googling, but there were just suggestion like: "use mkvextract, the merge, etc"
As it's the semester's end I'm quite busy studing and as I couldn't figure out how the fuck mkvextract works (all it did on my sistem was show >>> and then hang...) I didn't bother reading the man pages since I had already lost too much time... So I would be really grateful if someone could tell me step by step what I should do...

BTW I tried googling mkv to ogm linux and the only pages that actually could contain useful information are in french...


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#2 2008-01-22 23:06:47

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

Re: mkv to something

Hello!

mkv to dvd-iso are alright or you only want avi?
A useful program:
http://www.rastersoft.com/programas/devede.html

Cool english tutorial:
http://forum.videohelp.com/topic268844.html

I could help with the french page if you want...

Normally, you can try this to mkv->avi with mencoder:

mencoder /path/video.mkv -oac mp3lame -ovc copy -o /path/videooutput.avi

@+

Last edited by Shaika-Dzari (2008-01-22 23:09:02)

Offline

#3 2008-01-23 06:44:14

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: mkv to something

Thank you for the reply very much! Tried using mencoder, but after 33 % it gives me:

Too many audio packets in the buffer: (4096 in 893439 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Error and stops... anyway I tried playing the file and the quality is terrible... I'll try to use the program you mentioned in your post.


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#4 2008-01-23 07:32:25

Ugge
Member
Registered: 2006-11-11
Posts: 9

Re: mkv to something

You need a splitter to play mkv in dshow based players.
http://haali.cs.msu.ru/mkv/

Also, you shouldnt convert mkv to avi. Avi is a shitty format which does not support alot of what matroska does.

Last edited by Ugge (2008-01-23 07:34:49)

Offline

#5 2008-01-23 09:00:31

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: mkv to something

MKV is a container so you have to look what codec is used in the video track. If he has videolan (vlc) installed, then I am most certain that is it h.264 codec. Try coreplayer wich has h.264 decoder.

Find out the codec in mkv container.
pacman -s mkvtoolnix && mkvextract video.mkv

There is a bug in mencoder to work directly with mkv files.

This works
- extract audio track with mkvextract and encode audio if needed with mencoder
- encode video from mkv to whatever, use option -nosound and remember multipass for quality
- mkvmerge audio and video files to mkv
- be carefull not to lose frames or audio is unsynced

example script layout:

# lets find the audio track number (works if one audio track, like usually)
AUDIOTRACKNRO=$(mkvinfo $PATHSRC/$FILENAME | grep audio -B2 | head -n1 | awk {'print $NF'})
if [[ $AUDIOTRACKNRO -ge 1 && $AUDIOTRACKNRO -le 20 ]];then
   # lets copy the audio track
   nice -n 17 mkvextract tracks $PATHSRC/$FILENAME $AUDIOTRACKNRO:$PATHTEMP/$FILENAME.audio

   if [[ $? == 0 ]];then
      # 1-pass of video track, no audio
      nice -n 17 mencoder $PATHSRC/$FILENAME -vf scale,harddup,softskip -zoom -xy 960 -nosound -ovc xvid \
        -xvidencopts pass=1:turbo \
        -passlogfile $PATHLOGS/$FILENAME.log -o /dev/null

      if [[ $? == 0 ]];then
         # 2-pass of video track, no audio
         nice -n 17 mencoder $PATHSRC/$FILENAME -vf scale,harddup,softskip -zoom -xy 960 -o $PATHTEMP/$FILENAME.avi -nosound -ovc xvid \
           -xvidencopts pass=2:noqpel:quant_type=mpeg:bitrate=2250 \
           -passlogfile $PATHLOGS/$FILENAME.log

         if [[ $? == 0 ]];then
            # merge audio and encoded video tracks
            nice -n 17 mkvmerge -o $PATHFIN/$OUTPUTFILENAME $PATHTEMP/$FILENAME.audio $PATHTEMP/$FILENAME.avi
         fi
      fi
   fi
fi

Last edited by Purch (2008-01-23 09:23:58)

Offline

#6 2008-01-23 09:42:14

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: mkv to something

When I use my old windows machine to watch anime I use VLC to play mkvs... no need for codecs.  Otherwise the "combined community codec package" (or something like that) gets mkvs playing in Windows Media Player.  I have also used an mplayer port.

Not the question you asked but hope it helps...

Offline

#7 2008-01-23 18:58:59

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: mkv to something

@Allan My friend tried vlc but it doesn't play mkv for him either.
@Purch Many thanks! I'll try this as soon as I have time.

If anyone knows some useful info - don't hesitate to share.


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

Board footer

Powered by FluxBB