You are not logged in.

#1 2008-08-06 02:05:28

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Minimal specs to convert 1080p Matroska to PS3-compatible format?

I installed Mediatomb today, mainly to get some 1080p goodness going on my Full HD TV, other than your 'regular' Blu-Ray. Since Mediatomb can also transcode on the fly, I set it up to convert Matroska data to MPEG2, which the PS3 'understands', so I can enjoy hi-def on my TV. There seems to be a problem however. My poor server (an AMD Athlon64 3000+ with 512 MB of RAM) doesn't seem up to the task of transcoding. As you can see from the screenshot (SSH'ed into my server) ffmpeg happily forks and starts eating almost all CPU time, while the RAM usage (afaict) seems to stay reasonable.

mediatombmatroskatompeg2.png

All of this happens over a 100 Mbit network, but since the resulting MPEG2 stream seems to be around 4-5 Mbps (whereas a Blu-Ray disc barely hits 20 Mbps) I'd think it is not a network problem - the router, btw, seems to idle happily if I may believe it:

root@Zeus:~# uptime 
 09:19:55 up 7 days,  8:19, load average: 0.00, 0.00, 0.00

So basically, I am wondering - I'd like to have a nice smooth picture, so what kind of hardware upgrade am I looking at? Is anyone running a box him/herself and transcoding HD data to a PS3, if so, what specs? The budget I have is whatever is needed to get smooth playback (that is, if that does not cost me a leg tongue). Any suggestions are greatly appreciated.

Last edited by B (2008-08-06 02:50:51)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2008-08-06 03:02:06

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

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

I have some thoughts on your FFmpeg settings. You have the sameq switch. That will probably override the defaults of mpeg2video. FFmpeg will try to generate a video at the same bitrate as the original with this flag. Also, you have threads at 8. I'm guessing that your well in the area of diminishing returns. I think that with your processor FFmpeg may be able to transcode fast enough with the default 1. If not,  I would try to go up by one until you get successful results. You have a frame rate of 23.97, so I'm assuming PAL. And last, are you using subtitles?

I would try something like this if you don't want subtitles. This should drop the bitrate down to a quality mpeg2 range. You may still need to set the -aspect and -s flags if the PSP doesn't like the input:

ffmpeg -i <your_video> -target pal-dvd -acodec copy -sn  <whatever_your_output_is>

I've never seen FFmpeg spawn multiple processes before. It looks as if they're not using any CPU time though. It's strange all the same. Anyway, FFmpeg will try to use all of your available CPU cycles no matter how fast your machine is.

Offline

#3 2008-08-06 10:37:59

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

Thanks for the hints. I am using PAL indeed (Europe). I am not using any subtitles. I'd like to keep it 1080p, and if I am not mistaken lowering the bitrate would also mean lowering the resolution, or am I wrong about this?

This is the script that Mediatomb calls to transcode:

#!/bin/bash

INPUT="$1"
OUTPUT="$2"
VIDEO_CODEC="mpeg2video"
VIDEO_FPS=`mkvinfo $1 | grep -A 10 'Codec ID: V_MPEG4' | grep -w fps | awk '{print $6}' | cut -d'(' -f2`

mkvinfo $INPUT | grep -qE 'Codec ID.*DTS'

if [ $? -eq 0 ]; then
AUDIO_CODEC="ac3"
AUDIO_BITRATE="-ab 640k"
AUDIO_FREQ="-ar 48000"
AUDIO_CHANNELS="-ac 6"
else
AUDIO_CODEC="copy"
AUDIO_BITRATE=""
AUDIO_FREQ=""
AUDIO_CHANNELS=""
fi

FORMAT="dvd"

ffmpeg -threads 8 -i "${INPUT}" -vcodec ${VIDEO_CODEC} -r ${VIDEO_FPS} -sameq -acodec $AUDIO_CODEC $AUDIO_BITRATE $AUDIO_FREQ $AUDIO_CHANNELS -scodec copy -f ${FORMAT} - > "${OUTPUT}" 2>/dev/null

Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2008-08-06 14:45:41

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

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

You can lower the bitrate without changing the resolution. Drop the -sameq flag and add -b <some_desired_bitrate>. To be safe you can add '-aspect 16:9' and '-s 1920x1080'. The 'dvd' flag shouldn't mess with the resolution since it's not in a 'target' field.

I don't know much about Blu-ray. Is the video codec in this movie mpeg4?

Offline

#5 2008-08-06 20:36:39

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

Mkvinfo returns this:

Codec ID: V_MPEG4/ISO/AVC

Despite Sony's claims of its PS3 being a media centre it supports a laughable option of formats... No FLAC, no Ogg Vorbis, etc. It can't handle the Matroska container format either, hence the transcoding - MPEG4 to MPEG2. I've been googling around for 'minimal' requirements to do this but people somehow don't get further than 'it works over here' or 'heck it's choking every time' tongue.

I haven't checked what is eating all the CPU, if it's not ffmpeg then maybe the problem lies elsewhere (honestly I just saw the bunch of ffmpeg instances and thought it to be the culprit). I'll dig some more and get back here smile. Thanks for your pointers so far.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2008-08-07 00:25:19

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

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

I've been reading reports that PS3 can handle DivX. Maybe something as simple as:

-vcodec copy -vtag xvid -acodec copy (in AVI if you need a container)

If the mpeg4 profile is too complex, then maybe just using FFmpeg's internal mpeg4 encoder:

-sameq -vcodec mpeg4 -vtag xvid -acodec copy

I'd still lower the threads if I were you. I've seen performance drops on a dual core processor for anything > 4. I'd also strip the subtitles. But hey, that's just me.

By the way, I hope I'm either being helpful or at least interesting here. If not, feel free to tell me to go away.

Offline

#7 2008-08-07 01:17:48

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

There are no subtitles as far as I can tell wink. I have done some experiments myself, and had the transcode script create a file of half a GB, then transfered it to my laptop to see how it plays. It plays smoothly. So the issue is definitely the power of the server. I'll see if bringing down the threads helps - as you said there's a lot of ffmpeg threads using no CPU, yet some are, and I think they all make up for the full CPU usage.

I've consulted some folks in the Mediatomb IRC channel and googling some more, it seems for on the fly transcoding I'll need a hell of a box. Gonna read up some more and I'll see if it's worh it.

Last edited by B (2008-08-07 01:18:04)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#8 2008-10-08 21:15:23

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 99

Re: Minimal specs to convert 1080p Matroska to PS3-compatible format?

what about installing arch on the ps3 and playing nfs shares?
http://wiki.ps2dev.org/ps3:mediacenter
works fine here...

edit: well except your main goal - matroska... sorry

Last edited by konni (2008-10-08 21:18:29)

Offline

Board footer

Powered by FluxBB