Page 1 of 2

Having a problem getting MKV to play

PostPosted: Tue Apr 26, 2011 3:11 pm
by alphonse55
Hey guys. I am using version 4.4 on OSX 10.6.7 and I am having a problem any time I try to play an .MKV file. I am getting "video not found or access denied" any time I try. Here is what I am getting in my log. Hopefully this is enough info. Thanks

Tuesday, April 26, 2011 11:04:01 AM US/Eastern
[2011-04-26 11:04:11,110] INFO PlaylistInputStream - chris listening to "Movies/Catch Me If You Can (2002).mkv"
[2011-04-26 11:04:11,113] DEBUG TranscodeInputStream - Starting transcoder: [/Library/Application Support/Subsonic/transcode/ffmpeg] [-ss] [0] [-i] [/Volumes/Media 2/Movies/Catch Me If You Can (2002).mkv] [-async] [1] [-b] [1000k] [-s] [640x360] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-]
[2011-04-26 11:04:11,150] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) FFmpeg version SVN-r25203-einsteinx2, Copyright (c) 2000-2010 the FFmpeg developers
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) built on Sep 26 2010 02:08:29 with gcc 4.2.1 (Apple Inc. build 5664)
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) configuration: --prefix=/Volumes/Ramdisk/ --as=yasm --extra-version=einsteinx2 --disable-shared --enable-static --disable-ffplay --disable-ffserver --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-version3
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libavutil 50.28. 0 / 50.28. 0
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libavcore 0. 9. 0 / 0. 9. 0
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libavcodec 52.90. 0 / 52.90. 0
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libavformat 52.78. 5 / 52.78. 5
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libavdevice 52. 2. 2 / 52. 2. 2
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libavfilter 1.45. 0 / 1.45. 0
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libswscale 0.11. 0 / 0.11. 0
[2011-04-26 11:04:11,151] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[2011-04-26 11:04:11,229] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) [matroska,webm @ 0x1809600] Estimating duration from bitrate, this may be inaccurate
[2011-04-26 11:04:11,230] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg)
[2011-04-26 11:04:11,230] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 24.00 (24/1)
[2011-04-26 11:04:11,230] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Input #0, matroska,webm, from '/Volumes/Media 2/Movies/Catch Me If You Can (2002).mkv':
[2011-04-26 11:04:11,231] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Duration: 02:12:17.12, start: 0.000000, bitrate: 448 kb/s
[2011-04-26 11:04:11,231] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 fps, 24 tbr, 1k tbn, 47.95 tbc
[2011-04-26 11:04:11,231] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
[2011-04-26 11:04:11,236] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) [buffer @ 0x1108980] w:1280 h:720 pixfmt:yuv420p
[2011-04-26 11:04:11,236] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) [scale @ 0x1108b90] w:1280 h:720 fmt:yuv420p -> w:640 h:360 fmt:yuv420p flags:0xc0000004
[2011-04-26 11:04:11,243] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Output #0, flv, to 'pipe:':
[2011-04-26 11:04:11,243] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Metadata:
[2011-04-26 11:04:11,243] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) encoder : Lavf52.78.5
[2011-04-26 11:04:11,244] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0(eng): Video: flv, yuv420p, 640x360 [PAR 1:1 DAR 16:9], q=2-31, 1000 kb/s, 1k tbn, 24 tbc
[2011-04-26 11:04:11,244] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1(eng): Audio: libmp3lame, 44100 Hz, 2 channels, s16, 64 kb/s
[2011-04-26 11:04:11,244] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream mapping:
[2011-04-26 11:04:11,244] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0 -> #0.0
[2011-04-26 11:04:11,244] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1 -> #0.1
[2011-04-26 11:04:11,244] DEBUG InputStreamReaderThread - (/Library/Application Support/Subsonic/transcode/ffmpeg) Press [q] to stop encoding

PostPosted: Tue Apr 26, 2011 6:44 pm
by GJ51
ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -acodec copy -

This is the transcoding I use for mkv files.

PostPosted: Tue Apr 26, 2011 7:20 pm
by alphonse55
Gary,

Thanks for the help but I am still having the problem. I also noticed that .m4v files are having the same problem. It seems that the only files that play without any problems are .avi files.

PostPosted: Tue May 03, 2011 3:18 pm
by alphonse55
Anyone else have any ideas? I can't seem to do anything to get this to work.

PostPosted: Thu Jun 02, 2011 2:33 pm
by alphonse55
bump... still trying to get this to work

PostPosted: Thu Jun 02, 2011 2:50 pm
by GJ51
I haven't really done too much with mkv lately, but my mp4's work fine. Any particular reason you need mkv?

EDIT: Just tested an MKV. It works, but the transcoding takes a toll on performance, which is why I use mp4 so I can bypass the transcoding.

ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -

This is the current transcoding setting on the server I just tested on a WHS2011 VM.

PostPosted: Sat Jun 04, 2011 3:55 pm
by GJ51
There are a couple of considerations that you must address with video on Subsonic. Any file format that requires transcoding is going to take up cpu power. DVD and Blue ray quality video will bring almost any cpu to it's knees if you try to transcode it. Most cpu's will not be able to keep up with the playback stream while transcoding. Part of the problem is that ffmpeg by default only uses one core per stream transcoded on any cpu, so even if you host SS on the latest six-core powerhouse, you still only get one core on that cpu for the transcoding.

I recommend preformatting all the video into mp4 for the desktop and flv for mobile. JW player and Android devices can then play the files without the need for transcoding, which then shifts the playback performance to soley being a function of the connection speed and the graphics power of the playback device.

PostPosted: Sat Jun 04, 2011 4:32 pm
by GJ51
After some further exploration, I've found that downloading a later ffmpeg build from http://ffmpeg.zeranoe.com/builds/# enables multiple threads. My sample MKV now plays back with NO pauses of buffering!

You can view it on my site for a while as a demo in the Videos folder. Select MKV to see the results. Please give me some feedback on how it plays for you if you try it out.

You'll still get better performance overall by bypassing the transcoding, but at least this works much better when you do have to transcode.

PostPosted: Mon Jun 06, 2011 4:41 am
by Kirk
That's a pretty cool find GJ51... I have a 16 core server hosting Subsonic... I think I will implement this on there! :D

PostPosted: Tue Jun 28, 2011 3:07 pm
by alphonse55
wow, I actually got this working. I had to get the developer tools from Apple and then followed the instructions on updating ffmpeg that I found in this thread: http://forum.subsonic.org/forum/viewtopic.php?p=27367

Then with more help from GJ51 (thank you!) I changed my transcode settings to:

ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -ar 44100 -ac 2 -

Finally my MKVs are playing.

PostPosted: Wed Jun 29, 2011 2:15 am
by GJ51
Yeah, i find that there is always more and more to learn about with the transcoding thing. You might also want to give JW Player 5.7 a try. Not that I noticed any big difference, but 5.7 is the latest version.

Kirk, 16 cores???? As Tim Allen would say, "More power, har, har, har!!" You probably don't have much of a bill for heating, but I bet 'lectric's a bear! :wink:

PostPosted: Sat Jul 02, 2011 6:46 pm
by Qbix
I have a hard time figuring out where/how to install this new version of ffmpeg. Where do I put the files from the .zip file?

Can anyone please tell me how to do this?

PostPosted: Sat Jul 02, 2011 6:53 pm
by GJ51
I just extracted the ffmpeg.exe and replaced the file in C:\Subsonic\transcode

PostPosted: Sat Jul 02, 2011 9:27 pm
by Qbix
Ok thanks...just did that but...no performance win :(
Is it possible to let Subsonic use codec packs so it doesn't need to transcode the files but just let it play .mkv files directly?

PostPosted: Sat Jul 02, 2011 9:44 pm
by GJ51
No, but you can convert your mkv's to mp4 and then send directly to JW.