You are not logged in.

#1 2009-01-03 22:32:54

psilo357
Member
Registered: 2008-10-31
Posts: 116

Converting .mkv to .avi or .mpg

I have lots of .mkv files that I watch.  I would love to be able to view these on my ps3 from my freeNAS server.  However, ps3 does not support .mkv files.  In windows I use an application called mkv2vob that works great for converting mkv files into a ps3 playable format.  I dont use the vob option, but usually mpg.

this is my last hurdle to dumping windows COMPLETELY.  If i can figure out an easy way to convert these files then im set.  Also, mkv2vob just does a container change, and re encodes the sound if it needs to, so its very fast, as it doesn't have to re-encode the h264 video, which is how i would like it to work in linux as well...

Thanks for any help or any suggestions.

peace

Offline

#2 2009-01-04 01:58:47

decaturguy
Member
From: Sweden
Registered: 2006-11-28
Posts: 117

Re: Converting .mkv to .avi or .mpg

from command line http://darebux.blogspot.com/2007/11/mkv … linux.html
GUI try avidemux (never tested with mkv) i do use it for encoding.

Offline

#3 2009-01-04 17:21:19

alex_anthony
Member
From: UK
Registered: 2007-09-25
Posts: 344

Re: Converting .mkv to .avi or .mpg

I had trouble with converting HD movies with this non-re-encoding method

well splitting the mkv is very easy with mkvtoolnix as described in the linked blog
There is the complicated bit in the middle where sometimes you have to change the level of the h.264 to one playable by PS3. I used a windows utility under wine to do this - I'll look it up
The part where I had the trouble was muxing again. I tried to use gpac (MP4Box) to mux them but there is this bug: http://sourceforge.net/tracker/?func=de … p_id=84101
I was trying to do videos of just over 2gb so it affected me. The bug is closed now so the version in the repos might be ok now

Edit: Other problem I found was with videos that were in that extra-wide format - they would be stretched to normal widescreen format

Last edited by alex_anthony (2009-01-04 17:22:44)

Offline

#4 2009-01-04 17:28:22

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

Re: Converting .mkv to .avi or .mpg

psilo357, what's your preferred format? Converting to most things is easy with FFmpeg. Let us know what you want.

Offline

#5 2009-01-04 18:19:33

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

I would like to have .mpg container, and the sound needs to be AC3, with the video encoded with h264 (which it already is, thats why i really just need container change + possible sound re-encode).  The files I work with are generally 4gb all the way up to 18gb (very rarely that large, usually 4 - 8gb)

Yeah, i have searched around and found many things online talking about it.  I had a problem with that blog as well.  I was able to split the files no problem.  But sometimes they have DTS sound, other times its AC3 sound already, but a bitrate the ps3 won't play.  I didn't know what extensions to remove the sound into, i guess .dts and .ac3, which would play fine as a sound file in amarok, but when i tried to convert to mp3 (which I do not want anyways, just trying, these are HD videos, and would like to keep HD sound, since my stereo is nice), it always got an error that it didn't know what codec it was in or something...

peace

Last edited by psilo357 (2009-01-04 18:23:18)

Offline

#6 2009-01-04 18:53:44

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

Re: Converting .mkv to .avi or .mpg

For a container change only:

ffmpeg -i <input.mkv> -vcodec copy -acodec copy <output.mpg>

with a change in audio bitrate:

ffmpeg -i <input.mkv> -vcodec copy -ab <audio_bitrate> -acodec ac3 <output.mpg>

If you just want a short sample, just add a time limit. For this example I use 60 seconds:

ffmpeg -t 60 -i <input.mkv> -vcodec copy -acodec copy <output.mpg>

If you want to start at 10 minutes (600 seconds), and run for 60 seconds:

ffmpeg -t 60 -ss 600 -i <input.mkv> -vcodec copy -acodec copy <output.mpg>

You can also use the format HH:MM:SS.SS for times.

Try some of these out and see if they work.

Offline

#7 2009-01-04 18:56:05

alex_anthony
Member
From: UK
Registered: 2007-09-25
Posts: 344

Re: Converting .mkv to .avi or .mpg

I found .mp4 with h.264 video and .aac audio works reasonably well
And that windows program was h264info

Anybody know how to sort get the video to play in the right format on the PS3 by any chance?

Edit: from reading around, it seems m2ts might be a better container - AC3 audio support!

Last edited by alex_anthony (2009-01-04 18:59:03)

Offline

#8 2009-01-04 18:59:38

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

Re: Converting .mkv to .avi or .mpg

Oh yes,

The FFmpeg in the repos may need the audio codec to be liba52:

-acodec liba52

As well, bitrates in FFmpeg are specified like 256k.

On more thing, FAAC in the repos is broken, if you want AAC audio, you can find the patches in our bug tracker.

Offline

#9 2009-01-04 21:13:14

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

ffmpeg -t 10 -ss 600 -i movie.mkv -vcodec copy -ab 128k -acodec ac3 movie.mpg

This is the command i try and it kicks off just fine, does its thing for a while, and finally finishes, but the ending movie.mpg file is unplayable in either vlc or mplayer.  Here is output of the encode:

I tried with -acodec liba52 and it said that was an unknown coded
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfaad --enable-liba52 --enable-libxvid --enable-libx264 --enable-libtheora --enable-postproc --enable-shared --enable-pthreads --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 Jul 19 2008 23:45:56, gcc: 4.3.1 20080626 (prerelease)
[matroska @ 0x7f9801da8040]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 0x7f9801da8040]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 0x7f9801da8040]Ignoring seekhead entry for ID=0x114d9b74
[matroska @ 0x7f9801da8040]Unknown track header entry 0x55ee - ignoring
[matroska @ 0x7f9801da8040]Unknown track header entry 0x55ee - ignoring
Input #0, matroska, from 'movie.mkv':
  Duration: 01:39:12.99, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23.98 tb(r)
    Stream #0.1: Audio: dca, 48000 Hz, 5:1
Output #0, mpeg, to 'movie.mpg':
    Stream #0.0(eng): Video: libx264, yuv420p, 1280x720, q=2-31, 1000.00 tb(c)
    Stream #0.1: Audio: ac3, 48000 Hz, 5:1, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=2007 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=2007 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=4048 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=6089 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=8130 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=10171 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=12212 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=14253 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=16294 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=18335 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=20376 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=22417 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=24458 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=26499 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=28540 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=30581 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=32622 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=34663 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=36704 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=38745 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=40786 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=42827 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=44868 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=46909 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=48950 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=50991 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=53032 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=55073 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=57114 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=59155 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=61196 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=63237 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=65278 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=67319 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=69360 size=70904
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=493 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=2534 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=4575 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=6616 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=8657 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=10698 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=12739 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=14780 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=16821 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=18862 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=20903 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=22944 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=24985 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=27026 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=29067 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=31108 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=33149 size=35030
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=156 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=2197 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=4238 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=6279 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=8320 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=10361 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=12402 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=14443 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=16484 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=18525 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=20566 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=22607 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=24648 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=26689 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=28730 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=30771 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=32812 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=34853 size=35173
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=1717 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=3758 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=5799 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=7840 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=9881 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=11922 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=13963 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=16004 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=18045 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=20086 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=22127 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=24168 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=26209 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=28250 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=30291 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=32332 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=34373 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=36414 size=38165
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=286 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=2327 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=4368 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=6409 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=8450 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=10491 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=12532 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=14573 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=16614 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=18655 size=37583
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=20696 size=37583
...lots of this in here with different nums
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=8152 size=15113
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=10193 size=15113
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=12234 size=15113
[mpeg @ 0x7f9801da8040]buffer underflow i=0 bufi=14275 size=15113
frame= 9918 fps=395 q=-1.0 size=  171958kB time=413.73 bitrate=3404.8kbits/s

video:279141kB audio:6517kB global headers:0kB muxing overhead 0.419338%

I also tried with -acoded liba52, and it said 'liba52 is an unknown codec'...so i figure i need to install it, i tried with pacman -Sy liba52, but the package wasn't found...i will look some more for it, i know its there somewhere.  I am goign to try again with movie.avi and see if i have any better luck...will post back.  If someone knows the name of what i need to install for liba52 to work let me know, or any other changes for that matter.

thanks for working through this with me.

Offline

#10 2009-01-04 21:18:43

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

alright, seems with movie.avi it works fine and outputs a playable video.

However, now the video is all jumpy, and the audio/video are not in sync...almost as if the video is playing in slow motion...man this is a headache...lol...but i think im getting closer...im going to transfer to my server and see if the ps3 will play it anyways, maybe the video stuttering/slow motion thing is an easy fix.

Offline

#11 2009-01-04 21:27:40

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

Re: Converting .mkv to .avi or .mpg

You don't need liba52 (which is in the package a52dec by the way). It looks like it's choking on the mpeg container. alex_anthony may be correct on using m2ts. I also wonder if ps3 can handle a mp4 container with ac3 audio.

Offline

#12 2009-01-04 21:40:25

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: Converting .mkv to .avi or .mpg

You should also use presets when working with ffmpeg and HD video since the default settings in ffmpeg is not meant for HD video.


Use the Source, Luke!

Offline

#13 2009-01-04 21:40:53

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

I think it can handle mp4 as well, actually, im positive it can.

I uploaded my .avi (which was of stuttering quality anyways) and it would not play on my ps3, says "data type not supported".  so its probably something to do with the audio.  I will try another encode to m2ts real quick and see what I end up with, then reupload to server and give it another go.

will report back with findings.

Alright, when i try to use m2ts in place of avi, it gives me this error

Unable to find a suitable output format for 'movie.m2ts'

>>You should also use presets when working with ffmpeg and HD video since the default settings in ffmpeg is not meant for HD video.

Maybe thats why the video is coming out stuttering...but how would i go about doing this?

Evidently ffmpeg does not support h264 video in mp4, which seems strange, as i thought that is what mp4 was specifically made for, here is what happens when i try mp4 output

[mp4 @ 0x7fcd13d7d040]track 1: could not find tag, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?

thanks

Last edited by psilo357 (2009-01-04 21:49:59)

Offline

#14 2009-01-04 21:49:04

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

Re: Converting .mkv to .avi or .mpg

I saw on a website that ps3 can't handle ac3 in a mp4 container. This makes sense because it's not part of the mpeg4 standard. The second to last post in the following thread has a PKGBUILD and patch for FAAC. If you're going to re-encode the audio anyway, using a pure mp4 set up may be a good idea:

http://bbs.archlinux.org/viewtopic.php?id=51954

Then you can change the -acodec line to -acodec libfaac.

Offline

#15 2009-01-04 21:58:50

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

i will look into that stuff right now.  I have never had to patch a build before so have no clue how to do it.  i will look around and try to figure it out, if you have a quick and dirty rundown though that would be great.  i normally use yaourt to get anything from AUR...i have already downloaded the lib32-faac tarball from AUR, im guessing this is what I need to patch, but not positive, any help with this now would be great...

sorry for all the questions and having to hold my hand through it...still somewhat new to archlinux and even linux in general.

peace

Offline

#16 2009-01-04 22:02:28

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Converting .mkv to .avi or .mpg

Here is a good ffmpeg guide, but it doesn't mention mkv: http://howto-pages.org/ffmpeg/

Offline

#17 2009-01-04 22:11:40

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

skottish wrote:

I saw on a website that ps3 can't handle ac3 in a mp4 container. This makes sense because it's not part of the mpeg4 standard. The second to last post in the following thread has a PKGBUILD and patch for FAAC. If you're going to re-encode the audio anyway, using a pure mp4 set up may be a good idea:

http://bbs.archlinux.org/viewtopic.php?id=51954

Then you can change the -acodec line to -acodec libfaac.

Alright, im trying to patch this up, i just copied the entire pkgbuild from the thread, and then the patch as well, no when i try to compile with makepkg -s i get this

makepkg -s
==> Making package: faac 1.26-1 x86_64 (Sun Jan  4 16:10:30 CST 2009)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Found faac-1.26.tar.gz in build dir
  -> Found libmp4v2.patch in build dir
==> Validating source files with md5sums...
    faac-1.26.tar.gz ... Passed
    libmp4v2.patch ... FAILED
==> ERROR: One or more files did not pass the validity check!

and i can't figure it out...i don't even know how to use the patches correctly,..

Offline

#18 2009-01-04 22:22:08

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

Re: Converting .mkv to .avi or .mpg

Remove the md5 sums line in the PKGBUILD, and try again. And, you don't need the lib32 for anything. Just use the PKGBUILD and have the patch in the same directory.

Offline

#19 2009-01-04 22:43:03

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

sweet, got it working now, thanks for all your help so far.

ffmpeg -t 10 -ss 600 -i movie.mkv -vcodec copy -ab 128k -acodec libfaac movie.mp4

will make a .mp4 file that works and plays on my ps3 and everything.  I tested without putting a specific bitrate too and it chose 64kb, which is also fine.

Now my last problem is that the video seems to be playing in slow motion or something, and witht his short clip (actually 10 minutes not 10 seconds) the sound gets way out of sync with the video...any ideas on this?

thanks again for workign through this with me

Offline

#20 2009-01-04 22:45:14

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

Re: Converting .mkv to .avi or .mpg

Awesome! I'm so glad that it's working for you.

Man, I've been complaining for months about FAAC not working correctly. Maybe some day we'll get a working version in the repos again.

Offline

#21 2009-01-04 22:47:34

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

Any ideas on the out of sync issues that are happening...the video is playing in what seems like slow motion, thought the sound goes at normal rate.

Offline

#22 2009-01-04 23:29:06

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

Re: Converting .mkv to .avi or .mpg

psilo357 wrote:

Any ideas on the out of sync issues that are happening...the video is playing in what seems like slow motion, thought the sound goes at normal rate.

I'm not sure. I rarely work with Matroska containers, and I don't remember the last time that I saw A/V sync issues with FFmpeg. One thing that you can try is:

ffmpeg -i <your_input.mkv> -sameq -vcodec ( either libx264 or mp4 ) -ab 128k -acodec libfaac <your_output.mp4>

libx264 is recommended. This is going to re-encode the video but try to keep the same quality. Needless to say, it's going to take a while on large files.

Offline

#23 2009-01-05 00:45:07

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

yeah, im trying to avoid re-encode by doing just a container change, i may try that later if i have to.

I have been playing with mencoder, and gotten an mp4 out of it with aac audio and h264/avc video, but it won't play.  Both these formats are supported by ps3, but the problem may be that it simply doesn't like the header information that mencoder is putting in it...i am going to try again with ffmpeg with the entire file instead of just the certain time section to see where i get, would be a strange problem, but wouldn't surprise me.

Offline

#24 2009-01-05 00:51:59

alex_anthony
Member
From: UK
Registered: 2007-09-25
Posts: 344

Re: Converting .mkv to .avi or .mpg

My current problem is with the level of the h.264 file
Input is 5.1, PS3's max is 4.1
I'm using AAC (what the video comes with) in an MP4
I've tried just changing the hex code (trying to trick the PS3) and using tsMuxeR
Each time, the video works on the computer, but sound without video on PS3

Tomorrow I'm going to try H264info in wine and if that doesn't work, trying to do a passthrough with x264

Offline

#25 2009-01-05 01:17:30

psilo357
Member
Registered: 2008-10-31
Posts: 116

Re: Converting .mkv to .avi or .mpg

alex_anthony wrote:

My current problem is with the level of the h.264 file
Input is 5.1, PS3's max is 4.1
I'm using AAC (what the video comes with) in an MP4
I've tried just changing the hex code (trying to trick the PS3) and using tsMuxeR
Each time, the video works on the computer, but sound without video on PS3

Tomorrow I'm going to try H264info in wine and if that doesn't work, trying to do a passthrough with x264

at least someone else is working on my same (sorta) problem.

Alright, tried to do the full video using

ffmpeg -i movie.mkv -vcodec copy -ab 128k -acodec libfaac movie.mp4

as the comand, and ffmpeg is doing something odd with the video.  The original .mkv video playtime is 1:39:13, the output mp4 playtime is 2:39:04.  Somehow it is 'slowing' the video just as I thought.  The audio plays just fine (though of course gets out of sync more and more as the video plays, to where the last hour is silent...lol)

such an odd problem, any more insight would be great.  I am going to write the author of mkv2vob if i can find some contact info and see if I can possibly get my hands on his code or if maybe he could help me out, as his application is wonderful in windows and works perfectly everytime, and even uses mencoder for the video, and i think something called tranzcode for the audio, but that is some windows jibber jabber.

guess I can't quite rid myself of my dual boot and free all my space for linux...almost there though.

Offline

Board footer

Powered by FluxBB