subtitles in mkv's don't work

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

subtitles in mkv's don't work

Postby stratos » Tue Mar 17, 2009 12:08 am

Perhaps i'm missing something, or it isn't supposed to support this, but I can't get PS3 Media Server to play MKV's and take their subtitles.
I've tried a wide variety of settings but the mencoder output never selected a subtitle track.

mencoder file.mkv -oac lavc -of mpeg -lavfopts format=asf -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=2 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=384:threads=2:keyint=1:vqscale=1:vqmin=2 -fontconfig -subcp cp1252 -subfont /usr/share/fonts/truetype/msttcorefonts/Arial.ttf -ofps 24000/1001 -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o /tmp/blabla

This is a dump from the info part.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Toaru Majutsu no Index - 23", -vid 0
[mkv] Track ID 2: audio (A_VORBIS) "2.0 Vorbis", -aid 0, -alang jpn
[mkv] Track ID 3: subtitles (S_TEXT/ASS) "ASS", -sid 0, -slang eng
[mkv] Track ID 4: subtitles (S_TEXT/UTF8) "SRT", -sid 1, -slang eng
[mkv] Will play video track 1.
Matroska file format detected.

Setting ASS or any of the other subtitle options on that screen on or off will make the mencoder string slightly different (of course) but never does it add a -slang eng, which would actually select the subtitle track.

subtitle language priority is set to default "eng,fre,jpn,ger"

Any help would be great, i would be more then glad to give any further information.
stratos
 
Posts: 3
Joined: Sun Mar 15, 2009 11:33 am

Re: subtitles in mkv's don't work

Postby shagrath » Tue Mar 17, 2009 1:29 am

make sure (it's earlier in the log), ffmpeg has detected subtitles tracks
there's a summary, something like "Media info of : filename blabla audio: sub: "
shagrath
Project Lead
 
Posts: 2667
Joined: Wed Jan 14, 2009 1:39 pm

Re: subtitles in mkv's don't work

Postby stratos » Tue Mar 17, 2009 6:58 pm

Ah, the log indeed indicates that ffmpeg isn't able to find the subtitles.

Media info of : [Eclipse] Toaru Majutsu no Index - 04 (1280x720 h264) [1288BEE4].mkv / mimeType: video/mp4 / container: matroska / bitrate: 0 / size: 349997161 / codecV: h264 / duration: 00:23:49.300 / width: 1280 / height: 720 / frameRate: null / thumb size : 2535
audio: id=0 / lang: und / codec: vorbis / sf:48000

When i run ffmpeg -i on the file it gives the following output.

FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 16 2009 21:16:26, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
[matroska @ 0xb7f8c110]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 0xb7f8c110]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 0xb7f8c110]Ignoring seekhead entry for ID=0x114d9b74
[matroska @ 0xb7f8c110]Ignoring seekhead entry for ID=0x1043a770
[matroska @ 0xb7f8c110]Ignoring seekhead entry for ID=0x1941a469
[matroska @ 0xb7f8c110]Unknown entry 0x73a4 in info header
[matroska @ 0xb7f8c110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0xaa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0xaa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0xaa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7f8c110]Unknown track header entry 0xaa - ignoring
[matroska @ 0xb7f8c110]Unknown matroska file header ID 0x1941a469
[matroska @ 0xb7f8c110]Unknown matroska file header ID 0x1043a770
Input #0, matroska, from '[Eclipse] Toaru Majutsu no Index - 23 (1280x720 h264) [645D71A5].mkv':
Duration: 00:23:39.6, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1280x720, 23.98 fps(r)
Stream #0.1: Audio: vorbis, 48000 Hz, stereo
Must supply at least one output file


This is the default ffmpeg from the ubuntu 8.04 (hardy) repositories . It's obviously a ffmpeg problem (i think) so I'll try to get a other one or roll my own.
I'll update this thread if i can get it fixed.
stratos
 
Posts: 3
Joined: Sun Mar 15, 2009 11:33 am

Re: subtitles in mkv's don't work

Postby stratos » Sun Mar 22, 2009 12:16 pm

Well i got it working now.

Although the way to get it working was a bit troublesome. I basically just rolled my own ffmpeg.

I didn't use a guide or anything because I used to do this a few years ago as well. But if anyone has this problem then I advise them to seek out a guide for their version of ubuntu (or other distro)

The new output is as follows.

Code: Select all
Input #0, matroska, from '../../Azureus Downloads/[Eclipse] Toaru Majutsu no Index - 23 (1280x720 h264) [645D71A5].mkv':
  Duration: 00:23:39.69, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(jpn): Audio: vorbis, 48000 Hz, stereo, s16
    Stream #0.2(eng): Subtitle: 0x0000
    Stream #0.3(eng): Subtitle: 0x0000
    Stream #0.4: Attachment: 0x0000
    Stream #0.5: Attachment: 0x0000
    Stream #0.6: Attachment: 0x0000
    Stream #0.7: Attachment: 0x0000
    Stream #0.8: Attachment: 0x0000
At least one output file must be specified


And steaming it worked like a charm.
stratos
 
Posts: 3
Joined: Sun Mar 15, 2009 11:33 am

Re: subtitles in mkv's don't work

Postby Valarauko » Sun Apr 12, 2009 9:28 pm

I get pretty much the same output from ffmpeg -i with the version from medibuntu repositories (I'm also running Ubuntu 8.04). I'm not opposed to compiling my own ffmpeg version, as I had to do a couple Ubuntu versions back. Did you use the source for FFmpeg 0.5 from ffmpeg.org? Was there a particular compile option required for the subtitles?
Valarauko
 
Posts: 1
Joined: Sun Apr 12, 2009 9:23 pm

Re: subtitles in mkv's don't work

Postby headconnect » Mon Apr 20, 2009 8:47 pm

Issues here as well... however, ffmpeg gives me this:

Code: Select all
FFmpeg version SVN-r14161, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --prefix=/usr --enable-shared --libdir=/usr/lib --shlibdir=/usr/lib --incdir=/usr/include --enable-liba52 --enable-postproc --enable-gpl --enable-pthreads --enable-libnut --enable-libtheora --enable-libvorbis --enable-x11grab --enable-swscale
  libavutil version: 49.7.0
  libavcodec version: 51.60.0
  libavformat version: 52.17.0
  libavdevice version: 52.0.0
  built on Jan 15 2009 17:41:19, gcc: 4.3.2
[matroska @ 0xb7fdd9b4]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 0xb7fdd9b4]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 0xb7fdd9b4]Ignoring seekhead entry for ID=0x114d9b74
[matroska @ 0xb7fdd9b4]Ignoring seekhead entry for ID=0x1043a770
[matroska @ 0xb7fdd9b4]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7fdd9b4]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7fdd9b4]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7fdd9b4]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter atom ID 0x4598
[matroska @ 0xb7fdd9b4]Ignoring unknown Chapter display ID 0x437c
[NULL @ 0xb7c486d0]Invalid and inefficient vfw-avi packed B frames detected
[mpeg4 @ 0xb7c486d0]Invalid and inefficient vfw-avi packed B frames detected
[mpeg4 @ 0xb7c486d0]Invalid and inefficient vfw-avi packed B frames detected
[mpeg4 @ 0xb7c486d0]Invalid and inefficient vfw-avi packed B frames detected
[mpeg4 @ 0xb7c486d0]Invalid and inefficient vfw-avi packed B frames detected
Input #0, matroska, from 'Azumanga Daioh - 06 - Sports Fest [KM-Dual-DVDRIP].mkv':
  Duration: 00:24:11.15, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 29.98 tb(r)
    Stream #0.1(eng): Audio: mp3, 48000 Hz, stereo
    Stream #0.2(jpn): Audio: mp3, 48000 Hz, stereo
    Stream #0.3(eng): Subtitle: 0x0000
Must supply at least one output file


So it seems that subs are indeed found by ffmpeg. Scanning through debug.log though, I find this:

Code: Select all
[Thread-409] DEBUG 21:25:38.666 MEncoder SVN-1.rc2.23.r28791.2mdv2009.0-4.3.2 (C) 2000-2009 MPlayer Team
[Thread-409] DEBUG 21:25:38.667 success: format: 0  data: 0x0 - 0xdcfca25
[Thread-409] DEBUG 21:25:38.667 [mkv] Track ID 1: video (V_MS/VFW/FOURCC), -vid 0
[Thread-409] DEBUG 21:25:38.667 [mkv] Track ID 2: audio (A_MPEG/L3), -aid 0, -alang eng
[Thread-409] DEBUG 21:25:38.667 [mkv] Track ID 3: audio (A_MPEG/L3), -aid 1, -alang jpn
[Thread-409] DEBUG 21:25:38.667 [mkv] Track ID 4: subtitles (S_TEXT/UTF8), -sid 0, -slang eng
[Thread-409] DEBUG 21:25:38.667 [mkv] Will play video track 1.
[Thread-409] DEBUG 21:25:38.667 Matroska file format detected.
[Thread-409] DEBUG 21:25:38.667 VIDEO:  [XVID]  640x480  12bpp  29.970 fps    0.0 kbps ( 0.0 kbyte/s)
[Thread-409] DEBUG 21:25:38.667 [V] filefmt:31  fourcc:0x44495658  size:640x480  fps:29.970  ftime:=0.0334
[Thread-409] DEBUG 21:25:38.667 ==========================================================================
[Thread-409] DEBUG 21:25:38.667 Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
[Thread-409] DEBUG 21:25:38.667 AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
[Thread-409] DEBUG 21:25:38.667 Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
[Thread-409] DEBUG 21:25:38.667 ==========================================================================
[Thread-409] DEBUG 21:25:38.667 PACKET SIZE: 2048 bytes, deltascr: 884
[Thread-409] DEBUG 21:25:38.667 Opening video filter: [expand osd=1]
[Thread-409] DEBUG 21:25:38.667 Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
[Thread-409] DEBUG 21:25:38.667 ==========================================================================
[Thread-409] DEBUG 21:25:38.667 Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[Thread-409] DEBUG 21:25:38.667 Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
[Thread-409] DEBUG 21:25:38.667 ==========================================================================
[Thread-409] DEBUG 21:25:38.667 VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
[Thread-409] DEBUG 21:25:38.667 VDec: using Planar YV12 as output csp (no 0)
[Thread-409] DEBUG 21:25:38.667 Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[Thread-409] DEBUG 21:25:38.667 videocodec: libavcodec (640x480 fourcc=3267706d [mpg2])
[Thread-409] DEBUG 21:25:38.667 [VE_LAVC] Using constant qscale = 1.000000 (VBR).
[Thread-409] DEBUG 21:25:38.667 Writing header...
[Thread-405] DEBUG 21:25:38.667 Limiting audio preload to 0.4s.
[Thread-405] DEBUG 21:25:38.667 Increasing audio density to 4.
[Thread-405] DEBUG 21:25:38.667 [mpeg4 @ 0x9c3d720]Invalid and inefficient vfw-avi packed B frames detected
[Thread-405] DEBUG 21:25:38.667 New_Face failed. Maybe the font path is wrong.
[Thread-405] DEBUG 21:25:38.667 Please supply the text font file (~/.mplayer/subfont.ttf).
[Thread-405] DEBUG 21:25:38.667 subtitle font: load_sub_face failed.


So.. guessing missing font to use?

Just noticed there's actually no such file in that directory. Downed arial.ttf and renamed it to subfont.ttf in that directory, lets see if that helps....

no real success :/
(yes, different file but same encode tested below)
Code: Select all
[Thread-479] DEBUG 21:45:09.789 MEncoder SVN-1.rc2.23.r28791.2mdv2009.0-4.3.2 (C) 2000-2009 MPlayer Team
[Thread-479] DEBUG 21:45:09.789 success: format: 0  data: 0x0 - 0xdcfaf0c
[Thread-479] DEBUG 21:45:09.789 [mkv] Track ID 1: video (V_MS/VFW/FOURCC), -vid 0
[Thread-479] DEBUG 21:45:09.789 [mkv] Track ID 2: audio (A_MPEG/L3), -aid 0, -alang eng
[Thread-479] DEBUG 21:45:09.789 [mkv] Track ID 3: audio (A_MPEG/L3), -aid 1, -alang jpn
[Thread-479] DEBUG 21:45:09.789 [mkv] Track ID 4: subtitles (S_TEXT/UTF8), -sid 0, -slang eng
[Thread-479] DEBUG 21:45:09.789 [mkv] Will play video track 1.
[Thread-479] DEBUG 21:45:09.789 Matroska file format detected.
[Thread-479] DEBUG 21:45:09.789 VIDEO:  [XVID]  640x480  12bpp  29.970 fps    0.0 kbps ( 0.0 kbyte/s)
[Thread-479] DEBUG 21:45:09.789 [V] filefmt:31  fourcc:0x44495658  size:640x480  fps:29.970  ftime:=0.0334
[Thread-479] DEBUG 21:45:09.789 ==========================================================================
[Thread-479] DEBUG 21:45:09.789 Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
[Thread-479] DEBUG 21:45:09.789 AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
[Thread-479] DEBUG 21:45:09.789 Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
[Thread-479] DEBUG 21:45:09.789 ==========================================================================
[Thread-479] DEBUG 21:45:09.789 PACKET SIZE: 2048 bytes, deltascr: 884
[Thread-479] DEBUG 21:45:09.789 Opening video filter: [expand osd=1]
[Thread-479] DEBUG 21:45:09.789 Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
[Thread-479] DEBUG 21:45:09.789 ==========================================================================
[Thread-479] DEBUG 21:45:09.789 Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[Thread-479] DEBUG 21:45:09.789 Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
[Thread-479] DEBUG 21:45:09.789 ==========================================================================
[Thread-479] DEBUG 21:45:09.789 VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
[Thread-479] DEBUG 21:45:09.790 VDec: using Planar YV12 as output csp (no 0)
[Thread-479] DEBUG 21:45:09.790 Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[Thread-479] DEBUG 21:45:09.790 videocodec: libavcodec (640x480 fourcc=3267706d [mpg2])
[Thread-479] DEBUG 21:45:09.790 [VE_LAVC] Using constant qscale = 1.000000 (VBR).
[Thread-479] DEBUG 21:45:09.805 Writing header...


Actually just typing makes things go forward, so i'll just keep at it and hopefully next post will be one of joy... until then, if you have any ideas, please please please let me know.
headconnect
 
Posts: 4
Joined: Sat Mar 14, 2009 1:35 pm

Re: subtitles in mkv's don't work

Postby headconnect » Wed Apr 22, 2009 7:27 pm

Still no luck.. any hints?
headconnect
 
Posts: 4
Joined: Sat Mar 14, 2009 1:35 pm

Re: subtitles in mkv's don't work

Postby Schlep » Fri May 01, 2009 1:38 am

Ok, so I spent about an hour on this and finally got it working after uninstalling both ffmpeg and mencoder through Synaptic Manager. Reinstalled ffmpeg and then mencoder (in that order, didn't work the other way around, kept saying corrupted). It works now!

Other things that may or may not have affected the outcome:
Installing mplayer-fonts
Copying arial.ttf to .mplayer/subfont.ttf in my home dir
Putting "eng" without quotes in the box for "Audio/subtitles language priority" under MEncoder
Unchecking "ASS/SSA Subtitles"
Checking "Fontconfig/Embedded fonts"
Unchecking "Use ASS default style"
Checking "Autoload *.srt/*.sub subtitles"

Hope this helps.
Schlep
 
Posts: 1
Joined: Fri May 01, 2009 1:31 am


Return to Linux/Unix Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests