Attempting to Add WTV Support

Discuss issues related to PS3 Media Server development (only for programmers)

Attempting to Add WTV Support

Postby dburckh » Wed Sep 21, 2011 6:45 am

So happy day, ffmpeg is finally supporting wtv! I was looking for a way to stream wtv from my WMC box to anything. In the US, WTV is just MPEG-2 w/AC3 or MPA, so I figured I would just drop it in as a type to the DVRMS. That didn't work because it uses a special version of ffmpeg.

Anyway the ffmpeg command line to do the conversion is this:
Code: Select all
"C:\Program Files (x86)\PS3 Media Server\win32\ffmpeg.exe" -copyts -i "video.wtv" -vcodec copy -acodec copy -f vob - > d:\temp\test.mpg 2> err.txt


For DVRMS, you guys are doing this.
Code: Select all
C:\Program Files (x86)\PS3 Media Server\win32\dvrms\ffmpeg_MPGMUX.exe -i video -title dummy -f vob -copyts -vcodec copy -acodec copy -threads 2 -g 1 -qscale 1 -qmin 2 pipe:


Questions:
  • Why are you using a special version of ffmpeg for this? I think the normal version of ffmpeg supports dvrms.
  • Does "pipe:" do the same thing as "-" or is there a difference?

So, a couple of things that seem odd to me:
  • I'm not sure "title" does anything for vob because PES doesn't support metadata.
  • qscale, qmin don't make sense on a passthrough, or do they?
  • I'm not sure threads make sense on a passthrough.

Anyway, I'll play with converting it over to use the standard version of ffmpeg. Just want to know if there are any gotchas. Thanks!
dburckh
 
Posts: 9
Joined: Wed Sep 21, 2011 6:25 am

Re: Attempting to Add WTV Support

Postby dburckh » Wed Sep 21, 2011 4:47 pm

Did a little more investigation and I can answer some of my own questions:

"-" and "pipe:" are the same.
The qscale, etc are being added as default ffmpeg properties. Probably could comment this out for this operation.

The remux seems to be "working" (not blowing up), but it looks like the client is request http get/xxx/xxx.wtv. I'm assuming this is a bug because the mime type is video/mpeg. I believe the DLNA spec says the extension and mime type should be correct, so the link name should be get/xxx/xxx.wtv.mpg or something. I'm not sure if this is because PS3 media server is putting out both <res> tags (.wtv and the .mpg/vob) or if it's an issue with my code/the old dvrms code. I'll investigate further this evening. It might also be because I'm not actually using a PS3. :)
dburckh
 
Posts: 9
Joined: Wed Sep 21, 2011 6:25 am

Re: Attempting to Add WTV Support

Postby dburckh » Thu Sep 22, 2011 3:16 am

Good news/ bad news. It looks like I have WTV working for PS3! Probably needs some testing and it may have broken dvr-ms. :)

Bad news, is it was never my target. I was targeting LG TV/Android. I'm guessing the problem is the file name extension. That and it doesn't appear that the file size is reported properly in the Content-Range header.

Issues:
  • Seek doesn't work. Always starts at the beginning.
  • May have broken dvr-ms. Needs testing
  • Currently using a PES stream. Due to PES limitations, I'm guessing Non-US WTV files won't work. Could convert it to TS, which should solve the problem
  • Can't seem to figure out how to change the extension on file in the URL. I think other platforms would work if I got that fixed
  • I need to get a little love from one of the PS3 Media Developers on how to proceed to contribute
If there was enough interest, I could write a native Java Remuxer that should fix the seek problem and would be much faster. That would be on the condition that someone could help me with my extension issue and give me a little education on the internals of PS3 Media Server. That would take a considerably more than 4 hours.

If anybody is interested in playing with this, I'll post the pms.jar file, if it's allowed.
dburckh
 
Posts: 9
Joined: Wed Sep 21, 2011 6:25 am

Re: Attempting to Add WTV Support

Postby ExSport » Fri Sep 23, 2011 6:26 am

Patches are welcome so if your remux code will be faster and more stable than already used, why not to implement it to main trunk? 8-)
ExSport
 
Posts: 2161
Joined: Mon Jan 19, 2009 5:40 pm

Re: Attempting to Add WTV Support

Postby dburckh » Fri Sep 23, 2011 8:30 pm

It would definitely be faster (limited buffering) and generally more reliable (no pipes to break), but it's a lot of work and I have limited IT time. :) I have the code already written, but it's file based and its tied into my remuxing toolkit. Unless you want the whole enchilada in your code base, I would have to strip it down to just what we need.

http://experts.windows.com/frms/windows ... 95712.aspx

I think I can figure out how to add a new transcoder (remuxer), but I would also need pointers on how to override the file extension in the HTTP url. That seemed less trivial. I'm not 100% certain, but I remember reading that the extension has to match the mime type to be DLNA compliant. The PS3 seems more forgiving about this, but other clients/renderers don't.
dburckh
 
Posts: 9
Joined: Wed Sep 21, 2011 6:25 am

Re: Attempting to Add WTV Support

Postby ExSport » Sat Sep 24, 2011 9:48 am

tsMuxeR is quite buggy and development ended so any alternative is welcomed. Also I see your muxer is in pure java, nice.
Maybe it will be good to rename topic so also other developers will spot some new direction and don't miss this topic because it is about something not interesting for them 8-)
If seeking will be better with your code, stable and compatible with any file(audio delay support etc.) than what is used now, it will be much appreciated with all of us :mrgreen:
Thx
ExSport
 
Posts: 2161
Joined: Mon Jan 19, 2009 5:40 pm

Re: Attempting to Add WTV Support

Postby dburckh » Sat Sep 24, 2011 6:57 pm

Yeah, I'm not sure my muxer is any less buggy than TSMuxer. :) Also, it's not a real muxer. It only remuxes. It assumes the A/V packets already have timestamps. Generally it works better than TsMuxer on streams will "holes" in them because TSMuxer does a real mux which can cause (or fix) sync issues..

I only have limited support. At the moment. WTV, M2/TS, mpeg -> M2/TS, mpeg, demux

What kind of problems are you trying to solve at the moment?
dburckh
 
Posts: 9
Joined: Wed Sep 21, 2011 6:25 am

Re: Attempting to Add WTV Support

Postby madpb » Sun Sep 25, 2011 4:00 am

This would be a great feature to be able to play WTV files.
I tried adding this line under the MISC Setting: Alternative FFmpeg path -:
"C:\Program Files (x86)\PS3 Media Serverbeta\win32\ffmpeg.exe" -copyts -i "video.wtv" -vcodec copy -acodec copy -f vob - > d:\temp\test.mpg 2> err.txt

I cannot see any WTV files listed in the folder I am sharing.
Did anyone else get this to work??
madpb
 
Posts: 1
Joined: Fri Sep 04, 2009 5:35 pm

Re: Attempting to Add WTV Support

Postby Raptor399 » Sun Sep 25, 2011 7:14 am

Nice work, dburckh. It's good to see development pick up where tsMuxeR left off.

Personally I would rather integrate a working library into PMS than integrate its full source code into PMS. I think the devs have enough work on their hands already trying to make PMS work without having to worry about the inner workings of transcoding and muxing. ;-)
Compare tsMuxeR itself; we happily use it, but we don't have to know what makes it tick internally.

If you would manage to cook up a viable standalone replacement that works on all platforms, we would be silly to not consider it. :-)
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Attempting to Add WTV Support

Postby dburckh » Mon Sep 26, 2011 4:37 am

madpb wrote:This would be a great feature to be able to play WTV files.
I tried adding this line under the MISC Setting: Alternative FFmpeg path -:
"C:\Program Files (x86)\PS3 Media Serverbeta\win32\ffmpeg.exe" -copyts -i "video.wtv" -vcodec copy -acodec copy -f vob - > d:\temp\test.mpg 2> err.txt

I cannot see any WTV files listed in the folder I am sharing.
Did anyone else get this to work??


Sorry. It was more than that. I had to hack up the Java code too. That's just what is necessary to get ffmpeg to work.
dburckh
 
Posts: 9
Joined: Wed Sep 21, 2011 6:25 am

Next

Return to Developers

Who is online

Users browsing this forum: No registered users and 4 guests