Windows Phone 7

Discuss alternative media renderers (not PS3) supported by PS3 Media Server (e.g. Xbox 360, TVs &c.)

Windows Phone 7

Postby Rickwally » Tue Aug 21, 2012 11:23 am

Hello, I've been using PMS for quite a while now and some days ago I started working on an App for Windows Phone to stream my videos to it through PMS.
At the moment PMS recognizes the windows phone client and I can reproduce all the videos already correctly encoded, the problem is that I can't understand how to set the correct transcoding options for the others.
Windows Phone supports .mp4 and .wmv files as described here.
If I understand correctly there's no way to transcode using as video codec WMV3 so wmv is excluded, using a command like this:

Code: Select all
"C:\Program Files (x86)\PS3 Media Server\win32\ffmpeg.exe" -sn -i "D:\input.avi" -vcodec libx264 -f mp4 -acodec aac -strict experimental -g 1 -qscale 1 -qmin 2 -ab 320k -threads 8 -muxpreload 0 -y "D:\output.mp4"


I obtain a correctly transcoded file, how can I make PMS produce something similar through the .conf file?

At the moment I have this:
Code: Select all
#-----------------------------------------------------------------------------
# PS3 Media Server renderer configuration profile for Windows Phone Devices
#-----------------------------------------------------------------------------
# RENDERER INFORMATION
#

RendererName = Windows Phone

RendererIcon = WindowsPhone.png

#-----------------------------------------------------------------------------
# RENDERER RECOGNITION
#

UserAgentSearch = NativeHost|WindowsPhone

#UserAgentAdditionalHeader = X-AV-Client-Info

#UserAgentAdditionalHeaderSearch =

#-----------------------------------------------------------------------------
# BASIC CAPABILITIES
#

Video = true

Audio = true

Image = true

#-----------------------------------------------------------------------------
# DLNA SETTINGS
#

# SeekByTime: Set to true to use the DLNA feature seek by time instead of by
# range.
SeekByTime = false

# DLNALocalizationRequired: Serve different flavors of localization in the
# DLNA parameters (PAL/NTSC, NA/EU/JP) to allow every world wide renderer to
# see the files. Important for Sony Bravia TVs.
#DLNALocalizationRequired = false

# CBRVideoBitrate is useful for renderers without SeekByTime support. It does time2byte conversion to support FF/RW.
# Only possibility how to predict where we are when seeking is using CBR bitrate instead of VBR used by default
# Making CBR stream by MEnocder is 3 times slower than using VBR so count with it if you have poor computer!
# Speed can be hopefully optimized little bit in the future:
# http://www.ps3mediaserver.org/forum/viewtopic.php?f=14&t=8883&p=53706&hilit=ditlew#p53700
# http://www.ps3mediaserver.org/forum/viewtopic.php?f=11&t=11284&p=62765&hilit=1835#p62765
# CBRVideoBitrate=15000

# ByteToTimeseekRewindSeconds is used for finetuning so default is 0
# ByteToTimeseekRewindSeconds=0

#-----------------------------------------------------------------------------
# MEDIAINFO
#

# MediaInfo: Set to "true" if PMS should parse files with MediaInfo. This will
# give PMS more accurate information, speed up browsing and prevent potential
# playback errors. It also enables the use of "Supported" to more accurately
# define the supported formats for the renderer.
MediaInfo = true

# Se impostato a true vengono restituite cartelle vuote
CreateDLNATreeFaster = false

# TranscodeVideo: Codec to use for video transcoding.
# Currently supported: "MPEGAC3", "MPEGTSAC3" or "WMV".
TranscodeVideo = MPEGTSAC3

# TranscodeAudio: Codec to use for audio transcoding.
# Currently supported: "LPCM", "MP3" or "WAV".
TranscodeAudio = MP3

# DefaultVBVBufSize: Whether or not to use the default DVD buffer size. Setting
# this to "false" means a greater bit rate and faster encoding, but it can
# generate incompatible videos dependent on the renderer.
#DefaultVBVBufSize = false

# WrapDTSIntoPCM: Set to "true" if the media renderer supports DTS wrapped
# into LPCM in a MPEG file.
WrapDTSIntoPCM = false

# MuxLPCMToMpeg: Set to "true" if the media renderer supports LPCM in a MPEG
# file. Ignored if MediaInfo = true.
MuxLPCMToMpeg = false

# MaxVideoBitrateMbps: The maximum bit rate supported by the media renderer.
# Setting to "0" means unlimited.
# If computer is low on resources it is better to avoid using bandwidth limit which is much CPU demanding
# It is better to lower quality settings by defining "CustomMencoderQualitySettings".
# By lowering quality also bitrate is decreased but it is not so CPU aggresive so it is preferred to use it this way
MaxVideoBitrateMbps = 2

# MaxVideoWidth: Maximum width supported by the media renderer. Setting to "0"
# means unlimited. This setting is ignored for files matching "Supported"
# formats when MediaInfo = true.
MaxVideoWidth = 800

# MaxVideoHeight: Maximum height supported by the media renderer. Setting to
# "0" means unlimited. This setting is ignored for files matching "Supported"
# formats when MediaInfo = true.
MaxVideoHeight = 480

# H264Level41Limited: Set to "true" if the media renderer supports only H264
# L4.1 at most.
H264Level41Limited = true

# TranscodeAudioTo441kHz: Set to "true" if music files need to be resampled at
# 44.1kHz.
TranscodeAudioTo441kHz = false

# TranscodeFastStart: Set to "true" if the renderer has a short timeout delay
# and needs to receive transcoded video with minimal delay. If set to "false",
# PMS will take some time to buffer some of the transcoded video.
TranscodeFastStart = true

# TranscodeExtensions: Comma separated list of file extensions that are forced
# to be transcoded and never streamed. Best left empty if MediaInfo = true,
# and define "Supported" formats instead.
TranscodeExtensions =

# StreamExtensions: Comma separated list of file extensions that are forced
# to be streamed and never transcoded. Best left empty if MediaInfo = true,
# and define "Supported" formats instead.
StreamExtensions =

# ForceJPGThumbnails: Some renderers require thumbnails to be represented as
# JPEGs (JPEG_TN) in the DLNA directory XML (e.g. Sony Bravia TVs and Blu-ray
# players). Set this to true to force PMS to use this representation. Note:
# this has no effect on thumbnail file formats or content-type headers.
ForceJPGThumbnails = false

# ChunkedTransfer: Some renderers are particular about the "Content-Length"
# headers in requests (e.g. Sony Blu-ray players). By default, PMS will send
# a "Content-Length" that refers to the total media size, even if the exact
# length is unknown. Default value is false. Set this option to true to omit
# sending a length when it is unknown.
ChunkedTransfer = false

# CustomMencoderQualitySettings: Overrides the MEncoder transcoding quality
# settings in PMS for this renderer. Default is empty, which means the PMS
# settings will be used.
CustomMencoderQualitySettings =

# CustomMencoderOptions: Overrides the MEncoder custom options in PMS for
# this renderer. Default is empty, which means the PMS
# settings will be used.
CustomMencoderOptions = -lavfopts format=mp4 -lavcopts vcodec=mpeg4:acodec=libmp3lame:abitrate=320

#-----------------------------------------------------------------------------
# IMAGES
#

# AutoExifRotate: Many cameras store information in the image file about the
# orientation of the camera while the picture was taken, allowing viewers to
# know which way was up. Set this option to "true" to allow PMS to rotate JPEG
# files based on EXIF information contained in the file, and relieve the
# renderer of that task.
AutoExifRotate = true

#-----------------------------------------------------------------------------
# SUPPORTED MEDIA FORMATS
#

# [Supported video formats]:
Supported = f:mp4     v:h264           a:aac        n:2        m:video/mp4        w:800   h:480
#Supported = f:mp4     v:mp4            a:mp3        n:2        m:video/mp4        w:800   h:480
Supported = f:wmv     v:wmv|vc1        a:wma        n:2        m:video/x-ms-wmv   w:800   h:480

# [Supported audio formats]:
Supported = f:mp3        n:2        m:audio/mpeg
#Supported = f:aac        n:2        a:(?!alac).+        m:audio/x-m4a
Supported = f:wma        n:2        m:audio/x-ms-wma


# [Supported image formats]
Supported = f:bmp        m:image/bmp
#Supported = f:jpg        m:image/jpeg
#Supported = f:png        m:image/png
#Supported = f:gif        m:image/gif

#-----------------------------------------------------------------------------


I hope someone can help me out :-)
Rickwally
 
Posts: 14
Joined: Mon Aug 20, 2012 11:27 pm

Re: Windows Phone 7

Postby Rickwally » Wed Aug 22, 2012 5:58 pm

I'm starting to think that is impossible. The currently supported options for TranscodeVideo are very limited, I even tryed to set
Code: Select all
TranscodeVideo=MPEGTSAC3

and
Code: Select all
CustomMencoderOptions = -ovc x264 -x264encopts qp=20:level_idc=31:threads=8:global_header:bframes=0 -lavcopts acodec=libfaac:aglobal=3:threads=8 -lavfopts format=mp4

Hoping to override the relative options but it is just added in the middle of the others.
I don't know what else can I do. I'd really appreciate some help, at least to know if it's possible or not.
Rickwally
 
Posts: 14
Joined: Mon Aug 20, 2012 11:27 pm

Re: Windows Phone 7

Postby chocolateboy » Wed Aug 22, 2012 8:22 pm

The WMV TranscodeVideo profile (which is currently only supported by MEncoder) is WMV2 video and WMA2 audio in an ASF container, which should work for Windows Phone 7 according to this.

I've updated the PS3 renderer conf to clarify the options.
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Windows Phone 7

Postby Rickwally » Thu Aug 23, 2012 12:22 am

First of all, Thank you for the answer :)
The WMV profile has a problem, when I use it and try to play any video on the phone, the phone crashes (Not just the media player, the whole OS) and that - togheter with the page I linked in the first post - convinced me that the WMV2 video codec was not supported. I'm just passing the uri to the OS's Media Player so it shouldn't be my fault.
Now, out of curiosity I made a test: I used the exact same mencoder's command that uses pms to encode a video in asf, I put the transcoded video in a pms's shared folder and - I can't understand why - playing it throught pms works.
What is the difference between streaming directly and transcoding&streaming? The data received by the client should be exactly the same right?
I'll try to put togheter a little player with the MediaElement and see what happens.

Apart from this, looking at the generated mencoder command I was wondering if it couldn't be improved.
The threads options is set to 1 while with the other profiles is set to 8 (which corresponds to my setting in the transcoding options).
Mencoder reports that [asf @ 010b9da0]Codec for stream 0 does not use global headers but container format requires global headers so maybe would be useful to add the aglobal/vglobal = 3 options but I don't know much about these things so I'm probably wrong.
Rickwally
 
Posts: 14
Joined: Mon Aug 20, 2012 11:27 pm

Re: Windows Phone 7

Postby Rickwally » Thu Aug 23, 2012 3:09 am

Even with the MediaElement component the phone crashes, I tryed also to pass to the media player a uri with the correct extension (Changing it to .asf) but nothing changed.
I looked also at what sends back pms in response to a request and got this:

Code: Select all
HTTP/1.1 200 OK
Content-Type: video/x-ms-wmv
ContentFeatures.DLNA.ORG: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000
Accept-Ranges: bytes
Connection: keep-alive
Server: Windows_7-x86-6.1, UPnP/1.0, PMS/1.60.0


And I was wondering if maybe the media player is expeting a mime type like video/x-ms-asf matching the actual container :-\
I don't see anything else that could cause it....

EDIT: No, it's not. Pms's response to the request of the manually encoded .asf file I was talking before is exactly the same except for content-length

Code: Select all
HTTP/1.1 200 OK
Content-Type: video/x-ms-wmv
ContentFeatures.DLNA.ORG: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000
Accept-Ranges: bytes
Connection: keep-alive
Server: Windows_7-x86-6.1, UPnP/1.0, PMS/1.60.0
Content-Length: 1332055


I'm lost. I think I will pay a visit to the microsoft dev forum. It just can't be that trying to play a media content crashes the entire OS.
Rickwally
 
Posts: 14
Joined: Mon Aug 20, 2012 11:27 pm

Re: Windows Phone 7

Postby Decap_dk » Mon Aug 27, 2012 11:06 am

Hi

I am doing a similar application in Serviio and have run into the exact same issue. Have you been able to find a solution.

I tried using both MediaElement and the MediaPlayerLauncher and a single time I got the MPL to launch the movie. Any tries after this produce similar results as you are getting - complete phone restart!

Any help is much appreciated.
Last edited by chocolateboy on Mon Aug 27, 2012 5:49 pm, edited 1 time in total.
Decap_dk
 
Posts: 1
Joined: Mon Aug 27, 2012 11:02 am

Re: Windows Phone 7

Postby Rickwally » Mon Aug 27, 2012 6:41 pm

Hi, I'm still trying to understand what's the problem -> viewtopic.php?f=11&t=15168
Rickwally
 
Posts: 14
Joined: Mon Aug 20, 2012 11:27 pm

Re: Windows Phone 7

Postby chocolateboy » Mon Aug 27, 2012 7:38 pm

If the same (fatal) error is also occurring with files streamed by a different media server using a different transcoding engine, it's unlikely to be a PMS issue.

Rickwally wrote:I think I will pay a visit to the microsoft dev forum. It just can't be that trying to play a media content crashes the entire OS.


Did you get a response?
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Windows Phone 7

Postby Rickwally » Mon Aug 27, 2012 9:29 pm

Actually I didn't ask since I found a way to limit the crash to the mediaplayer, it is related to the fact that transcoded files are damaged (It still doesn't excuse the crash of the os but that's not my problem now).
Windows Media Player's Transcoding works fine, I'll check with other media servers and see what happens.
Rickwally
 
Posts: 14
Joined: Mon Aug 20, 2012 11:27 pm


Return to Alternative Media Renderers

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests