Whenever I try to use UMS with my Panasonic TV or Playstation 4, videos don't play if MEncoder is enabled and with a high priority.
On UMS's log, I see this:
Process /Applications/Universal Media Server.app/Contents/Resources/osx/mencoder has a return code of 1! Maybe an error occurred... check the log file
If I check the log file, I see this:
DEBUG 2015-10-09 18:37:24.100 [mencoder-20] Starting /Applications/Universal Media Server.app/Contents/Resources/osx/mencoder -ss 0 /Users/goncalossilva/Movies/Movie.avi -msglevel statusline=2 -oac copy -of lavf -lavfopts format=mpegts -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 2 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=libx264:threads=8:o=preset=superfast,crf=19,g=250,i_qfactor=0.71,qcomp=0.6,level=3.1,weightp=0,8x8dct=0,aq-strength=0,me_range=16:vrc_maxrate=1000:vrc_buf_size=2500 -ass -ass-color ffffff00 -ass-border-color 00000000 -ass-font-scale 1.4 -font /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/LucidaSansRegular.ttf -ass-force-style FontName=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/LucidaSansRegular.ttf,Outline=1,Shadow=1,MarginV=10 -noflip-hebrew -subcp ISO-8859-1 -nosub -sub /Users/goncalossilva/Movies/Movie.srt -ofps 24 -lavdopts fast -mc 0 -noskip -o - -really-quiet -msglevel statusline=2
DEBUG 2015-10-09 18:37:24.110 [mencoder-20] Attaching thread: mencoder-20
DEBUG 2015-10-09 18:37:24.110 [mencoder-20] Unix process ID (/Applications/Universal Media Server.app/Contents/Resources/osx/mencoder): 77874
INFO 2015-10-09 18:37:24.211 [mencoder-20] Process /Applications/Universal Media Server.app/Contents/Resources/osx/mencoder has a return code of 1! Maybe an error occurred... check the log file
If I try the command myself, while removing -really-quiet to see the output, I get this:
videocodec: libavcodec (1280x720 fourcc=34363268 [h264])
Your options /preset=superfast,crf=22,g=250,i_qfactor=0.71,qcomp=0.6,level=4.1,weightp=0,8x8dct=0,aq-strength=0,me_range=16/ look like gibberish to me pal
FATAL: Cannot initialize video driver.
This happens with avi, mkv and mp4 movies files. It has happened for many months (years?) now on OS X, which wasn't a problem because my PS3 played them fine, but now using a PS4 or a Panasonic TV I can't get past this error without disabling mencoder and resorting to ffmpeg, which has much lower quality.
Is there any other information I can share to help debug and fix this? Thank you.
This thread might shed some light on the issue: https://lists.mplayerhq.hu/pipermail/mplayer-users/2012-February/084222.html (seems to be the same problem).
Is it possible to update mencoder to the latest on their repository?
@goncalossilva
This thread might shed some light on the issue: https://lists.mplayerhq.hu/pipermail/mplayer-users/2012-February/084222.html (seems to be the same problem).
Is it possible to update mencoder to the latest on their repository?
That bug was patched in 2012 so even though the error message is the same, I doubt the cause is related.
@Nadahar Makes sense.
I went a step further in debugging by removing the options it complains about one by one... and ended up removing them all. Still fails:
videocodec: libavcodec (1280x720 fourcc=34363268 [h264])
[libx264 @ 0xee7160]broken ffmpeg default settings detected
[libx264 @ 0xee7160]use an encoding preset (e.g. -vpre medium)
[libx264 @ 0xee7160]preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0xee7160]speed presets are listed in x264 --help
[libx264 @ 0xee7160]profile is optional; x264 defaults to high
Could not open codec.
FATAL: Cannot initialize video driver.
I'm starting to think this is not related with the options passed in, but with the codec itself.
The string of commands "preset=superfast,crf=22,g=250,i_qfactor=0.71,qcomp=0.6,level=4.1,weightp=0,8x8dct=0,aq-strength=0,me_range=16" is important because MEncoder can't really use libx264 by default, the way we use it. So these are just settings to make that work.
Is there an OS X build of MPlayer/MEncoder that you recommend we use? The one linked from the official website had its last release in 2013 (http://mplayerosx.ch/) so I'm not sure if that would be a good choice either.
@SubJunk Huh, I had no idea it wouldn't work without them :sweat_smile: Unfortunately I have no suggestions of OS X builds of MPlayer / MEncoder... I have never used the software except for the one that's bundled with UMS. Which one does UMS use?
I'm having the same exact (at least very similar) issue, but only with some files, other videos work perfectly. I have no idea what the differences between the files are though. This happens when playing videos on my PS4 and PC through firefox. Here's the part from the debug log where I can see it go nuts (It's a little long, the error is at the bottom):
DEBUG 2015-12-05 20:24:25.740 [mencoder-2-2] [matroska,webm @ 0x7fe120206600]max_analyze_duration reached
DEBUG 2015-12-05 20:24:25.743 [mencoder-2-2] * MUXER_LAVF ********************
DEBUG 2015-12-05 20:24:25.743 [mencoder-2-2] REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
DEBUG 2015-12-05 20:24:25.743 [mencoder-2-2] INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
DEBUG 2015-12-05 20:24:25.743 [mencoder-2-2] will play these INCORRECT files as if nothing were wrong!
DEBUG 2015-12-05 20:24:25.743 [mencoder-2-2] *************************
DEBUG 2015-12-05 20:24:25.774 [mencoder-2-2] Unsupported AVSampleFormat 8
DEBUG 2015-12-05 20:24:25.774 [mencoder-2-2] Unsupported AVSampleFormat 8
DEBUG 2015-12-05 20:24:25.774 [mencoder-2-2] [ac3 @ 0x7fe11f95eaa0]channel_layout not specified
DEBUG 2015-12-05 20:24:25.774 [mencoder-2-2] [ac3 @ 0x7fe11f95eaa0]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
DEBUG 2015-12-05 20:24:25.787 [mencoder-2] Attaching thread: mencoder-2
DEBUG 2015-12-05 20:24:25.791 [Thread-24] MEncoder 1.1-4.8 (C) 2000-2012 MPlayer Team
DEBUG 2015-12-05 20:24:25.792 [mencoder-2-Timer] Created playback timer for PlayStation 4
DEBUG 2015-12-05 20:24:25.792 [Thread-24] success: format: 0 data: 0x0 - 0x5ef88fd3
DEBUG 2015-12-05 20:24:25.792 [Thread-24] libavformat version 54.20.4 (external)
DEBUG 2015-12-05 20:24:25.792 [Thread-24] Mismatching header version 54.20.3
DEBUG 2015-12-05 20:24:25.792 [Thread-24] libavformat file format detected.
DEBUG 2015-12-05 20:24:25.792 [Thread-24] [lavf] stream 0: video (h264), -vid 0, 10bit H.264 - 1080p
DEBUG 2015-12-05 20:24:25.792 [Thread-24] [lavf] stream 1: audio (flac), -aid 0, -alang jpn, 2.0 FLAC
DEBUG 2015-12-05 20:24:25.792 [mencoder-2] Unix process ID (mencoder): 31503
DEBUG 2015-12-05 20:24:25.792 [Thread-24] [lavf] stream 2: subtitle (ass), -sid 0, -slang eng, FFF
DEBUG 2015-12-05 20:24:25.792 [Thread-24] VIDEO: [H264] 1920x1080 0bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
DEBUG 2015-12-05 20:24:25.792 [Thread-24] [V] filefmt:44 fourcc:0x34363248 size:1920x1080 fps:23.976 ftime:=0.0417
DEBUG 2015-12-05 20:24:25.792 [Thread-24] ==========================================================================
DEBUG 2015-12-05 20:24:25.792 [Thread-24] Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
DEBUG 2015-12-05 20:24:25.792 [Thread-24] libavcodec version 54.35.0 (external)
DEBUG 2015-12-05 20:24:25.792 [Thread-24] AUDIO: 48000 Hz, 2 ch, s32le, 0.0 kbit/0.00% (ratio: 0->384000)
DEBUG 2015-12-05 20:24:25.792 [Thread-24] Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
DEBUG 2015-12-05 20:24:25.792 [Thread-24] ==========================================================================
DEBUG 2015-12-05 20:24:25.792 [Thread-24] OK, exit.
DEBUG 2015-12-05 20:24:25.793 [Thread-24] Opening video filter: [ass auto=1]
DEBUG 2015-12-05 20:24:25.793 [Thread-24] [ass] auto-open
DEBUG 2015-12-05 20:24:25.793 [Thread-24] ==========================================================================
DEBUG 2015-12-05 20:24:25.793 [Thread-24] Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
DEBUG 2015-12-05 20:24:25.793 [Thread-24] Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
DEBUG 2015-12-05 20:24:25.793 [Thread-24] ==========================================================================
DEBUG 2015-12-05 20:24:25.806 [Thread-24] Could not find matching colorspace - retrying with -vf scale...
DEBUG 2015-12-05 20:24:25.806 [Thread-24] Opening video filter: [scale]
DEBUG 2015-12-05 20:24:25.806 [Thread-24] Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
DEBUG 2015-12-05 20:24:25.806 [Thread-24] [swscaler @ 0x7fe12045c640]using unscaled yuv420p10le -> yuv420p special converter
DEBUG 2015-12-05 20:24:25.808 [Thread-24] videocodec: libavcodec (1920x1080 fourcc=34363268 [h264])
DEBUG 2015-12-05 20:24:25.809 [mencoder-2-2] Your options /preset=superfast,crf=23,g=250,i_qfactor=0.71,qcomp=0.6,level=3.1,weightp=0,8x8dct=0,aq-strength=0,me_range=16/ look like gibberish to me pal
DEBUG 2015-12-05 20:24:25.809 [Thread-24]
DEBUG 2015-12-05 20:24:25.809 [mencoder-2-2] FATAL: Cannot initialize video driver.
DEBUG 2015-12-05 20:24:25.809 [Thread-24] Exiting...
INFO 2015-12-05 20:24:25.816 [mencoder-2] Process mencoder has a return code of 1! Maybe an error occurred... check the log file
It probably happens with videos when loading subtitles. We should look into that.
That'd be very nice :). Is there any way to force mencoder off and use ffmpeg instead? I can't seem to find an option that does that...
You can disable "Defer to MEncoder for subtitles" in the FFmpeg settings
@goncalossilva @reykjalin Did the latest UMS version solved this issue ?
If not, please, post your log following these steps: http://www.universalmediaserver.com/forum/viewtopic.php?f=3&t=556
@Sami32 Unfortunately I haven't used UMS since encountering this issue since it meant I couldn't watch the shows I was actively watching. Currently I'm using Plex which is more than enough for what I need and seems to be working quite well, so I don't believe I'll be switching to UMS again.
If I switch again and still encounter the same issue I'll be sure to post my log to that thread, assuming that thread will still be active :)
I am still using (and loving) UMS 😊 I'm currently away from home but will
be able to test this next week and provide feedback. Thanks for looking
into this!
On Mon, 8 Aug 2016 at 20:56, Kristófer Reykjalín [email protected]
wrote:
@Sami32 https://github.com/Sami32 Unfortunately I haven't used UMS
since encountering this issue since it meant I couldn't watch the shows I
was actively watching. Currently I'm using Plex which is more than enough
for what I need and seems to be working quite well, so I don't believe I'll
be switching to UMS again.If I switch again and still encounter the same issue I'll be sure to post
my log to that thread, assuming that thread will still be active :)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/UniversalMediaServer/UniversalMediaServer/issues/691#issuecomment-238340124,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGSE0BDBxCsNRMW8CZWvvtRKcaDtutJks5qd3vDgaJpZM4GMQ8Y
.
@reykjalin No problem, but maybe when you'll try the 7.0.0 version you will stick to it ;-)
@goncalossilva Thanks :-)
@Sami32 I've just quickly tried it out and everything seems to work nicely. So much better image quality 😍 I will keep an eye out and report any issues but for now I'm closing this issue. Thanks a lot!
@goncalossilva thanks :)
@goncalossilva Thanks for you feedback :+1:
Unfortunately, this issue is back 😞 I haven't used UMS in a while so I can't pinpoint when it came back or why, but I am using version 6.5.2 at the moment.
@goncalossilva why do you use Mencoder when the default transcoding engine is FFmpeg?
@goncalossilva Some people will not agree with me, but i recommend you to make a clean UMS install and try it without modifying any parameters.
And one by one, change the parameters you need, until you identify the one that is making trouble.
@valib I've been using UMS for a long time, and I don't recall changing this — maybe Mencoder was the default at some point? Still, I generally prefer Mencoder as the quality is much better in my setup.
@Sami32 Will do. Do you know where the UMS.conf file is stored in OS X?
@goncalossilva
Do you know where the UMS.conf file is stored in OS X?
/home/<username>/Library/Application Support/UMS
As suggested, did a clean install of UMS. As @valib said, ffmpeg is indeed the default engine on a clean installation.
However, like before, ffmpeg works but mencoder (if I swap them) doesn't, with the error / logs provided above still being valid.
It's up to team, but I would suggest leaving this issue open — UMS works out of the box, but mencoder support is broken. I'm assuming the plan would be to a) fix it or b) remove that option on OS X, but I'm unsure how you'd prefer to proceed.
@goncalossilva I've always wondered (have seen it mentioned before) how the quality is better with MEncoder? MEncoder use FFmpeg as well, so it must be some tweaking done by MEncoder then..?
The only difference I can see it that the subtitles render differently.
@goncalossilva MEncoder is "deprecated", this old version is only keep now for some very specific subtitles cases and DVD that FFmpeg is not able to handle correctly yet, AFAIK.
The FFmpeg quality greatly improved and it's now prefered, so i doesn't understand as well why you use it ?
Sorry, but i didn't saw your log. Did you already provided your full TRACE log ?
@Nadahar Trying ffmpeg yesterday and today has indeed yielded much better quality than I was expecting. "Visual quality" is always extremely subjective, and my perception is very old (from the PMS days) and likely incorrect at this point.
@Sami32 Please see above. I've provided some logging (@reykjalin as well) and have even ran the mencoder command manually, removing option by option. The problem seems to be in the mencoder build.
This has been fixed in a recent release