[Solved] Issue with MEncoder

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
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

[Solved] Issue with MEncoder

Post by GuardianX »

Hey,

I've been having an issue with MEncoder where the source is a very high quality MKV file and the output to the PS3 or media player from UMS is very blocky.

If I play the same file with a priority on FFmpeg the file plays flawlessly but without subtitles.

I'm trying to get the best of both worlds with flawless quality and subtitles. If this isn't possible ATM, at least that will keep me from pulling my hair out.

I've attached a few shots of my overall settings and can attach a log if needed..
Attachments
avime.JPG
avime.JPG (112.33 KiB) Viewed 17316 times
mencoder.JPG
mencoder.JPG (140.07 KiB) Viewed 17316 times
transcode.JPG
transcode.JPG (170.4 KiB) Viewed 17316 times
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: Issue with MEncoder

Post by SubJunk »

Hi GuardianX,

The easiest way to fix the problem is probably to reset your config file, which can be done by going to C:/ProgramData/UMS and renaming UMS.conf to something else (like UMS1.conf) then re-installing UMS.

If that doesn't work, logs would be useful, please reproduce the problem then go to the Traces tab and click "Pack debug files", and attach the generated zip file here.
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

Re: Issue with MEncoder

Post by GuardianX »

Well to be honest, the native files won't be of much use to you because in order to get the file playing at all I had to heavily modify settings.

Here is a clean install run of the file..

I'll create a new post with the debug of what I am working with that has NEARLY what I want after this one.

Code: Select all

INFO  2012-11-03 14:00:00.596 [New I/O server worker #2-6] Starting transcode/remux of Shrek.mkv
DEBUG 2012-11-03 14:00:00.619 [New I/O server worker #2-7] Starting "C:\Program Files (x86)\Universal Media Server\win32\ffmpeg.exe" -ss 2 -i "C:\Users\NAME\Videos\Dvd backups\NEEDS RENAMED\Van Helsing.mkv" -an -an -s 320x180 -vframes 1 -f image2 pipe:
DEBUG 2012-11-03 14:00:00.620 [New I/O server worker #2-7] Attaching thread: ffmpeg.exe-15
DEBUG 2012-11-03 14:00:00.662 [New I/O server worker #2-6] Creating pipe \\.\pipe\1351976400661ffmpegvideo
DEBUG 2012-11-03 14:00:00.666 [New I/O server worker #2-6] Creating pipe \\.\pipe\1351976400661videoout
DEBUG 2012-11-03 14:00:00.666 [Thread-74] Waiting for pipe connection \\.\pipe\1351976400661ffmpegvideo
DEBUG 2012-11-03 14:00:00.667 [Thread-75] Waiting for pipe connection \\.\pipe\1351976400661videoout
DEBUG 2012-11-03 14:00:00.667 [New I/O server worker #2-6] Creating pipe \\.\pipe\1351976400667ffmpegaudio01
DEBUG 2012-11-03 14:00:00.667 [New I/O server worker #2-6] Creating pipe \\.\pipe\1351976400667audioout
DEBUG 2012-11-03 14:00:00.667 [Thread-78] Waiting for pipe connection \\.\pipe\1351976400667ffmpegaudio01
DEBUG 2012-11-03 14:00:00.668 [Thread-79] Waiting for pipe connection \\.\pipe\1351976400667audioout
DEBUG 2012-11-03 14:00:00.676 [Buffered IO End Checker] Stopping process: ffmpeg.exe-7
DEBUG 2012-11-03 14:00:00.737 [New I/O server worker #2-6] Creating pipe \\.\pipe\1351976400737tsmuxerout.ts
DEBUG 2012-11-03 14:00:00.737 [Thread-81] Waiting for pipe connection \\.\pipe\1351976400737tsmuxerout.ts
DEBUG 2012-11-03 14:00:00.837 [mencoder.exe-16] Starting "C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\NAME\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -quiet -quiet -really-quiet -msglevel statusline=2 -ovc copy -nosound -mc 0 -noskip -of rawvideo -o \\.\pipe\1351976400661ffmpegvideo
DEBUG 2012-11-03 14:00:00.839 [mencoder.exe-16] Attaching thread: mencoder.exe-16
DEBUG 2012-11-03 14:00:00.937 [mencoder.exe-17] Starting "C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\NAME\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -quiet -quiet -really-quiet -msglevel statusline=2 -channels 6 -ovc copy -of rawaudio -mc 0 -noskip -oac copy -fafmttag 0x2000 -lavcopts acodec=ac3:abitrate=640 -af lavcresample=48000 -srate 48000 -quiet -quiet -o \\.\pipe\1351976400667ffmpegaudio01
DEBUG 2012-11-03 14:00:01.037 [tsMuxeR.exe-18] Starting "C:\Program Files (x86)\Universal Media Server\win32\tsMuxeR.exe" C:\Users\GUARDI~1\AppData\Local\Temp\universalmediaserver\pms-tsmuxer.meta \\.\pipe\1351976400737tsmuxerout.ts
DEBUG 2012-11-03 14:00:01.038 [tsMuxeR.exe-18] Reading pipe: \\.\pipe\1351976400737tsmuxerout.ts
DEBUG 2012-11-03 14:00:01.135 [mencoder.exe-17] Attaching thread: mencoder.exe-17
DEBUG 2012-11-03 14:00:01.138 [tsMuxeR.exe-18] Attaching thread: tsMuxeR.exe-18
DEBUG 2012-11-03 14:00:01.151 [Thread-74] Result of \\.\pipe\1351976400661ffmpegvideo : true
DEBUG 2012-11-03 14:00:01.154 [Thread-78] Result of \\.\pipe\1351976400667ffmpegaudio01 : true
DEBUG 2012-11-03 14:00:01.223 [Thread-92] SmartLabs tsMuxeR.  Version 1.10.6  http://www.smlabs.net
DEBUG 2012-11-03 14:00:01.279 [Buffered IO End Checker] Stopping process: ffmpeg.exe-8
DEBUG 2012-11-03 14:00:01.424 [Thread-79] Forced reconnection of \\.\pipe\1351976400667audioout with result : true
DEBUG 2012-11-03 14:00:01.424 [Thread-75] Forced reconnection of \\.\pipe\1351976400661videoout with result : true
DEBUG 2012-11-03 14:00:01.424 [Thread-79] Result of \\.\pipe\1351976400667audioout : true
DEBUG 2012-11-03 14:00:01.424 [Thread-75] Result of \\.\pipe\1351976400661videoout : true
DEBUG 2012-11-03 14:00:01.427 [Thread-92] Decoding H264 stream (track 1): Profile: [email protected]  Resolution: 36:0i  Frame rate: 0.0802478
DEBUG 2012-11-03 14:00:01.427 [Thread-92] Change H264 level from 1.5 to 4.1
DEBUG 2012-11-03 14:00:01.427 [Thread-92] H.264 muxing fps not set. Get fps from stream.
DEBUG 2012-11-03 14:00:01.427 [Thread-92] H.264 stream does not contain fps field. Muxing fps=0.0802478
DEBUG 2012-11-03 14:00:01.428 [Thread-92] Decoding H264 stream (track 1): Profile: [email protected]  Resolution: 528:32i  Frame rate: not found
DEBUG 2012-11-03 14:00:01.428 [Thread-92] Change H264 level from 22.6 to 4.1
DEBUG 2012-11-03 14:00:01.428 [Thread-92] Decoding H264 stream (track 1): Profile: [email protected]  Resolution: 112:1856i  Frame rate: not found
DEBUG 2012-11-03 14:00:01.429 [Thread-92] Change H264 level from 19.4 to 4.1
DEBUG 2012-11-03 14:00:01.430 [Thread-81] Result of \\.\pipe\1351976400737tsmuxerout.ts : true
DEBUG 2012-11-03 14:00:01.430 [Thread-92] 100.0% complete
DEBUG 2012-11-03 14:00:01.432 [Thread-92] Decoding H264 stream (track 1): Profile: [email protected]  Resolution: 16:128i  Frame rate: not found
DEBUG 2012-11-03 14:00:01.432 [Thread-92] Change H264 level from 4.2 to 4.1
DEBUG 2012-11-03 14:00:01.482 [Thread-86] Not enought buffer for parse video stream. Current frame num 0
INFO  2012-11-03 14:00:01.482 [tsMuxeR.exe-18] Process C:\Program Files (x86)\Universal Media Server\win32\tsMuxeR.exe has a return code of -2! Maybe an error occurred... check the log file
DEBUG 2012-11-03 14:00:01.483 [tsMuxeR.exe-18] Stopping process: mencoder.exe-16
DEBUG 2012-11-03 14:00:01.483 [Thread-74] Error: null
DEBUG 2012-11-03 14:00:01.483 [Thread-73] Error :null
DEBUG 2012-11-03 14:00:01.483 [tsMuxeR.exe-18] Stopping process: mencoder.exe-17
DEBUG 2012-11-03 14:00:01.483 [Thread-79] Error: null
DEBUG 2012-11-03 14:00:01.483 [Thread-77] Error :null
DEBUG 2012-11-03 14:00:01.483 [Thread-75] Disconnected pipe: \\.\pipe\1351976400661videoout
DEBUG 2012-11-03 14:00:01.483 [Thread-79] Disconnected pipe: \\.\pipe\1351976400667audioout
INFO  2012-11-03 14:00:01.538 [StartPlaying Event] renderer: 192.168.1.52, file: C:\Users\NAME\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv
DEBUG 2012-11-03 14:00:01.548 [Buffered IO End Checker] Stopping process: ffmpeg.exe-9
DEBUG 2012-11-03 14:00:01.941 [Buffered IO End Checker] Stopping process: ffmpeg.exe-10
DEBUG 2012-11-03 14:00:02.213 [Buffered IO End Checker] Stopping process: ffmpeg.exe-11
DEBUG 2012-11-03 14:00:02.477 [Buffered IO End Checker] Stopping process: ffmpeg.exe-12
DEBUG 2012-11-03 14:00:02.819 [Buffered IO End Checker] Stopping process: ffmpeg.exe-13
DEBUG 2012-11-03 14:00:03.027 [Buffered IO End Checker] Stopping process: ffmpeg.exe-14
DEBUG 2012-11-03 14:00:03.197 [Buffered IO End Checker] Stopping process: ffmpeg.exe-15
DEBUG 2012-11-03 14:00:04.038 [Buffered IO End Checker] Stopping process: tsMuxeR.exe-18
INFO  2012-11-03 14:00:05.548 [StopPlaying Event] renderer: 192.168.1.52, file: C:\Users\NAME\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv
Attachments
ums_dbg.zip
(13.26 KiB) Downloaded 454 times
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

Re: Issue with MEncoder

Post by GuardianX »

This is what I am currently working with as well as a fresh log.

Video is processed using MEncoder 1st (since FFmpeg doesn't do subs)

Video is blocky

audio is timed well

Subs are timed well

File plays with no log visible errors.
Attachments
Post-change _ums_dbg.zip
(12.82 KiB) Downloaded 467 times
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

Re: Issue with MEncoder

Post by GuardianX »

Didn't want to sound all needy coming to the forums and whining.

Love your work with the PMS build, the new UI looks fantastic and from the looks didn't sacrifice any functionality for looks.

Nice to see you taking such a hands on approach but I hope you don't get burnt out on it!
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: Issue with MEncoder

Post by SubJunk »

The only reason I can see for blocky output would be that your TV isn't upscaling it; if you have an HD TV then this source video (which is only 720x480) may not have enough pixels to look good on the TV.
If you want to test the quality of the file being sent to the TV, you can open CMD, go to a new folder (like C:/a/ or something) and run the following command, which is taken straight from your last log:

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\GuardianX\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -msglevel statusline=2 -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=8 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:threads=8:keyint=5:vqscale=1:vqmin=1:vrc_maxrate=274000:vrc_buf_size=1835 -font C:\Windows\Fonts\Arial.ttf -subfont-text-scale 3 -subfont-outline 1 -subfont-blur 1 -subpos 98 -fontconfig -spuaa 3 -sid 0 -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -o file.mpeg
That will create a file that is exactly what UMS is sending.

Thanks for the comments and concern, I've been burned out on work in the past so hopefully I can spot it happening before it gets bad now, I do a lot of recreation to balance it out too :)
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

Re: Issue with MEncoder

Post by GuardianX »

SubJunk wrote:The only reason I can see for blocky output would be that your TV isn't upscaling it; if you have an HD TV then this source video (which is only 720x480) may not have enough pixels to look good on the TV.
If you want to test the quality of the file being sent to the TV, you can open CMD, go to a new folder (like C:/a/ or something) and run the following command, which is taken straight from your last log:

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\GuardianX\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -msglevel statusline=2 -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=8 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:threads=8:keyint=5:vqscale=1:vqmin=1:vrc_maxrate=274000:vrc_buf_size=1835 -font C:\Windows\Fonts\Arial.ttf -subfont-text-scale 3 -subfont-outline 1 -subfont-blur 1 -subpos 98 -fontconfig -spuaa 3 -sid 0 -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -o file.mpeg
That will create a file that is exactly what UMS is sending.

Thanks for the comments and concern, I've been burned out on work in the past so hopefully I can spot it happening before it gets bad now, I do a lot of recreation to balance it out too :)
This is what running it as you said produced.
vlcsnap-2012-11-05-13h04m52s234.png
vlcsnap-2012-11-05-13h04m52s234.png (435.5 KiB) Viewed 17298 times
Here is what the native file looks like when played directly in VLC.
vlcsnap-2012-11-05-13h09m33s244.png
vlcsnap-2012-11-05-13h09m33s244.png (417.03 KiB) Viewed 17298 times
the shots are not the same scene but the general opening.

Also it should be said, and I'm not sure if this makes a difference but, the output file from the command you gave me was almost 2x the file size of the original file and I'm not sure if it finished the file.
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: Issue with MEncoder

Post by SubJunk »

Interesting, looks like a MEncoder bug.

Can you try this one?

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\GuardianX\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:keyint=5:vqscale=1:vqmin=2:vrc_maxrate=54000:vrc_buf_size=1835 -sid 0 -ofps 24000/1001 -mc 0 -noskip -o file.mpeg
And maybe this one too:

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\GuardianX\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:keyint=5:vqscale=1:vqmin=2:vrc_maxrate=54000:vrc_buf_size=1835 -sid 0 -ofps 24000/1001 -o file.mpeg
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

Re: Issue with MEncoder

Post by GuardianX »

SubJunk wrote:Interesting, looks like a MEncoder bug.

Can you try this one?

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\GuardianX\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:keyint=5:vqscale=1:vqmin=2:vrc_maxrate=54000:vrc_buf_size=1835 -sid 0 -ofps 24000/1001 -mc 0 -noskip -o file.mpeg
Outcome:
Slight FPS jitter not sure if it comes from playing the file mid stream.
-Quality seems good
-Audio is synced
-Subs are present
vlcsnap-2012-11-05-13h35m33s223.png
vlcsnap-2012-11-05-13h35m33s223.png (574.97 KiB) Viewed 17295 times

SubJunk wrote: And maybe this one too:

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "C:\Users\GuardianX\Videos\Dvd backups\NEEDS RENAMED\Shrek.mkv" -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:keyint=5:vqscale=1:vqmin=2:vrc_maxrate=54000:vrc_buf_size=1835 -sid 0 -ofps 24000/1001 -o file.mpeg

Outcome:
Same FPS jitter
-Quality seems good
-Audio is delayed
-Subs are present

I ended up killing the process because it was spamming with "Skipping frame!"
vlcsnap-2012-11-05-13h40m24s67.png
vlcsnap-2012-11-05-13h40m24s67.png (736.38 KiB) Viewed 17295 times
GuardianX
Posts: 13
Joined: Sun Nov 04, 2012 7:57 am

Re: Issue with MEncoder

Post by GuardianX »

In reply to the jitter, it was me being stupid and not seeing the "keyframe" variable set to 5 from when I had it at 1.

Readjusted there isn't an issue.

Code: Select all

"C:\Program Files (x86)\Universal Media Server\win32\mencoder.exe" -ss 0 "H:\Entertainment\Movies\Shrek.mkv" -oac copy -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:keyint=1:vqscale=1:vqmin=1:vrc_maxrate=54000:vrc_buf_size=1835 -sid 0 -ofps 24000/1001 -mc 0 -noskip -o file.mpeg
Post Reply