VLC as a backend transcoding engine

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

VLC as a backend transcoding engine

Postby TheLQ » Wed Jul 11, 2012 6:26 pm

The more that I use PMS the more that I get frustrated with the ffmpeg/mencoder backend for video transcoding. I watch lots of anime which means subtitles, different encoding methods, and different formats. Once I get it working with one show it breaks another one. I know I've totaled hours tinkering with PMS to fix a/v sync issues, subtitles sync issues, subtitles formatting issues, etc. Its extremely annoying

With VLC being extremely popular, playing a file correctly 99% of the time, and being around for a long time, I'm very curious as to what technical hurdles prevent it working with PMS. I know its used as a web transcoding engine but what about normal videos? Is there anything that would explicitly hinder VLC as a transcoding engine?

The reason I'm asking is because I'm seriously interested in implementing VLC as a transcoding engine, but I want to know a) if PMS devs are open to the idea and b) Any existing attempts and technical hurdles faced.

EDIT: I'm also interested if my experience with VLC (playing 99% of files correctly when all other engines fail) is common with others on the most recent version (Trying to avoid "Well last time I used VLC was 0.9.8 with some random file, crashed, and I ignored all versions since then")

Thanks
TheLQ
 
Posts: 16
Joined: Wed Jul 11, 2012 6:18 pm

Re: VLC as a backend transcoding engine

Postby chocolateboy » Wed Jul 11, 2012 7:33 pm

VLC is no longer supported and the engine will soon be removed.
chocolateboy
Project Member
 
Posts: 2577
Joined: Wed Sep 16, 2009 10:05 am

Re: VLC as a backend transcoding engine

Postby TheLQ » Wed Jul 11, 2012 7:53 pm

Care to elaborate or point me to discussion as to why? I have almost never had an issue with playing anything in VLC over the years yet I can't get ffmpeg/mencoder to consistently work with 3 videos.

As I said in the OP, I'm interested as to
  1. Why was support dropped?
  2. What version of VLC was this decision made under?
  3. Is there a constructive list of issues that made it impossible to work with VLC?
  4. If a working implementation was created by me or someone else would it be supported by PMS devs?

"hurr, vlc sux" doesn't tell me anything
TheLQ
 
Posts: 16
Joined: Wed Jul 11, 2012 6:18 pm

Re: VLC as a backend transcoding engine

Postby happy.neko » Wed Jul 11, 2012 8:27 pm

TheLQ wrote:The reason I'm asking is because I'm seriously interested in implementing VLC as a transcoding engine

Why not? :) Is VLC reliable in mpeg2 muxing though?
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: VLC as a backend transcoding engine

Postby chocolateboy » Wed Jul 11, 2012 9:11 pm

TheLQ wrote:The reason I'm asking is because I'm seriously interested in implementing VLC as a transcoding engine, but I want to know a) if PMS devs are open to the idea and b) Any existing attempts and technical hurdles faced.


If you're proposing to give the VLC engine some love, then I have no objection to staying its execution.

As for the whys, search the forum. Its idiosyncrasies and segfaults have broken more patient people than me:

shagrath wrote:Just spent some time to get the latest versions working, but I failed. Add to this I absolutely hate VLC (don't ask why :p), I don't think I will ever work on this again
chocolateboy
Project Member
 
Posts: 2577
Joined: Wed Sep 16, 2009 10:05 am

Re: VLC as a backend transcoding engine

Postby TheLQ » Sun Jul 15, 2012 2:45 am

Just an update, I have VLC working with 95% of the random assortment of video's I threw at it (all of which were in different formats). This is already significantly more than I ever got working with ffmpeg/mencoder.

My repo for those who are interested: https://github.com/LordQuackstar/ps3mediaserver

I think the issue that previous attempts have had is that VLC transcoding hasn't really been all that good in the 0.x series and 1.x series. However with VLC 2.0.2 it is very robust, handling even the bug someone detailed in net.pms.encoders.VideoLanVideoStreaming (which BTW would of been nice to know existed before I wasted 2 days trying to figure out the API. My fault).

I have essentially duplicated the VideoLanVideoStreaming class in net.pms.encoders.VLCVideo and did various modifications to it so that it would work. As I couldn't figure out the encoder priority in code or configuration I had to disable all other encoders and push VLC trans to the top.

Notes/questions
  1. One of my video's caused VLC to core dump. I've reported it on their forums here: http://forum.videolan.org/viewtopic.php?f=13&t=102593
  2. I've only tested the modifications I finished 10 minuites ago on a PS3. I'll be testing on an Xbox in a little bit. I have also only been testing on Fedora Linux. Windows testing will be later
  3. I do not know PMS's api all that well, so I have no idea what happens when the buffer fills. Will PMS kill VLC and restart it? Will the bufer just fill continuously?
  4. Yes the GUI looks bad. Yes this is temporary. This is my 3rd attempt to learn the JGoodies Form syntax, and it wasn't that successful again. I will be trying later, but I really just wanted to focus on the more important transcoding and less important gui.
  5. The policy with VLC versions that I will be using is this: Only the most recent version of VLC will be supported. This is currently VLC 2.0.2. I've even put in the PMS init method code that warns about using versions less than that. Reasoning: Old versions are broken, have bugs, caused headaches, etc. They have also ruined people's opionions of VLC. If we stick to the latest and greatest it should limit the amount of bug reports and complaining "vlc sux, use a real encoder".

If anyone has some time it would be really helpful to do testing on your own machine or just do a basic code review. I do not know PMS's internals that well so I tried my best. But I've probably done something wrong, so any critisism is welcome.

Thoughts?
TheLQ
 
Posts: 16
Joined: Wed Jul 11, 2012 6:18 pm

Re: VLC as a backend transcoding engine

Postby chocolateboy » Sun Jul 15, 2012 3:40 am

Nice one! Thanks.

TheLQ wrote:with VLC 2.0.2 it is very robust, handling even the bug someone detailed in net.pms.encoders.VideoLanVideoStreaming


Which one (there are several)?

As I couldn't figure out the encoder priority in code or configuration I had to disable all other encoders and push VLC trans to the top.


Try shutting down PMS and adding "vlctrans" to the front of the list of engines in PMS.conf i.e.:

Code: Select all
engines = vlctrans,ffmpegvideo,mencoder,tsmuxer,...


Or move the engine to the top in the GUI and save.

The policy with VLC versions that I will be using is this


Please focus on the code rather than PMS policy.

If anyone has some time it would be really helpful to do testing on your own machine


Testing it now. Thanks again.
chocolateboy
Project Member
 
Posts: 2577
Joined: Wed Sep 16, 2009 10:05 am

Re: VLC as a backend transcoding engine

Postby Raptor399 » Sun Jul 15, 2012 8:32 am

Excellent work there, TheLQ!

I can confirm transcoding works on OSX as well with the latest VLC installed.

All my test videos play, even some that MEncoder refuses to play (.rvmb). And for the first time in months I have seen Japanese and Hebrew subtitles!
The subtitles use different fonts, but font selection is always a bit quirky in my experience.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: VLC as a backend transcoding engine

Postby happy.neko » Sun Jul 15, 2012 6:52 pm

Good work, TheLQ.
The real question now is who will implement support for UnbufferedOutputFile (i.e. true timeseeking) because current buffered implementation is the main showstopper for _proper_ universal support for non-PS3 renderers.
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: VLC as a backend transcoding engine

Postby TheLQ » Sun Jul 15, 2012 8:22 pm

happy.neko wrote:Good work, TheLQ.
The real question now is who will implement support for UnbufferedOutputFile (i.e. true timeseeking) because current buffered implementation is the main showstopper for _proper_ universal support for non-PS3 renderers.


It seems like this is theoretically possible with VLC's remote control interface. Random searching found this: http://forum.videolan.org/viewtopic.php?f=14&t=85347 , a guy who uses the RC interface to rewind, fast forward, and pause.

In VLCVideo's existing implementation , how does PMS or DLAN in general even detect and handle fast forwarding or pausing? Is there some event that could be listened for?
TheLQ
 
Posts: 16
Joined: Wed Jul 11, 2012 6:18 pm

Next

Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest