MEncoder bugs

For help and support with PS3 Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

MEncoder bugs

Postby ExSport » Sun Nov 25, 2012 7:43 pm

Hi all
This weekend I made some tests and found or remembered forgotten:
More cores we use in MEncoder, more A/V sync problems are generated. My test PC is quad core, video is 3:20sec 1080p MKV with AC3.
I made 2 tests for every change to see consistency of encoding time and byte comparison if files are same:
  • 2 threads used for decoding and also encoding - encoding to MPEG2 took 1:46 - files exactly same
  • 3 threads used - time 1:28 - files different!
  • 4 threads used - time 1:33 - files different!
  • 5 threads used - time 1:28 - files different!
  • 6 threads used - time 1:26 - files different!
  • 7 threads used - time 1:28 - files different!
  • 8 threads used - time 1:26 - files different!
Conclusion:
4 cores - 4 threads used is not fastest solution. Made tests 6times and always 4 was slower than 3 cores!
Using 1 or 2 threads generate exactly same file. Any other number generates different files!
MEncoder has a bug - when more cores used, bigger A/V sync issues are visible. So it means maxing treads is not good way!
In MEncoder we can define treads separately for decoder and encoder. Some tests:
  • 8 decoder threads and 2 encoder threads - encoding time 1:40 - files exactly same
  • 2 decoder threads and 8 encoder threads - encoding time 1:35 - files different!
When talking about the A/V sync issues:
  • 16 decoder threads and 16 encoder threads - A/V sync totally out
  • 4 decoder threads and 16 encoder threads - A/V sync OK
  • 16 decoder threads and 4 encoder threads - A/V sync totally out
Conclusion:
Changing threads for encoder generates different files but A/V sync is OK!
Changing threads for decoder generates same files but A/V sync is out!
From those tests I recommend to use max 4 threads for decoder and any number for encoder(depending on CPU used).
Problem is that we can't set threads for decoder and encoder differently but you have to count with this behavior/bug ;)
I have to say that FFMPEG is consistent and changing cores generates A/V synced output with same binary data (it differ between used cores but are same between tests with same thread number)

Another bug is with MPEG-TS output:
I tried to generate TS file instead of PS file (TranscodeVideo=MPEGPSAC3/MPEGTSAC3):
TS uses MEncoder parameters which generates unusable output. FFMPEG generates MPEG_PS only.
MPEG-TS:
Code: Select all
mencoder.exe -ss 100 K:\_Test\sample2.mkv\sample5.mkv -msglevel statusline=2 -oac copy -of lavf -lavfopts format=mpegts -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=576:threads=4:keyint=5:vqscale=1:vqmin=3:vqmax=5:vrc_maxrate=44000:vrc_buf_size=7000 -aid 0 -subdelay 20000 -ofps 24000/1001 -lavdopts fast -endpos 200 -o TS.mpg
MPEG-PS:
Code: Select all
mencoder.exe -ss 100 K:\_Test\sample2.mkv\sample5.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=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=576:threads=4:keyint=5:vqscale=1:vqmin=3:vqmax=5:vrc_maxrate=44000:vrc_buf_size=7000 -aid 0 -subdelay 20000 -ofps 24000/1001 -lavdopts fast -endpos 200 -o PS.mpg

Until FFMPEG will be usable with subtitles we are stick with buggy MEncoder. :(
I posted it here so more people can count with these bugs. Hope it helps.
ExSport
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: MEncoder bugs

Postby chocolateboy » Sun Nov 25, 2012 7:56 pm

Apart from showstoppers and/or issues that affect other engines, the MEncoder engines are no longer being maintained.
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: MEncoder bugs

Postby ExSport » Sun Nov 25, 2012 8:09 pm

Yes I know, because of that reporting it on google code is wasting of time but here can help others to imagine why so big A/V sync probles, how to minimize it, etc.
But until MEncoder will be totally removed I think it is quite useful findings for anybody.
And also if PMS generates invalid MPEG-TS, I suppose it is worth it to fix it if possible until this feature will be totally removed. Or am I wrong?
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm


Return to General Help and Support

Who is online

Users browsing this forum: Bing [Bot] and 10 guests