Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Commit

Permalink
mencoder: always add -mc -noskip (isMencoderNoOutOfSync) when doing A…
Browse files Browse the repository at this point in the history
…C3 remux
  • Loading branch information
ikarsokolov committed Aug 1, 2012
1 parent ee1ff24 commit 9164179
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/pms/encoders/MEncoderVideo.java
Expand Up @@ -2205,7 +2205,7 @@ public ProcessWrapper launchTranscode(
}
}

if ((pcm || dtsRemux) || (configuration.isMencoderNoOutOfSync() && !disableMc0AndNoskip)) {
if ((pcm || dtsRemux || ac3Remux) || (configuration.isMencoderNoOutOfSync() && !disableMc0AndNoskip)) {
if (configuration.isFix25FPSAvMismatch()) {
cmdList.add("-mc");
cmdList.add("0.005");
Expand Down

5 comments on commit 9164179

@ExSport
Copy link
Contributor

@ExSport ExSport commented on 9164179 Aug 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am thinking in right way, this change will lead to A/V sync issues for any file with audio delay:
http://www.ps3mediaserver.org/forum/viewtopic.php?f=14&t=8883&p=67359#p67359
http://www.ps3mediaserver.org/forum/viewtopic.php?f=14&t=8883&p=66961#p66961
http://www.ps3mediaserver.org/forum/viewtopic.php?f=14&t=8883&p=67000#p67000
EDIT:
Checked the code and isMencoderNoOutOfSync is in fact Alternative A/V sync which I have disabled so "-mc 0 -noskip" should not be added.
But for most of people A/V Sync issues can arise because Alt. A/V Sync. is on by default:
https://github.com/ps3mediaserver/ps3mediaserver/blob/master/src/main/external-resources/PMS.conf#L538
Why is it named "Alternative A/V Sync" then when the default setting is ON? :-)

@ikarsokolov
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative A/V sync was always used for AC3 reuxing. But now when we get rid of tsmuxer inclusion we have no means to compensate incorrectly set audio delay. Nothing can be done about this until mencoder fixes this bug. Use other engines (tsmuxer or ffmepg) for such files or disable ac3 remux.

Without Alternative A/V sync playback is choppy so this option should always be on.

@ExSport
Copy link
Contributor

@ExSport ExSport commented on 9164179 Aug 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Word Alternative leads to think it is something which can help if default settings doesn't work. If it will be enabled by default I think naming is little bit misleading:-)
No means to compensate incorrectly set audio delay? What does it mean? That any audio with audio delay is something wrong, incorrect? I don't agree because delay have its meaning and because my native language is not english, almost all native audio track have correct audio delay to be in sync. So nothing incorrect:-)
Using another engines....When not needed, there is nothing why to use MEncoder but when you need subtitles or file is not playable via tsMuxeR or AR is wrong, you need MEncoder. Disable AC3 remux? Why? Never had problem with synced audio, no swapped channels, no distorted audio when AC3 remux is used so I never reencoded audio to loose quality and get more problems ;-)
Without alternative A/V sync playback is choppy? What I remember from forum, you were quite alone with this opinion. I never had problems with using it disabled. But in opposite, when enabled, problems started.
So I don't agree with you in most parts of your explanation. I can live with it, not big problem to recompile own version, using version from SubJunk or any version before this commit where everything works like a charm (A/V in sync with Alt AV disabled and AC3 remuxed).
Only wanted to say my points of view, totally opposite with your statements:-)
Hopefully it will make people more happy than giving them more frustration why audio is not in sync...
By the way, great work from your side in last months. You did a lot of new code refactorings, great!
Thanks

@ikarsokolov
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Word Alternative leads to think it is something which can help if default settings doesn't work. If it will be enabled by default I think naming is little bit misleading:-)

I don't know historical reasons for the naming.

No means to compensate incorrectly set audio delay? What does it mean?

It means it is impossible to specify arbitrary delay for audio track while ruining mencoder in -oac copy mode.

What I remember from forum, you were quite alone with this opinion. I never had problems with using it disabled. B

This is not an opinion, this is fact I see with my test files.

Disable AC3 remux? Why?

Because it'll fix the problem.

Hopefully it will make people more happy than giving them more frustration why audio is not in sync...

I chose lesser of two evils. Using tsmuxer for ac3 remux was attempted workaround for this mencoder bug but it appears to cause more harm than good http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=14950 Also silently switching to another engine is bad software design and unpredictable behaviour for users.
Instead of causing significant troubles for many users it is better to isolate problem for really rare situations with known 100% workaround. Just disable ac3 remux and you'll get everything: mencoder, subtitles and perfect A/V sync.

@ExSport
Copy link
Contributor

@ExSport ExSport commented on 9164179 Aug 3, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the pixelization I know, but this bug started with new versions so in old ones it worked ok I suppose.
It means it is impossible to specify arbitrary delay for audio track while ruining mencoder in -oac copy mode.
I know you can't specify delay but mencoder detects it automatically and remove it except cases you will define -mc 0 -noskip.
Until now I thought most people hadn't any A/V sync problems as me. Maybe I am wrong:-)
Will test new build and will see if it will work ok or as I read in forum, from version 1.60 lot of problems arised. After I fixed code that tsMuxeR added delay also in case it was removed by MEncoder, all my MKV/AVI files were totally in sync. Playing from start, using chapters, FF/RW - still in sync (I am on Win and I never reencoded AC3). Will test new code changes and let you know.
ExSport

Please sign in to comment.