Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for external PGS/.sup subtitles #9559

Merged
merged 1 commit into from Apr 6, 2016
Merged

Conversation

taxigps
Copy link
Member

@taxigps taxigps commented Apr 5, 2016

use multi-source stream to load external PGS/.sup subtitles.
issue: times of external .sup subtitle stream not sync with video/audio stream, need set the subtitle time delay 4 second.

@taxigps
Copy link
Member Author

taxigps commented Apr 5, 2016

@ace20022 Is this the right way to support .sup? any advice?

@ace20022
Copy link
Member

ace20022 commented Apr 5, 2016

Nice!

issue: times of external .sup subtitle stream not sync with video/audio stream, need set the subtitle time delay 4 second.

Is this a new issue, or was it the same with your old approach?

I have not started to migrate the rest (.sub) because I had no time to think about how the "add subs on the fly/manually" should work.

@taxigps
Copy link
Member Author

taxigps commented Apr 5, 2016

old pr #8150 also have this issue on kodi 17. no problem on kodi 16. may be some diference with videoplayer and dvdplayer make this.

think about open .sup manual, may be open any video as multi stream, and add new stream to the multi stream when need?

@ace20022
Copy link
Member

ace20022 commented Apr 6, 2016

may be open any video as multi stream

I think so too. But it requires more work I guess, like adoption of the selection streams and auto selection stuff, because the source mask changes then.

jenkins build this please

@ace20022
Copy link
Member

ace20022 commented Apr 6, 2016

@FernetMenta fyi

old pr #8150 also have this issue on kodi 17. no problem on kodi 16. may be some diference with videoplayer and dvdplayer make this.

@ace20022 ace20022 added Type: Feature non-breaking change which adds functionality v17 Krypton Component: Video labels Apr 6, 2016
@ace20022 ace20022 added this to the Krypton 17.0-alpha1 milestone Apr 6, 2016
@ace20022 ace20022 merged commit 2e7dc77 into xbmc:master Apr 6, 2016
@taxigps taxigps mentioned this pull request Apr 6, 2016
ace20022 added a commit that referenced this pull request Apr 6, 2016
@FernetMenta
Copy link
Contributor

what is the issue?

@ace20022
Copy link
Member

ace20022 commented Apr 6, 2016

issue: times of external .sup subtitle stream not sync with video/audio stream, need set the subtitle time delay 4 second.

I briefly tested sintel, there the subs where completely wrong (some minutes). But I have no experience in sup extraction, maybe I've done it wrong.

@FernetMenta
Copy link
Contributor

ffmpeg demuxer subtracts start_time from pts: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp#L693

This is to make videos start at 0 secs. If you only have a single subtitle stream with first subtitle to be displayed at 4.0 and start_time is subtracted, you'll get pts 0 for fist sub.

I would log pts and start_time for the external subs.

@taxigps
Copy link
Member Author

taxigps commented Apr 9, 2016

test again, this issue also on kodi 16. may be some bug in ffmpeg?

@taxigps
Copy link
Member Author

taxigps commented Nov 5, 2016

@ace20022 @FernetMenta find the reason of external .sup subtitle stream not sync issue.
example:
video mkv info:

09:32:38 T:9680    INFO: ffmpeg[25D0]: Input #0, matroska,webm, E:\电影\Mad.Max.Fury.Road.2015.720p.WEB-DL.suptest.mk':
09:32:38 T:9680    INFO: ffmpeg[25D0]:   Metadata:
09:32:38 T:9680    INFO: ffmpeg[25D0]:     title           : EVO
09:32:38 T:9680    INFO: ffmpeg[25D0]:     encoder         : libebml v1.3.1 + libmatroska v1.4.2
09:32:38 T:9680    INFO: ffmpeg[25D0]:     creation_time   : 2016-01-01 02:27:27
09:32:38 T:9680    INFO: ffmpeg[25D0]:   Duration: 02:00:21.18, start: 0.000000, bitrate: 3203 kb/s

subtitle sup info:

09:37:14 T:6080    INFO: ffmpeg[17C0]: Input #0, sup, E:\电影\Mad.Max.Fury.Road.2015.720p.WEB-DL.X264.AC3-EVO.zh.su':
09:37:14 T:6080    INFO: ffmpeg[17C0]:   Duration: N/A, start: 4.212544, bitrate: N/A
09:37:14 T:6080    INFO: ffmpeg[17C0]:     Stream #0:0: Subtitle: hdmv_pgs_subtitle, 1920x1080

problem is video file start time is 0.0 and subtitle file start time is 4.2 not 0.0. try to set subtitle delay to 4.2 when play video let it sync. have tested several movie and sup file, this method works.

how to fix this in our code?

@FernetMenta
Copy link
Contributor

does this scenario use multiple demuxers?

@ace20022
Copy link
Member

ace20022 commented Nov 7, 2016

Yes, I had a really brief look today, but could not find a fix.

@taxigps
Copy link
Member Author

taxigps commented Feb 7, 2017

@ace20022 any chance to fix this?

@ace20022
Copy link
Member

@taxigps Could you please test if this is the right direction? ace20022#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Video Type: Feature non-breaking change which adds functionality v17 Krypton
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants