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

WEBVTT Region parsing error on regionanchor #1004

Closed
vish91 opened this issue Nov 9, 2021 · 1 comment · Fixed by #1006 or #1312
Closed

WEBVTT Region parsing error on regionanchor #1004

vish91 opened this issue Nov 9, 2021 · 1 comment · Fixed by #1006 or #1312
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@vish91
Copy link
Contributor

vish91 commented Nov 9, 2021

System info

Operating System: any
Shaka Packager Version: packager version v2.5.1-9f11077768-release

Issue and steps to reproduce the problem

Issue generating HLS or DASH output packages with VTT that has REGION and STYLE in them... from what I understand STYLE is ignored which is ok but the REGION validation is failing on us when it is actually as per the WEBVTT spec.

Packager Command:
packager 'in=audio.mp4,stream=audio,segment_template=/tmp/shaka/seg_$Number$.ts,lang=en,playlist_name=audio-en/stream.m3u8,hls_group_id=audio_aac,hls_name=English,drm_label=audio' 'in=video_375.mp4,stream=video,segment_template=/tmp/shaka/video_375/seg_$Number$.ts,iframe_playlist_name=video_375/stream_iframe.m3u8,playlist_name=video_375/stream.m3u8,drm_label=sd' 'in=/tmp/shaka/vtt_muxed.vtt,stream=text,segment_template=/tmp/shaka/vtt_muxed/seg_$Number$.vtt,playlist_name=vtt_muxed/stream_vtt.m3u8,hls_group_id=en_webvtt,language=en-us,hls_name=en-us' --clear_lead 0 --segment_duration 6 --hls_master_playlist_output /tmp/shaka/fp_hls/master.m3u8 --enable_raw_key_encryption --keys label=audio:key_id=...--iv ... --protection_scheme cbcs --pssh 0000.... --hls_key_uri ...

What is the expected result?
Generates the hls / dash package outputs correctly

What happens instead?
[1109/191212:ERROR:webvtt_parser.cc(355)] Invalid WebVTT REGION regionanchor: 0%,100%
[1109/191212:ERROR:packager_main.cc(551)] Packaging Error: 8 (PARSER_FAILURE): Cannot parse media file /tmp/shaka/vtt_muxed.vtt

Sample VTT:

WEBVTT

REGION
id:btc_region_initial
regionanchor:50%,100%
viewportanchor:50%,90%

STYLE
::cue {
	color:rgba(255, 255, 255, 1);
	background-color:rgba(0, 0, 0, 0.5);
	text-align:center;
}

00:00:06.033 --> 00:00:08.466 region:btc_region_initial line:85.0% position:50.0% size:8.0% align:middle
♪ ♪

00:00:08.533 --> 00:00:09.566 region:btc_region_initial line:85.0% position:40.0% size:43.0% align:middle
Congrats, Reagan.

00:00:10.066 --> 00:00:10.633 region:btc_region_initial line:85.0% position:48.0% size:23.0% align:middle
For what?

00:00:11.066 --> 00:00:13.400 region:btc_region_initial line:79.0% position:10.0% size:55.0% align:start
Jason Lipkis goes down
for three murders

00:00:13.666 --> 00:00:15.800 region:btc_region_initial line:79.0% position:10.0% size:68.0% align:start
and will never see sunlight
as a free man again.

00:00:16.366 --> 00:00:18.033 region:btc_region_initial line:79.0% position:50.0% size:63.0% align:middle
But all three of his vics
are still dead.

00:00:18.966 --> 00:00:21.033 region:btc_region_initial line:79.0% position:48.0% size:43.0% align:middle
Well, that's...
out of our hands.
@kqyang
Copy link
Contributor

kqyang commented Nov 15, 2021

Yes, that is a bug.

https://github.com/google/shaka-packager/blob/cfbe5c08c2285bd22f1ba900629e9a6fcac4dde4/packager/media/formats/webvtt/webvtt_parser.cc#L87

Line 87 should be temp > 100 instead of temp >= 100. Can you try if adjusting it fix your issue? If it does, can you send a PR to fix it? Thanks.

@kqyang kqyang added the type: bug Something isn't working correctly label Nov 15, 2021
@shaka-bot shaka-bot added this to the v2.6 milestone Nov 15, 2021
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jan 15, 2022
@shaka-project shaka-project locked and limited conversation to collaborators Jan 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
3 participants