Peppies-Site Forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Peppies-Site Forums

Fun Games and General Chat.

:dj: when radio is on air you can tune in by clicking on the Peppies-Jukebox link on the top of the page (members only) and by leaving it open you can browse the site content and join in with stuff all at the same time or if you join us you can join us in the irc channel to see whats being played, make requests and join in with us there too. :dj: ADVERTS DISAPPEAR ON JOINING OUR SITE ITS FREE TO SIGN UP AND REGISTER SO DO YOURSELF A FAVOUR AND JOIN US RIGHT NOW!! HELP US TO BUILD A NICE LITTLE COMMUNITY WHERE FUN NEVER STOPS............

    Get mkv files to work on PS3

    Peppies™
    Peppies™
    Site Owner
    Site Owner


    Posts : 442
    Join date : 2010-06-23
    Age : 62
    Location : Newcastle Upon Tyne

    Get mkv files to work on PS3 Empty Get mkv files to work on PS3

    Post  Peppies™ 18th January 2011, 14:07

    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:
    [You must be registered and logged in to see this link.]
    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.

      Current date/time is 12th May 2024, 06:07