Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21

Thread: Ubuntu Linux - Get mkv files to work on PS3

  
  1. #1
    Jsamp is offline Outa time -Hacks Titan
    Join Date
    Mar 2006
    Posts
    5,305
    Rep Power
    0

    Default

    I have java PS3 media server running on my Ubuntu laptop. It will stream some mkv files hassle free and others will show up as corrupted. There is a way to change mkv to a compatible mp4 without re-encoding the whole video. I hope this helps someone other than me here. I got my info from here but I added and condensed the info I got. It may look complicated to do but it really isnt. Anyway here it is......

    Note! This only works if the mkv file video track is H264!!!

    First install mkvextract, mkvinfo, MP4Box, hexedit and mplayer
    $ sudo apt-get install mkvtoolnix gpac hexedit mplayer

    Then you need neroAacEnc. You may download it for free here:
    http://www.nero.com/eng/nero-aac-codec.html
    Unpack linux directory, chmod +x neroAacEnc and copy it to a location of your choice (whitin the path)

    I've downloaded Avatar which as this filename: tdm-avatar.x264.mkv

    Then you have to find out which tracks contains the audio and video.
    Run:
    $ mkvinfo tdm-avatar.x264.mkv
    Here is the printout to find the tracks and the fps of the video. The important parts will be in bold.
    $ mkvinfo tdm-avatar.x264.mkv
    + EBML head
    |+ Doc type: matroska
    |+ Doc type version: 2
    |+ Doc type read version: 2
    + Segment, size 8667583300
    |+ Seek head (subentries will be skipped)
    |+ EbmlVoid (size: 4025)
    |+ Segment information
    | + Timecode scale: 1000000
    | + Muxing application: libebml v0.8.0 + libmatroska v0.9.0
    | + Writing application: mkvmerge v3.3.0 ('Language') built on Mar 24 2010 14:59:24
    | + Duration: 9701.824s (02:41:41.824)
    | + Date: Fri Apr 23 09:23:42 2010 UTC
    | + Segment UID: 0xb9 0xcc 0x6b 0x26 0x3b 0xb4 0x4a 0x8f 0xbc 0xdd 0xd0 0xbd 0x33 0xf9 0xfd 0x36
    |+ Segment tracks
    | + A track
    | + Track number: 1
    | + Track UID: 1
    | + Track type: video
    | + Enabled: 1
    | + Default flag: 1
    | + Forced flag: 0
    | + Lacing flag: 0
    | + MinCache: 1
    | + Timecode scale: 1
    | + Max BlockAddition ID: 0
    | + Codec ID: V_MPEG4/ISO/AVC
    | + Codec decode all: 1
    | + CodecPrivate, length 170
    | + Default duration: 41.708ms (23.976 fps for a video track)
    | + Language: eng
    | + Name: Avatar.2009.720p.BluRay.x264-TDM
    | + Video track
    | + Pixel width: 1280
    | + Pixel height: 720
    | + Interlaced: 0
    | + Display width: 1280
    | + Display height: 720
    | + Stereo mode: 3 (both eyes)
    | + A track
    | + Track number: 2
    | + Track UID: 334490259
    | + Track type: audio
    | + Enabled: 1
    | + Default flag: 1
    | + Forced flag: 0
    | + Lacing flag: 1
    | + MinCache: 0
    | + Timecode scale: 1
    | + Max BlockAddition ID: 0
    | + Codec ID: A_AC3
    | + Codec decode all: 1
    | + Default duration: 32.000ms (31.250 fps for a video track)
    | + Language: eng
    | + Name: English
    | + Audio track
    | + Sampling frequency: 48000
    | + Channels: 6
    | + A track
    | + Track number: 3
    | + Track UID: 2791224214
    | + Track type: subtitles
    | + Enabled: 1
    | + Default flag: 1
    | + Forced flag: 1
    | + Lacing flag: 0
    | + MinCache: 0
    | + Timecode scale: 1
    | + Max BlockAddition ID: 0
    | + Codec ID: S_TEXT/UTF8
    | + Codec decode all: 1
    | + Language: rum
    | + Name: Romanian
    |+ EbmlVoid (size: 1024)
    |+ Cluster
    (in my mkv file video is on track1 and audio is on track 2. Change the numbers in the below comman to fit you mkv file)

    Then demux the mkvfile by running:
    $ mkvextract tracks tdm-avatar.x264.mkv 1:video.h264 2:audio.ac3 3:subtitles.srt

    If you dont want subtitles dont include the 3:subtitles.srt. I personally dont like subtitles so I dont include that part of the command but put it there just in case someone wants them.

    The below part may or may not need to be done. For the Avatar vid I have it does not.
    Next to do is to change one byte inside the video.h264.
    $ hexedit video.h264
    On the first line you should see this number combination:
    "67 64 00 33"
    change this to:
    "67 64 00 29"
    press ctrl-s to save and ctrl-x to exit.


    Then you need to convert audio to aac format.
    $ mkfifo audiodump.wav
    $ neroAacEnc -ignorelength -q 0.20 -if audiodump.wav -of audio.m4a & mplayer audio.ac3 -vc null -vo null -channels 6 -ao pcm:fast

    This may take a couple of minutes. The channels 6 part of the command will retain Dolby 5.1 quality. This flag is not needed but will result in a loss of sound quality. Using the channels 6 command takes a lot longer than not using that flag.

    The only thing left is to mux the video and audio file:
    $ MP4Box -add video.h264 -add audio.m4a -add subtitles.srt -fps 23.976 AvatarHD.mp4

    By default MP4Box assumes all video is 25fps. Without the -fps flag your video may be out of synch with audio if its less or greater than the default fps. If you dont want subtitles dont include the -add subtitles.srt flag.

    All should be finished within 5-10 minutes because no video convertion is done.


  2. #2
    Powerslave is offline Gone fishin -Hacks Titan
    Join Date
    Apr 2006
    Posts
    7,900
    Rep Power
    0

    Default

    I use MKV2VOB, it will not transcode if compatible, it just extracts.

    I have this issue with AVI files sometimes, so I use ABC AVI editor, to edit the header to make it compatible. When you press the INFO on PS3, you get missing items, so the editor will take care of that. It won't ave unless you make a change, so I just add a rating or something, then save. Then WALLA it works...

    ANYHOW, MKV files are transcoded realtime anyway with the Java MP3 Server. If you use MKV2VOB it will not, it sends it as it is.

  3. #3
    Jsamp is offline Outa time -Hacks Titan
    Join Date
    Mar 2006
    Posts
    5,305
    Rep Power
    0

    Default

    I couldnt get mkv2vob to run in WINE. I even tried to find a good Ubuntu gui app but most just want to re-encode it to another format. I think the above method works similar to mkv2vob because it doesnt touch the video at all just the audio.

  4. #4
    Powerslave is offline Gone fishin -Hacks Titan
    Join Date
    Apr 2006
    Posts
    7,900
    Rep Power
    0

    Default

    There are no good APPS for Linux on PS3, another reason is was abandoned when the SLIM was developed. Your best bet it so just use a PC to media serve, and use the apps on a PC. Linux will get you nowhere on the PS3.

  5. #5
    Jsamp is offline Outa time -Hacks Titan
    Join Date
    Mar 2006
    Posts
    5,305
    Rep Power
    0

    Default

    Quote Originally Posted by Powerslave
    There are no good APPS for Linux on PS3, another reason is was abandoned when the SLIM was developed. Your best bet it so just use a PC to media serve, and use the apps on a PC. Linux will get you nowhere on the PS3.
    I think you may have mis-interpreted me. My main computer rig is a laptop and is running Ubuntu Linux. Not every mkv file I have ran across works with the java ps3 media server so I found a thread with all the info and weeded out some of the info to hopefully help some one that also uses Linux as a primary OS.

  6. #6
    Powerslave is offline Gone fishin -Hacks Titan
    Join Date
    Apr 2006
    Posts
    7,900
    Rep Power
    0

    Default

    Quote Originally Posted by Jsamp
    I think you may have mis-interpreted me. My main computer rig is a laptop and is running Ubuntu Linux. Not every mkv file I have ran across works with the java ps3 media server so I found a thread with all the info and weeded out some of the info to hopefully help some one that also uses Linux as a primary OS.
    I do not use the JAVA PS3 media server to TRANSCODE the MKV file, I use MKV2VOB to convert the file to a playable container, where NO TRANSCODING is needed. No transcoding is done to the MKV unless you want subtitles in the video.

    The .MKV file is not playable by PS3 natively, so it needs transcoded in the fly, while it IS a codec the PS3 plays. So, MKV2VOB just converts it to MPG, that is playable without the transcode engine.

    I have come across NO .MKV file that MKV2VOB did not convert for me.

  7. #7
    greg's Avatar
    greg is offline PSP-Hacks -Hacks Veteran
    Join Date
    Apr 2005
    Location
    Toronto, ON
    Posts
    1,207
    Rep Power
    0

    Default

    Are you using mencoder or tsmuxer to do the on-the-fly transcoding with PS3 Media Server? I run the same on an OpenSuSE box and if one doesn't work, the other usually does.

  8. #8
    Jsamp is offline Outa time -Hacks Titan
    Join Date
    Mar 2006
    Posts
    5,305
    Rep Power
    0

    Default

    Quote Originally Posted by greg
    Are you using mencoder or tsmuxer to do the on-the-fly transcoding with PS3 Media Server? I run the same on an OpenSuSE box and if one doesn't work, the other usually does.
    I wasnt really sure so I checked and under the MEncoder settings I have the box checked for....
    Switch to tsMuxer when H264 video is ps3 compatible and theres no configured subs.
    I actually dont stream the HD videos cause I get stuttering sometimes. I rarely download mkv files actually. I only get the movies that are worth keeping or that I must watch in HD and then use this guide to convert it to mp4. Then I use the media server to copy the file to my PS3.

  9. #9
    greg's Avatar
    greg is offline PSP-Hacks -Hacks Veteran
    Join Date
    Apr 2005
    Location
    Toronto, ON
    Posts
    1,207
    Rep Power
    0

    Default

    Yeah I know what you mean when it comes to the stuttering... You definitely need 100mbit or gigabit - WiFi is too slow. I use mencoder by default (Switch to tsMuxer unchecked), then manually switch to tsmuxer if mencoder doesn't work.

  10. #10
    Powerslave is offline Gone fishin -Hacks Titan
    Join Date
    Apr 2006
    Posts
    7,900
    Rep Power
    0

    Default

    Quote Originally Posted by greg
    Yeah I know what you mean when it comes to the stuttering... You definitely need 100mbit or gigabit - WiFi is too slow. I use mencoder by default (Switch to tsMuxer unchecked), then manually switch to tsmuxer if mencoder doesn't work.
    My kid uses a WiFi Bridge(54G) from a 108G access point for his XB360, and there is no stuttering. When he has to transcode a video, then there IS because the buffer under-runs, not because of the network speed itself.

    Again, for JSAMP, you do NOT need to transcode a MKV file. The only reason the PS3 dows not play it, is bewcuase the container and header is incorrect for PS3. If you simply use MKV2VOB, make it the MPG that is playable on a PS3, even if you put the file on a DVD5 or 9. You are making yourself more work than is required. IF you got the Laptop, switch to the Win O/S and just use MKV2VOB.

    Also, you do not need to make it a .MP4 file for PS3 either. The DEFAULT settings in MKV2VOB make a .MPG that is playable with NO transcoding needed. All it does is Mux the audio to AC3, or patch DTS if you have a DTS receiver through HDMI on your PS3.

    I do not know why you are making this more difficult than it has to be. Transcoding on the fly takes RESOURCES. You need a Dual Core CPU for it to work good. I have a dedicated server for this, with 5 external drives, and the only stuttering my kid gets, is when transcoding. It's only a dual threaded 1.6Ghz ATOM CPU, both threads used for transcoding.

    Even th XB360 would play the H.264 files, but it's more picky than the PS3, so, he has do transcode to watch them, but, any files with DTS audio, he gets NO audio.

    Seriously, just try MKV2VOB, you should be happy.

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •