Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Mkv with DTS transcoding problem

enachemcenachemc Posts: 7Members
Hi,

I have installed PMS 0.9.2.3 on my windows xp laptop (core 2 duo) and I am accessing it from my 32LV375S TV through media link. when i try to watch a movie (MKV with DTS) my processors stay at almost 100%. I understand that plex uses ffmpeg to transcode the DTS to mp3, but this should not take all the processing power. Investigating further, I found out the ffmpeg process:

"D:\Programs\Plex\Plex Media Server\ffmpeg.exe" transcode http://192.168.2.150:32400/library/parts/10470 "C:\DOCUME~1\mariuse\LOCALS~1\Temp\plex-transcode-7d409ae6-3417-434b-9ef9-5e0b3d65deba\media" 10 1 0 any nil 0.0 yes UTF-8 default "" "" 0.75 nil none "" "" "" 3355443 yes

If i run it manually, it works as under plex (100% CPU):
!!! Will NOT copy the audio stream
!!! Will NOT copy the video stream

Google says that this means that video gets transcoded also. I do not understand why. The tv is capable of playing back the video (it works from the USB stick minus the sound).
Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x544, PAR 1:1 DAR 40:17, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

The bottom line: why is plex doing video transcoding ???
«1

Comments

  • enachemcenachemc Posts: 7Members
    I tweaked the command a line a bit: if I use the following parameters, Plex will no perform video transcoding:
    10 1 0 any nil 0.0 yes UTF-8 default "" "" 0.75 av high 1080 41 "" 3355443 yes

    These parameter value come from the capabilities sent by the Media Link; then why doesn't plex call ffmpeg with these parameter values ? How can we adjust this ?
  • denzdenz Posts: 3Members
    enachemc, great find. I'm willing to bet this is the cause of most problems people have with buffering when trying to stream anything DTS. The plus side too is that it has the possibility of being an easy fix. I hope this thread gets some attention as it seems to be the most plausible cause.

    Wow, I'm even excited about the potential for this! It would clear up the last major gripe I have with the LW5600 right now. Thanks!
  • SinnerNLSinnerNL Posts: 16Members
    +1
  • nhguaponhguapo Posts: 9Members ✭✭
    +1
  • halata67halata67 Posts: 3Members
    +1
  • BlownJettaBlownJetta Posts: 8Members
    +1
  • RingleaderRingleader Posts: 3Members ✭✭
    OK, I have version 0.9.5.2 (and I can't seem to find where to download an older version) and it appears the ffmpeg transcoder run through plextranscoder.exe in this version.

    I have no idea were I can find and/or tweak the command line. I am generally quite computer savvy, but I just don't see it. Any help here would be GREATLY appreciated as I am running the exact same hardware as you and experiencing the same issues.

    Thanks!!!
  • the kurganthe kurgan Posts: 9Members
    Evening All,

    Just wondering whether people are using "enachemc's work around" successfully ?????

    Enachemc are you able to play DTS now with your fix ??

    Cheers,
  • hefterim@gmail.comhefterim@gmail.com Posts: 13Members ✭✭
    edited February 2012
    We use MKV2AC3 to convert the movies to AC3 which solves the problem. Sure hope plex people will fix it but the software is very simple and can do batches overnight so its not much of a hassle.

    http://www.videohelp.com/tools/MKV2AC3
  • coalfieldcoalfield Posts: 11Members, Plex Pass
    +1

    I have exactly the same problem. Its very frustrating that DTS audio cannot simply be passed through to my amp, however that aside playing any video file via medialink is impossible becuase it appears to transcode both video and audio so buffers all the time (on gigabit lan froma quad core PC). Its such a shame as it renders media link virtually useless for playing movies (most nowdays are DTS)
  • Qwerty1979Qwerty1979 Posts: 1Members, Plex Pass
    Same problem here buffering like crazy.
  • MartialMartial Posts: 4Members
    fyi

    hardware
    lg lw6500 with lg soundbar bluray 3d
    PC dual core proc with 4gb ram
    pms server latest built
    tv connected via lan

    its possible to pass through 5.1 via hdmi arc ensure u have compliant hdmi cable
    enable arc in tv audio setup
    setup digital output to all in tv audio setup

    dts sound will be transcoded to 5.1 tested with 3d and non 3d movie
    however strongly recommend to change dts to ac3 to avoid transcoding and slowness
    ac3 will be play as 5.1 on lg soundbar
  • dreamlayersdreamlayers Posts: 22Members
    I'm also running into this issue with Plex 0.9.5.3 in Windows 7 and LG 47LW5600 running firmware 4.02.62.

    Enachemc, thanks for showing how to change the command line. It seems to have the desired effect according to the text output of PlexTranscoder. I thought a simple workaround was possible: create a wrapper which changes those parameters and calls the real PlexTranscoder. Since PlexMediaServer.exe contains the string "PlexTranscoder.exe" I expect the wrapper needs to end in .exe. I wrote a small C program, called it PlexTranscoder.exe and renamed the real transcoder to PlexTranscoder-real.exe. It seems the "" arguments really need to be "" and not empty strings. I got it working from the command line, but when I try to stream from the TV, it shuts off and then turns back on. I guess that means the TV crashed.

    It is possible to re-encode just the audio when streaming over DLNA using Serviio, but then I can't seek. According to info on the Serviio forums, it's the TV's fault.

    This is annoying. I thought the lack of DTS support in the TV wasn't a big deal because DTS could be transcoded while streaming, but there's no good solution for that now.
  • dreamlayersdreamlayers Posts: 22Members
    I finally have a fix! :D

    I'm using Detours from Microsoft Research to intercept when "Plex Media Server.exe" runs other executables. When it runs PlexTranscoder.exe, the command line is edited as described by enachemc.

    You can download PlexTranscodeDetour from Dropbox. You are free to do whatever you want with my code here. Detours components are distributed according to the license from Microsoft Research. This code and program comes with absolutely no warranty. Use at your own risk.

    For more information look at README.txt inside and the code in PlexTranscodeDetour.c. I also posted what's basically the same as the contents of README.txt on my blog.

    BTW I think my previous approach didn't work because "Plex Media Server.exe" couldn't communicate with PlexTranscoder-real.exe when it was run via my PlexTranscoder.exe stub.
  • pmillpmill Posts: 157Members ✭✭
    EXCELLENT FIX! It works. Now PlexTranscoder.exe runs about 22% cpu instead of 99%. The movie doesn't seem to load any faster on LGTV but everything seems to work fine and no stressing out the server.

    One note, after executing the Plex shortcut it errored saying needs msvcr100d.dll. I dont think that comes with msvc++ redistributable. I had to download it separately and add to the PlexTrascodeDetour folder.

    Nice work dreamlayers, much appreciated.
  • dreamlayersdreamlayers Posts: 22Members
    edited March 2012
    pmill wrote:

    One note, after executing the Plex shortcut it errored saying needs msvcr100d.dll. I dont think that comes with msvc++ redistributable. I had to download it separately and add to the PlexTrascodeDetour folder.


    Thanks for pointing this out. That's the debug version of msvcr100.dll. I recompiled PlexTranscodeDetour.dll to depend on msvcr100.dll, which parts of Plex depend on already and everyone ought to have nowadays.

    Unfortunately, I'm still getting video interruptions.

    I was just getting interruptions on a 720p video. The video clearly wasn't being transcoded, based on the CPU usage. PlexTranscoder even finished the transcoding and stopped running, and Plex Media Server was sending data from temporary files generated by the transcoder. There was only one suspicious thing: CPU load by Plex Media Server was capped at 25%. Below 25% there were variations, and 25% was a limit that was never exceeded. (For example, imagine mountainous terrain with all the tops cut off at the same level.) Now this looks like maxing out of one CPU core, but Process Explorer showed that the load was distributed over several threads, and per-core graphs showed that it was distributed over several CPU cores with no core reaching 100%. I guess Plex Media Server is written so that the multiple threads cannot run at the same time (via thread synchronization functions). It also must be very inefficient, because just sending already transcoded data over the network should not use 25% of a Q6600. I'm left wondering if video transcoding was the problem even.

    PlexTranscoder.exe also ended up transcoding video in one case because the bitrate was too high. (You see why it's transcoding in the output of PlexTranscoder.exe.) Okay, 20Mbps is high, but it's well below the BluRay max bitrate, and it's well below the limits of 100Mbps Ethernet. I couldn't figure out what command line arguments to change to stop the video transcoding there. (You can play with the command line arguments from the command prompt. You can get the command line being used currently from Plex logs or Process Explorer. Note that the logs will show what Plex intended to send, and Process Explorer will show the actual arguments after changing by PlexTranscodeDetour.dll.) This problem is also related to DTS because if I transcode the audio to AC3 using MKV2AC3, then Plex does not transcode anything. It serves the original file without executing PlexTranscoder.exe.

    Edit: After a bit more experimentation, I don't think that buffer underruns during transcoding are due to the CPU not being able to transcode video fast enough. Yes, 99% CPU usage, sounds bad, as if a tiny little bit more demand from a more complex scene would cause interruptions in playback. However, Plex is actually transcoding as fast as the CPU will allow, and with the files I tested, faster than normal playback speed. It is staying ahead of playback and storing transcoded data for future playback in temporary files. The 99% CPU usage could potentially mean that not enough processing power remains for sending to the TV, but even that doesn't seem to be a big problem. If you're transcoding video you could try just increasing "Plex Media Server.exe" priority in Task Manager. That will give it higher priority than the transcoder and ensure it gets enough CPU time.

    If you want to experiment, you could try an older version of Plex. I posted instructions for downloading older versions in another thread. I don't see anything older than 9.5 there.

    Not transcoding anything can greatly reduce CPU usage for me, down to about 3% or so. That ought to give flawless playback, as long as the file doesn't have such a high bitrate that the TV cannot read it fast enough.
  • pmillpmill Posts: 157Members ✭✭
    I haven't had a chance to watch a full movie to see if stuttering starts again, during the week my Medialink is just for tv shows (no dts). But from the limited testing I did with the movies, I noticed the same 25% cpu use, didn't put it together that it was capped around there. From what I noticed before my server was able to keep up at 99% cpu transcoding for about 45 minutes to an hour before it started stuttering. Then it would mysteriously start doing it. I checked for other processes running and that wasn't the problem, but my system temperatures were high and all fans blowing full speed. I figured out that stopping the movie and letting the server cool down for about 10 minutes would usually let me finish the movie without further stuttering. My guess is that the system was overheating and throttling the cpu a little more then it could keep up with in the transcode. It does look like PlexTranscode is incredibly inefficient. But I hope now with your fix it will be ok, it will probably be the weekend before I'm able to watch a full movie on it.

    I have an Intel i3 2105 by the way.
  • dreamlayersdreamlayers Posts: 22Members
    Does anyone else see "Plex Media Server.exe" CPU usage increasing over time when playing a video that is being transcoded by Plex?

    Here's an example, playing a 720p video and using a Q6600 CPU. I didn't use the fix I posted here, so both the video and audio were being transcoded. Around the start of the video, "Plex Media Server.exe" CPU usage was around 4% and always well under 10%, but around 16 minutes into the video it was around 20%, peaking to 22% and very rarely falling to 5%. I also saw a similar increase when using my fix so only the audio was transcoded.

    I suspect pauses start when the increasing "Plex Media Server.exe" CPU usage reaches 100% of one core, which corresponds to 25% on this 4-core Q6600 CPU. This would explain why they typically start later on.

    Note that I'm talking about "Plex Media Server.exe" CPU usage only. The transcoding is done in PlexTranscoder.exe, and I'm not talking about that. You can see the CPU usage of individual processes using Task Manager.
  • AmberVikingAmberViking Posts: 3Members
    Hi All

    New to this so still very wet behind the ears!

    Specs for my rig are:

    LG 42LW650T Software version 5.11.08
    PMS 0.9.5.3
    Netgear DGN2000 Router
    Dell 2 Quad Q8200 2.33GHz 4Gb RAM 32-bit


    However, although I do suffer from the same buffering issue with audio DTS files I have found that it is not true for every file. Some files play without any problem at all. There seems to be no rhyme or reason. I first thought it was to do with the size of the file, but a 2 gig file can struggle when a 10 gig file plays fine and vice versa.

    I've also tried changing the process priority, but this has had no effect either.

    I'm wondering whether this maybe has something to do with the sofware version of the TV. Everything worked fine when I bought the TV just before Christmas, but I started noticing this buffering problem a few months later when there had been maybe 2 or 3 software updates.

    It's very frustrating and I keep an eye on the forum in the hope there will be a fix.

    All the best
  • es95ples95pl Posts: 12Members, Plex Pass Plex Pass
    edited April 2012
    pmill wrote:

    EXCELLENT FIX! It works. Now PlexTranscoder.exe runs about 22% cpu instead of 99%. The movie doesn't seem to load any faster on LGTV but everything seems to work fine and no stressing out the server.

    One note, after executing the Plex shortcut it errored saying needs msvcr100d.dll. I dont think that comes with msvc++ redistributable. I had to download it separately and add to the PlexTrascodeDetour folder.

    Nice work dreamlayers, much appreciated.


    Everything works much better with this fix. I also see cpu decrease from 99% to 20-30%. i now don't need to convert the movies to ac3 before watching!
    Nick, what is your input on this matter? Why don't you LG guys look into this and fix it?
    Creds to dreamlayers!
«1
Sign In or Register to comment.