Page 1 of 1

Xbox 360, Aspect ratio and MPG files

PostPosted: Wed Oct 05, 2011 12:17 pm
by retnutz
First off - thank you for the great program! I, like many others have mentioned, have played around with other upnp and dlna compliant server software and none come close to serviio.

I currently have ripped many of my DVD collection to straight mpeg2 encoded mpg files (mpeg-ps). When I use my Xbox 360, it sees serviio just fine and decodes the video, but the aspect ratio is not correct - it looks like 4x3 anamorphic. I've search here and other forums but have not heard anyone else talking about the same issue with Xbox 360. If I change the aspect ratio on the TV, it "sort of" works - the video gets cut off on the sides (which makes me think the video being output by ffmpeg is not truely 4x3) I have a Sony BDP-370 which plays back wonderfully.

Is there anything I can look at or send you to help out? I've not touched profiles.xml, and I see that the video are being converted to wmv for the Xbox 360

Thanks again!

-M

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Wed Oct 05, 2011 12:27 pm
by Illico
What is your TV models?

Could you post "ffmpeg -i" of your DVD-rip?

Could you enable detailed logging (see signature links), clean the log file, restart serviio service, start to stream the file to the Xboc, then look at the ffmpeg command line used by serviio (post result here)?

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Wed Oct 05, 2011 2:14 pm
by retnutz
The TV is a Sony LCD, all other video from the Xbox, cable box, or Sony BDP is output OK. I will post a follow up with the info you are looking for this evening (at work currently). Thank you in advance for the help!

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Wed Oct 05, 2011 11:12 pm
by retnutz
OK - here's the info you requested. Let me know anything else you need to know. Thank you!

FFMPEG -i

ffmpeg version N-33195-gedf1a8e, Copyright (c) 2000-2011 the FFmpeg developers
built on Oct 1 2011 16:36:00 with gcc 4.6.1
configuration: --disable-static --enable-shared --enable-gpl --enable-version3
--enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --e
nable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable
-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libsc
hroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-l
ibvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxa
vs --enable-libxvid --enable-zlib
libavutil 51. 18. 0 / 51. 18. 0
libavcodec 53. 19. 0 / 53. 19. 0
libavformat 53. 13. 0 / 53. 13. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 6 / 2. 43. 6
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg @ 00000000003AF950] max_analyze_duration 5000000 reached at 5021356

Seems stream 0 codec frame rate differs from container frame rate: 59.94 (60000/
1001) -> 59.94 (60000/1001)
Input #0, mpeg, from 'e:\_movies\2012\2012.mpg':
Duration: 02:37:48.83, start: 0.200000, bitrate: 2305 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [SAR 32:27 DA
R 16:9], 9800 kb/s, 24.10 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s


LOG FILE SECTION

2011-10-05 18:00:26,776 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: E:\_movies\2012\2012.mpg
2011-10-05 18:00:26,777 DEBUG [ProcessExecutor] Starting C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -i E:\_movies\2012\2012.mpg -y -vcodec wmv2 -b 30000k -maxrate 30000k -bufsize 5097k -r 24000/1001 -g 15 -copyts -acodec wmav2 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f asf D:\_temp\Serviio\transcoding-temp-435-ASF.stf
2011-10-05 18:00:27,277 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file 2012.mpg: WMVMED_FULL

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Thu Oct 06, 2011 12:02 am
by retnutz
A couple of screen shots. I ran the ffmpeg command the serviio runs and captured the output of both the original and converted files.

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Thu Oct 06, 2011 9:28 am
by Illico
Thanks, could you try locally the following command line in windows terminal (please provide the ffmpeg logging)
1-serviio original transcoding command line:
C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -i "E:\_movies\2012\2012.mpg" -y -vcodec wmv2 -b 30000k -maxrate 30000k -bufsize 5097k -r 24000/1001 -g 15 -copyts -acodec wmav2 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f asf "D:\_temp\Serviio\TEST-ASF.stf"

2- you could try adding aspect ratio 4/3 option like this:
C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -i "E:\_movies\2012\2012.mpg" -y -vcodec wmv2 -b 30000k -maxrate 30000k -bufsize 5097k -r 24000/1001 -g 15 -vf "setdar=4:3" -copyts -acodec wmav2 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f asf "D:\_temp\Serviio\TEST_4-3-ASF.stf"

3- you could try adding aspect ratio 16/9 option like this:
C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -i "E:\_movies\2012\2012.mpg" -y -vcodec wmv2 -b 30000k -maxrate 30000k -bufsize 5097k -r 24000/1001 -g 15 -vf "setdar=16:9" -copyts -acodec wmav2 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f asf "D:\_temp\Serviio\TEST_16-9-ASF.stf"

4-you could also add padding option like this
C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -i "E:\_movies\2012\2012.mpg" -y -vcodec wmv2 -b 30000k -maxrate 30000k -bufsize 5097k -r 24000/1001 -g 15 -vf "scale=1280:1280/dar/sar","pad=1280:720:(ow-iw)/2:(oh-ih)/2:black","setdar=4:3" -copyts -acodec wmav2 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f asf "D:\_temp\Serviio\TEST_Padding-ASF.stf"

You could then copy the output result files and add them to the serviio library and play them in native format with Serviio/Xbox.

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Sat Oct 08, 2011 12:28 pm
by retnutz
Thought I'd post back... I tried all the encoding option you listed below, thank you for all the help! - but they all turned out basically the same.

I did find a "sort of" solution though - in the forums under 3rd party tools in this post viewtopic.php?f=17&t=2069
there is a tool that changes the AspectX and AspectY of the header in the asf container. When you run the tool, it reports the header has not been set for those values. If you set it to 4:3 all works out just as it should and the video plays back as expected.

I'm looking into ffmpeg source right now to see why it does not set this, or if there is a way to set it - ffmpeg is pretty big :)

Also check out the discussion of the tool here: http://forum.doom9.org/showthread.php?t=116761

-M

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Sat Oct 08, 2011 1:22 pm
by retnutz
A little more info. Seems to be a feature that is not currently being used in ffmpeg for encoding, though I did find the code for decoding (asfdec.c) :(

http://web.archiveorange.com/archive/v/ ... ydtlHh8Gbr

I took a look at the hex for a changed and unchanged file, using the tool in my last post, and it is pretty abusive :shock: though it works and it could be reproduced in serviio or a command line program.

This really sucks... it makes transcoding from mpg to wmv unusable for now. I'm tempted to write a work around hack to watch for WMV files being produced and change their headers :) I don't know enough C or ffmpeg to contribute to asfenc.c the correct code.

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Sun Oct 09, 2011 4:23 pm
by zip
could you possibly create a 10 seconds mpeg2 video with this problem and upload it somewhere so that I can try reproducing it when I work on the PAR ticket?

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Mon Oct 10, 2011 1:15 pm
by retnutz
Sure thing! I'll upload it tonight when I get home.

Thanks!

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Mon Oct 10, 2011 11:18 pm
by retnutz
zip, here you go:

http://www.mediafire.com/?lt01h1u29fp63cs

I can upload more if needed. Thanks!

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Tue Oct 11, 2011 8:53 am
by zip
thanks

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Sat Oct 15, 2011 2:20 pm
by zip
I need the original file, not the asf.

Re: Xbox 360, Aspect ratio and MPG files

PostPosted: Sun Oct 16, 2011 1:16 pm
by retnutz
Shit... my mistake. Here you go:

http://www.mediafire.com/?tt74xpanz3xvc29