{"action":"created","issue":{"url":"https://api.github.com/repos/kaltura/nginx-vod-module/issues/922","repository_url":"https://api.github.com/repos/kaltura/nginx-vod-module","labels_url":"https://api.github.com/repos/kaltura/nginx-vod-module/issues/922/labels{/name}","comments_url":"https://api.github.com/repos/kaltura/nginx-vod-module/issues/922/comments","events_url":"https://api.github.com/repos/kaltura/nginx-vod-module/issues/922/events","html_url":"https://github.com/kaltura/nginx-vod-module/pull/922","id":379960058,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwMjc0NDgy","number":922,"title":"Support ASS/SSA captions/subtitle file inputs, tested on HLS outputs","user":{"login":"rmikhael","id":32312005,"node_id":"MDQ6VXNlcjMyMzEyMDA1","avatar_url":"https://avatars0.githubusercontent.com/u/32312005?v=4","gravatar_id":"","url":"https://api.github.com/users/rmikhael","html_url":"https://github.com/rmikhael","followers_url":"https://api.github.com/users/rmikhael/followers","following_url":"https://api.github.com/users/rmikhael/following{/other_user}","gists_url":"https://api.github.com/users/rmikhael/gists{/gist_id}","starred_url":"https://api.github.com/users/rmikhael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmikhael/subscriptions","organizations_url":"https://api.github.com/users/rmikhael/orgs","repos_url":"https://api.github.com/users/rmikhael/repos","events_url":"https://api.github.com/users/rmikhael/events{/privacy}","received_events_url":"https://api.github.com/users/rmikhael/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-12T21:30:35Z","updated_at":"2018-11-13T18:48:08Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/kaltura/nginx-vod-module/pulls/922","html_url":"https://github.com/kaltura/nginx-vod-module/pull/922","diff_url":"https://github.com/kaltura/nginx-vod-module/pull/922.diff","patch_url":"https://github.com/kaltura/nginx-vod-module/pull/922.patch"},"body":"First try here.\r\n\r\nMain changes are addition of 3 file under directory vod/subtitles/\r\n- ass_parse.c is code mostly copied from libass, and modified/reduced/adjusted for the limited set of possible inputs supported for this project. PLEASE revise the MIT license used in this file.\r\n- ass_format.c and ass_format.h are newly added files, that implement the WebVTT segment/playlist building for the output. These files can follow the same license as the rest of the project. Naming of structures here follow the ASS naming conventions (track, style, event).\r\n- addition of these 3 files to build/make files as needed. Addition of the new input format support into media enums. Update of Readme.md.\r\n- Rest of the files are mostly merging of recent nginx-vod-module changes. \r\n\r\nThese changes were tested with 8 different languages per mp4, using HLS multi-track URLs in local and remote modes. Arabic is the only rtl language tested, and detection/handling might not be optimal for the long-term.\r\nNot tested in Dash, but should work similarly. \r\nTested for more than a month in production at crunchyroll. No memory leaks or crashes observed.\r\n\r\nStyles are not yet correctly supported on all 4 browsers, VLC, shaka players. There are open bug/feature reports on all of them that I am following. Styles can be fully supported in the output, by enabling #define ASSUME_STYLE_SUPPORT.\r\n\r\nPlease review and provide me with feedback / questions. We would like to contribute this to the community, to get some commonality of features supported by the browsers.\r\n\r\nI can provide sample input/output files if needed."},"comment":{"url":"https://api.github.com/repos/kaltura/nginx-vod-module/issues/comments/438390721","html_url":"https://github.com/kaltura/nginx-vod-module/pull/922#issuecomment-438390721","issue_url":"https://api.github.com/repos/kaltura/nginx-vod-module/issues/922","id":438390721,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODM5MDcyMQ==","user":{"login":"rmikhael","id":32312005,"node_id":"MDQ6VXNlcjMyMzEyMDA1","avatar_url":"https://avatars0.githubusercontent.com/u/32312005?v=4","gravatar_id":"","url":"https://api.github.com/users/rmikhael","html_url":"https://github.com/rmikhael","followers_url":"https://api.github.com/users/rmikhael/followers","following_url":"https://api.github.com/users/rmikhael/following{/other_user}","gists_url":"https://api.github.com/users/rmikhael/gists{/gist_id}","starred_url":"https://api.github.com/users/rmikhael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmikhael/subscriptions","organizations_url":"https://api.github.com/users/rmikhael/orgs","repos_url":"https://api.github.com/users/rmikhael/repos","events_url":"https://api.github.com/users/rmikhael/events{/privacy}","received_events_url":"https://api.github.com/users/rmikhael/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T18:48:08Z","updated_at":"2018-11-13T18:48:08Z","author_association":"NONE","body":"Thanks a lot for the prompt response Eran. Here are my responses:\r\n\r\n1. Will do a clean pull, merge, and new PR.\r\n\r\n3. Will try to replace all the camelCase names to underscores. Are there any other coding conventions I am missing? I tried to use the vod_xxx() functions as much as possible, instead of regular string and memory C functions. I also used the logging functions used in other vod/subtitle files. Please let me know main things to change, so I don't redo a lot of rewriting.\r\n\r\n2. Many reasons I didn't want to link to libass, here is what I remember:\r\na) libass has a ton of features that we don't care about for our purposes, like Fonts, karaoke, clipping, blurs, fades, moving, rotations, scrolling up and down, bitmaps, transition effects, shadows, all inline-tags (and these are really really numerous)... etc. They all come with their initialization steps like directories, callback functions... We didn't need all that. \r\nb) given that libass output is rendering, not manipulated text, the steps and timing and what needs to be stored in the intermediate ass_track, ass_style, ass_event are a lot different. It was much easier to keep what I need and discard what I don't, than to try and convert every call to the renderer into some post-processing step on the text stored. I am not even sure it is doable.\r\nc) I wanted to control all memory allocations and freeing, for testability and for allocating from the pool in case of post-error clean-up.\r\nd) logging and debugging code needs to be done the nginx way. Much easier to debug a local file conforming, than to try and debug an external library.\r\ne) use of destructive parsing (the code inserts a '\\0' at the end of every line, before it parses its text. vod module calls the parse_memory function twice; once to get the duration and figure out the start/end of the segment, and once for actual parsing of the events. \r\n\r\nThis code doesn't handle all legal ASS features, only a small subset that is common in our files. But given that Animation is one of the major users of high-quality fancy subtitles, I am guessing this limited set is a good start for most applications. Missing features can be requested and implemented one-by-one. \r\nNot to say that in the future we couldn't link to libass and support all features supported, it is just not needed for my company, so will be very hard to get resources allocated. We are sharing the limited set that we invested in handling/preserving, and hoping the community can add to that over time.\r\n\r\nThis same discussion will be repeated in the future, as we are adding SCC->WebVTT support as well. Of course there are public open-source libraries that read SCC from a bitstream (with all the parsing needed) but we only need to parse SCC from a text file, which makes most of the code unusable for that purspose."}}
{"actor":{"display_login":"rmikhael"}}