MEncoder and subtitle problem

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
elpetak
Posts: 11
Joined: Thu Mar 28, 2013 3:57 pm

Re: MEncoder and subtitle problem

Post by elpetak »

I've reported the same issue here: viewtopic.php?f=9&t=766
But then I used the same workaround: hdmi cable from laptop to TV.

Yesterday I had the need to use UMS again so I installed 2.6.5 (complete reinstall after wiping the directory and also checking the "clean install" box) hoping the problem would be resolved but I'm sorry to say it isn't.

Mencoder works if I don't want subtitles, it even works with h.264 which I think is AWESOME.
But the moment I throw a subtitle to the mix it breaks (and leaves a couple of orphan mencoder.exe processes eating up ram and cpu).

FFmpeg works with and without subs.
Mencoder without subtitles works (and with h.264 is beautiful).
Mencoder with subtitles fails.
Avisynth+mencoder without subtitles works.
Avisynth+mencoder with subtitles fails.

Thanks,
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: MEncoder and subtitle problem

Post by ExSport »

What about to test latest v3.x.x version and post full debug log in TRACE mode/level? ;)
elpetak
Posts: 11
Joined: Thu Mar 28, 2013 3:57 pm

Re: MEncoder and subtitle problem

Post by elpetak »

Allright, test done.
First I uninstalled the old version and deleted the install directory.
Then I installed 3.0.0-a5 and selected the "clean install" checkbox.

Tested and got the same result.
Playback failed and three "mencoder.exe" were left running (one of them consuming high cpu).

Got a "There is no inputstream to return for test.mkv [MEncoder] {Audio: DTS/English} {Sub: SubRip}" error.
And a couple of "External input stream instance is null... stopping process"

Full log and config attached (log leve: trace)

Thanks,
Attachments
ums_dbg.zip
(41.6 KiB) Downloaded 456 times
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: MEncoder and subtitle problem

Post by ExSport »

DEBUG 2013-09-10 19:48:08.537 [mencoder.exe-9] Starting C:\UMS\win32\mencoder.exe -ss 0 C:\Peliculas\test\test.mkv -msglevel statusline=2 -nosound -of rawvideo -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 2 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:threads=4:keyint=25:vqmax=5:vqmin=2:vrc_maxrate=23000:vrc_buf_size=7000 -ass -ass-color ffffff00 -ass-border-color 00000000 -ass-font-scale 1.4 -font C:\Windows\Fonts\Arial.ttf -ass-force-style FontName=C:\Windows\Fonts\Arial.ttf,Outline=1,Shadow=1,MarginV=10 -noflip-hebrew -fontconfig -subcp cp1252 -nosub -sub C:\Peliculas\test\test.srt -ofps 24000/1001 -vf expand=-0:-2,softskip -lavdopts fast -mc 0 -noskip -o \\.\pipe\1378853288365ffmpegvideo
DEBUG 2013-09-10 19:48:08.541 [Thread-52] Waiting for pipe connection \\.\pipe\1378853288535audioout
DEBUG 2013-09-10 19:48:08.646 [mencoder.exe-10] Starting C:\UMS\win32\mencoder.exe -ss 0 C:\Peliculas\test\test.mkv -really-quiet -msglevel statusline=2 -channels 2 -ovc copy -of rawaudio -mc 0.1 -noskip -aid 0 -oac copy -quiet -quiet -srate 48000 -o \\.\pipe\1378853288535ffmpegaudio01
DEBUG 2013-09-10 19:48:08.647 [tsMuxeR.exe-8] Starting C:\UMS\win32\tsMuxeR.exe C:\Users\Fede\AppData\Local\Temp\universalmediaserver\pms-tsmuxer.meta \\.\pipe\1378853288363tsmuxerout.ts
DEBUG 2013-09-10 19:48:08.747 [New I/O worker #8] External input stream instance is null... sounds not good, waiting 500ms
It seems tsMuxeR generates empty stream.
Please try to exactly repeat test what you logged above (playing test.mkv with DTS audio).
If will generate "C:\Users\Fede\AppData\Local\Temp\universalmediaserver\pms-tsmuxer.meta" file.Post it here (file is rewritten everytime you will play file via UMS and remuxing is used!)
Anyway you can test it yourself what is happening.
In CMD run this command:
C:\UMS\win32\mencoder.exe -ss 0 C:\Peliculas\test\test.mkv -msglevel statusline=2 -nosound -of rawvideo -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 2 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:threads=4:keyint=25:vqmax=5:vqmin=2:vrc_maxrate=23000:vrc_buf_size=7000 -ass -ass-color ffffff00 -ass-border-color 00000000 -ass-font-scale 1.4 -font C:\Windows\Fonts\Arial.ttf -ass-force-style FontName=C:\Windows\Fonts\Arial.ttf,Outline=1,Shadow=1,MarginV=10 -noflip-hebrew -fontconfig -subcp cp1252 -nosub -sub C:\Peliculas\test\test.srt -ofps 24000/1001 -vf expand=-0:-2,softskip -lavdopts fast -mc 0 -noskip -o c:\video.h264
After 15secs break it by ctrl+c. Check if valid stream was generated (that file c:\video.h264 is not empty = very small size)
Same with audio, in cmd run:
C:\UMS\win32\mencoder.exe -ss 0 C:\Peliculas\test\test.mkv -really-quiet -msglevel statusline=2 -channels 2 -ovc copy -of rawaudio -mc 0.1 -noskip -aid 0 -oac copy -quiet -quiet -srate 48000 -o audio.dts
Is it empty file? Not? Did you see any errors in console? Ok, it seems MEncoder generates valid streams (if size of every file is bigger than 1MB) but when tsMuxeR muxes them together something will goes wrong.
Here you can edit "C:\Users\Fede\AppData\Local\Temp\universalmediaserver\pms-tsmuxer.meta" file. You need to change only paths to audio and video streams! UMS generates meta file with named pipes instead of real files so you should change them with real files you generated above.
With edited meta file where you will change pipes to full paths to your audio.dts and video.h264. Save it.
Run in CMD:
C:\UMS\win32\tsMuxeR.exe C:\Users\Fede\AppData\Local\Temp\universalmediaserver\pms-tsmuxer.meta c:\muxed.ts
What is happening? It should create muxed.ts file. Do you see any errors or resultant file is empty? If yes, post spotted errors here. ;)
elpetak
Posts: 11
Joined: Thu Mar 28, 2013 3:57 pm

Re: MEncoder and subtitle problem

Post by elpetak »

This is weird... Now that part works. I swear I didn't change anything.

The only issue now is that DTS audio is somehow not working with my external receiver but that could be something wrong with my setup.

Anyway, the last test I just did had this "pms-tsmuxer.meta":

Code: Select all

MUXOPT --no-pcr-on-video-pid --no-asyncio --new-audio-pes --vbr --vbv-len=500
V_MPEG-2, "\\.\pipe\1379026382302videoout", fps=23.976, level=4.1, insertSEI, contSPS, track=1
A_LPCM, "\\.\pipe\1379026382307audioout", track=2
it worked ok the 2 times I tried (pasting the normal log here just for the timestamps):

Code: Select all

09-12 19:51:56  Starting transcode/remux of test.mkv
09-12 19:51:58  Started playing test.mkv on your PlayStation 3
09-12 19:52:54  Stopped playing test.mkv on your PlayStation 3
09-12 19:52:57  Starting transcode/remux of test.mkv
09-12 19:52:57  Started playing test.mkv on your PlayStation 3
09-12 19:53:18  Stopped playing test.mkv on your PlayStation 3
and the corresponding log is attached in case it helps figure out what was different this time.

I'm thinking it's a timing issue where mencoder doesn't start sending stuff fast enough but I'm just guessing.
What worries me now is the DTS "noise" but that's not a big deal. I'll try other DTS streams and see if it's really a problem or if it's just me.

Thanks,
Attachments
ums_dbg.zip
(49.8 KiB) Downloaded 484 times
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: MEncoder and subtitle problem

Post by ExSport »

Something went wrong but great it works now :-)
DTS static noise is normal when you something changes audio stream sent by UMS. When you are enabling DTS feature in UMS, read what popup say!
Problem can be enabled postprocessing, only LEFT or RIGHT channel is set in PS3, different audio level in PS3 than normal=centered....anything.
silverdroid
Posts: 8
Joined: Thu Sep 18, 2014 12:35 pm

Re: MEncoder and subtitle problem

Post by silverdroid »

I'm experiencing a similar problem on OSX with version 4 and 5. I have lightning speed buffering with my setup, but the minute I enable subtitles, buffering goes at a snail pace which makes it almost impossible to watch anything without constantly pausing. I've tried all different encoder types, same result.
Upani
Posts: 1
Joined: Wed Oct 14, 2015 1:09 pm

Re: MEncoder and subtitle problem

Post by Upani »

Just leave only mencoder and tsmuxer activated on video engines, first mencoder, then tsmuxer. Now go to common transcoding settings, and on audio tab, mark "Use LPCM" (even if you're using a wireless connection). Now restart the server and test it. It works for me.

Previously I've tried to make custom presets on tsmuxer advanced options, but I've got just video fixes, the problem was clearly the audio stream and its sync with the subs, so i wanted to stream it without compression and LPCM fix it. :x
Post Reply