You are not logged in.

#1 2008-05-12 06:08:05

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

[solved] MKV files

I have several .avi files with respective .srt subtitle files. I understand that the .mkv container is able to hold the video as well as subtitles. Is there any programme out there which can combine a .avi video file and a .srt subtitle file into one .mkv video+subtitle file?

Last edited by tony5429 (2008-05-23 12:01:00)

Offline

#2 2008-05-12 07:33:32

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: [solved] MKV files

Install mkvtoolnix (in Extra) and use the mkvmerge command. It should be as simple as 'mkvmerge -o out.mkv in.avi in.srt'.

Offline

#3 2008-05-12 08:39:58

kezar
Member
Registered: 2007-08-14
Posts: 61

Re: [solved] MKV files

The GUI is in the package too. Start mmg wink

Offline

#4 2008-05-12 10:57:43

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: [solved] MKV files

What could I use if I want to render the subtitles directly on the video track?

Offline

#5 2008-05-12 11:00:47

insane74
Member
Registered: 2008-05-11
Posts: 16

Re: [solved] MKV files

sorry for the intrusion, but what app to do an avi from an mkv file?


Dell XPS 1530: Core 2 Duo T7500@2,2ghz, 2gb, HD 200gb@7200rpm, 8600GT 256mb, Monitor 15,4"@1680x1050, WiFi N, Bluetooth, D-Link DNS-323 with 2x WD CAVIAR SE 500 GB, D-Link DSL-2740B

Offline

#6 2008-05-12 11:21:50

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: [solved] MKV files

Why would you want to do that? mkv is a superior format, damned divx players

you can use ffmpeg
First you have to extract the audio and video tracks from the mkv container and then remux them with ffmpeg

mkvextract tracks FILE.mkv 1:temp_video 2:temp_audio
ffmpeg -i temp_video -i temp_video -vcodec copy FILE.avi

Remember that the name of the tracks might change, so you should check it with mkvmerge -i FILE.mkv before.
Remember that avi isn't fit to store the h264 codec.

Offline

#7 2008-05-12 11:47:33

insane74
Member
Registered: 2008-05-11
Posts: 16

Re: [solved] MKV files

carlocci wrote:

Why would you want to do that? mkv is a superior format, damned divx players

you can use ffmpeg
First you have to extract the audio and video tracks from the mkv container and then remux them with ffmpeg

mkvextract tracks FILE.mkv 1:temp_video 2:temp_audio
ffmpeg -i temp_video -i temp_video -vcodec copy FILE.avi

Remember that the name of the tracks might change, so you should check it with mkvmerge -i FILE.mkv before.
Remember that avi isn't fit to store the h264 codec.

you say it! damned divx player! lol
btw, thanks! i'll try! wink


Dell XPS 1530: Core 2 Duo T7500@2,2ghz, 2gb, HD 200gb@7200rpm, 8600GT 256mb, Monitor 15,4"@1680x1050, WiFi N, Bluetooth, D-Link DNS-323 with 2x WD CAVIAR SE 500 GB, D-Link DSL-2740B

Offline

#8 2008-05-14 23:36:09

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: [solved] MKV files

carlocci wrote:

What could I use if I want to render the subtitles directly on the video track?

mencoder does that but only supports srt subtitles, and mplayer developers plan to scratch it and write better code which will share more mplayer code. There are some patches to support ass subtitles I believe.

avidemux supports ass subtitles rendering

Offline

#9 2008-05-14 23:54:59

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: [solved] MKV files

I just done this but it doesn't quite work with them all and is very much work in progress. I just have it as a bash function but would work as a script.

mkvmerge -i "$1" | grep Track
echo "Which Track for Subtitles"
read track
mkvextract tracks "$1" "$track":temp_subs
out="nosub"
mencoder "$1" -oac copy -ovc copy -o $out
echo "New Title for $1"
read title
transcode -i "$out" -x mplayer="-sub temp_subs" -o $title.avi -y xvid

It's the transcode line that does the magic.

Thanks go to this thread much was inspired by this thread.

Last edited by FeatherMonkey (2008-05-14 23:55:54)

Offline

#10 2008-05-17 06:26:48

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [solved] MKV files

Hrm... For some reason mkvmerge is working alright (I'm using mmg) except... when I open any mkv files made with the software and try to fast forward on VLC, VLC can't seem to do it - the video freezes up... Any ideas anyone? Is it a VLC issue or mkvtoolnix bug?

Offline

#11 2008-05-17 06:33:42

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,556

Re: [solved] MKV files

tony5429 wrote:

Hrm... For some reason mkvmerge is working alright (I'm using mmg) except... when I open any mkv files made with the software and try to fast forward on VLC, VLC can't seem to do it - the video freezes up... Any ideas anyone? Is it a VLC issue or mkvtoolnix bug?

I've seen VLC (using git version ATM) crash every single time when using << or >> on a .mkv file. However, I have no idea about the tool that had been used to create this .mkv (yes I have only one). FTR, the same file works OK with mplayer.

Offline

#12 2008-05-17 06:44:13

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [solved] MKV files

tony5429 wrote:

I have several .avi files with respective .srt subtitle files. I understand that the .mkv container is able to hold the video as well as subtitles. Is there any programme out there which can combine a .avi video file and a .srt subtitle file into one .mkv video+subtitle file?

FFmpeg can do it provided that the version is new enough. I don't know if the one in the repos is:

ffmpeg -map 0:0 -map 1:0 -i <your_video> -i <your_subtitle> -vcodec copy -acodec copy -scodec copy <your_output>.mkv

Also, GPAC (available in AUR) may also be a usable solution. It's far easier than other command line options once you get to know it, but it's also far more limited in it's abilities.

Last edited by skottish (2008-05-17 07:05:53)

Offline

#13 2008-05-23 03:02:12

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [solved] MKV files

Well, since the last update of VLC, it seems that VLC is correctly playing the mkv files I've created with mkvtoolnix (fast forwarding is working fine) with one exception: namely, my subtitles are not showing up. I happen to have an mkv file which I did not create with mkvtoolnix (I do not know what program it was created with) and the subtitles on it work fine in VLC. VLC also seems to display subtitles on ISO DVD images with no problem. Has anyone else had this problem? I have also never been able to play an AVI file in VLC with subtitles from an SRT file by drag-and-dropping the subtitle file onto the player as I have been able to using the Windows build of VLC.

Last edited by tony5429 (2008-05-23 11:54:48)

Offline

#14 2008-05-23 12:00:36

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [solved] MKV files

Actually, I will start a new post as this seems to be a VLC issue and change this discussion's title to [solved].

Offline

#15 2008-08-30 01:23:54

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: [solved] MKV files

skottish wrote:
tony5429 wrote:

I have several .avi files with respective .srt subtitle files. I understand that the .mkv container is able to hold the video as well as subtitles. Is there any programme out there which can combine a .avi video file and a .srt subtitle file into one .mkv video+subtitle file?

FFmpeg can do it provided that the version is new enough. I don't know if the one in the repos is:

ffmpeg -map 0:0 -map 1:0 -i <your_video> -i <your_subtitle> -vcodec copy -acodec copy -scodec copy <your_output>.mkv

Also, GPAC (available in AUR) may also be a usable solution. It's far easier than other command line options once you get to know it, but it's also far more limited in it's abilities.

When i try to do this with a .srt subtitle ffmpeg outputs:

[avi @ 0xb7f776f4]non-interleaved AVI
Input #0, avi, from 'Ghost_in_the_Shell.avi':
  Duration: 01:22:49.75, start: 0.000000, bitrate: 2145 kb/s
    Stream #0.0: Video: h264, yuv420p, 1920x1040 [PAR 13312:13311 DAR 8192:4437], 23.98 tb(r)
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Ghost_in_the_Shell.srt: Unknown format

and i found that, (if i do it with mkvmerge) if the subtitle has non english letters, say ñ or á,é,í,ó,ú the subtitle doesn't display correctly when played from the mkv

Last edited by leo2501 (2008-08-30 14:59:55)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

Board footer

Powered by FluxBB