summaryrefslogtreecommitdiffstats
path: root/libhb/deccc608sub.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates to 2017.Bradley Sepos2017-01-011-1/+1
|
* deccc608sub: fix crash caused by invalid CC streamJohn Stebbins2016-10-181-17/+22
|
* sync: correct timestamp discontinuities in sync instead of reader (#192)John Stebbins2016-05-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sync: correct timestamp discontinuities in sync instead of reader This patch passes discontinuity information through the pipeline till it reaches sync.c. The timestamps are passed through the pipeline as read and unmodified to sync.c (instead of attempting to correct discontinuities in reader). In sync, when we see a discontinuity, we know where the next timestamp should be based on the timestamp and duration of the previous buffer (before the discontinuity). So we calculate an "SCR" offset based on the timestamp after the discontinuity and what we calculate it should be. The old discontinuity handling code was broken due to the following. The MPEG STD timing model relies heavily on the decoder having an STC that is phase lock looped to the PCRs in the stream. When decoding a broadcast stream, the decoder can count on the time measure between PCRs using the STC to match to a high degree of accuracy. I.e. STC - lastSTC == PCR - lastPCR. When a discontinuity occurs, the decoder calculates a new PCR offset = PCR - STC. I.e. the offset is the new PCR value minus what it would have been if there had been no discontinuity. The above does not work without a reliable STC, which we do not have. We have been attempting to approximate one by avereraging the duration of received packets and extrapolating an "STC" based on the last PTS and the average packet duration. But this is highly variable and unreliable. * decavcodec: fix data type of next_pts It needs to be double so that partial ticks are not lost * deccc608sub: clarify comment * sync: allow queueing more audio Audio is small, and there is often a significant amount of audio in the stream before the first video frame. * sync: improve handling of damaged streams When data is missing, the audio decoder was extrapolating timestamps from the last pts before the error caused by the missing data which caused sync issues. Also, missing data can cause the video decoder to output a frame out of order with the wrong scr sequence. Drop such frames.
* sync: fix merging of multiple SSA to tx3gJohn Stebbins2016-05-171-4/+4
| | | | | | When more than 2 subtitles overlapped in time, they were not merged properly and could result in cases where the subtitle time went backwards
* deccc608sub: remove function get_last_ptsJohn Stebbins2016-05-171-20/+12
| | | | Pointless indirection to variable access
* Update copyright dates to 2016.Bradley Sepos2016-01-011-1/+1
|
* libhb: add hb_buffer_listJohn Stebbins2015-09-241-39/+8
| | | | | This brings together several independent implementations of a simple buffer list manager.
* libhb: Use a buffer flat to indicate EOFjstebbins2015-05-011-1/+1
| | | | | | | | | | | | ... instead of a 0 length buffer. This fixes this issue: https://forum.handbrake.fr/viewtopic.php?f=12&t=31959 Theora can create 0 length output. These 0 length frames indicate duplicate frames. So we can't use 0 length buffers to indicate the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7143 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: tweak font size once againjstebbins2015-04-111-2/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7085 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decccsub608: make font size independent on the amount of croppingjstebbins2015-04-101-4/+4
| | | | | | | And use alignment tag \an1 instead of \a1 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7077 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: don't ignore text attributes in PACjstebbins2015-04-071-4/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7071 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix range for tab offsetsjstebbins2015-04-071-1/+1
| | | | | | | taboffset3 command was getting ignored so alignment was incorrect git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7067 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: improve CC positioningjstebbins2015-04-051-19/+45
| | | | | | | | The safe zone margin was not wide enough and the font size was a little too small. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7063 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix column alignment issuesjstebbins2015-04-051-43/+65
| | | | | | | | Use a fixed width font, and insert hard spaces where necessary to allign columns correctly in multi-line CCs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7061 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update year to 2015.bradleys2015-02-011-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6852 b64f7644-9d1e-0410-96f1-a4d463321fa5
* json: add json APIsjstebbins2014-12-161-4/+4
| | | | | | | | | | There are several changes to job and title structs that break current windows interop code. The interop code should be changed such that it only uses json APIs. So if there is any missing features (or bugs) in these APIs, please let me know. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6602 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix positioning of popup CCsjstebbins2014-11-101-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6510 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix writing outside bufferjstebbins2014-10-301-0/+15
| | | | | | | | When the rollup mode changes, check if the baserow + rollup height goes outside the screen. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6487 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix CC roll-ups that move around the screenjstebbins2014-10-221-0/+102
| | | | | | | | These were causing errors in the parser. Handle them according to recommendations in the CC spec. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6453 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608: fix rollup style CC problemsjstebbins2014-09-261-37/+36
| | | | | | | | | | | | The timing of the "erase display" command was incorrect for rollup CC and erased subtitles immediately after they were displayed. When rendering, sometimes rollup subtitles arrived at the renderer far after the frame they should be rendered on. So push rollup subtitles into the pipeline for each new character received when rendering. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6421 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix CC text attributesjstebbins2014-09-081-16/+23
| | | | | | | The attributes (like italic) were not getting cleared when necessary. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6395 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add gpl v2 copyright message do deccc608subjstebbins2014-08-291-0/+9
| | | | | | | much of this work was borrowed from ccextractor which is GPL v2 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6383 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix positioning once againjstebbins2014-05-231-3/+4
| | | | | | | | after last change, CCs were getting positioned too far into the middle of the image. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6204 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix invalid subtitle position when extreme cropping applied.jstebbins2014-05-221-5/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6203 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix cropping of CCsjstebbins2014-05-061-5/+6
| | | | | | | | If the CC was in the crop area at the top of the image, it's position was not moved properly. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6172 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Convert all text subtitles to ASS subsjstebbins2014-04-131-1070/+492
| | | | | | | | | Add support for font color to tx3g. Allow more than one style flag at time in tx3g. Add positioning support to CC subs git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6163 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix roll-up subtitlesjstebbins2014-04-031-19/+18
| | | | | | | | Roll-up CC timestamps need similar treatment as the popup CC timestamps. Also, the simulated carriage return command that was added during a rollup command was inserting blank lines in the CC, so fix that. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6144 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decccsub: fix timestamp of "clear" subtitlesjstebbins2014-04-031-0/+6
| | | | | | | This broke CC passthru and is probably the cause of https://forum.handbrake.fr/viewtopic.php?f=11&t=29835 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6143 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: enable burn-in of all supported text subtitle formatsjstebbins2014-03-301-508/+237
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6141 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add experimental avformat muxer for mkv and mp4jstebbins2013-06-301-0/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5620 b64f7644-9d1e-0410-96f1-a4d463321fa5
* PGS (bluray) subtitle support \o/jstebbins2012-04-261-1/+1
| | | | | | | | | | | | Thanks to patches supplied by David Mitchell and Rob McMullen we finally have PGS support. I added a fix for libav pgs timestamp processing and detection of forced subtitles to their work, then made foreign audio search work with PGS subs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4605 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-6/+6
| | | | | | | | | | | | | | | | | | | | This patch enhances the filter objects. The 2 key improvements are: 1. A filter can change the image dimensions as frames pass through it. 2. A filter can output more than one frame. In addition, I have: Moved cropping & scalling into a filter object Added 90 degree rotation to the rotate filter Moved subtitle burn-in rendering to a filter object. Moved VFR/CFR handling into a framerate shaping filter object. Removed render.c since all it's responsibilities got moved to filters. Improves VOBSUB and SSA subtitle handling. Allows subtitle animations. SSA karaoke support. My apologies in advance if anything breaks ;) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4546 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix compiler warnings in several libhb filesjstebbins2010-05-301-12/+12
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3335 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some mingw warnings and a mingw build issuejstebbins2010-04-101-3/+3
| | | | | | | mingw gcc-4.5 has linker issues against shared libstdc++ git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3217 b64f7644-9d1e-0410-96f1-a4d463321fa5
* allow srt and cc subtitles to be up to 2 lines high.jstebbins2009-10-281-1/+2
| | | | | | | any additional lines after 2 are merged into 2nd line git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2897 b64f7644-9d1e-0410-96f1-a4d463321fa5
* First try at fixing a crash in quicktime if the subtitles contains an ↵ritsuka2009-08-021-1/+1
| | | | | | inverted exclamation point. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2747 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Closed Captions: Don't mess with the case.eddyg2009-06-291-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2643 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Fixed the size for tx3g samples in muxmp4.c I forgot to add the size of ↵ritsuka2009-05-081-1/+3
| | | | | | | | | | the string byte count to the total sample size. - Small fixes in deccc608sub.c, trim null characters away. - Moved the duration time from hb_mux_object_s to hb_mux_data_s so that multiple subtitle tracks can be muxed with interference. - Uses par to calculate the subtitle track width so that It will be the same as the video track. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2406 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Combine multiple CC lines into one, trimming whitespace, and adding proper ↵eddyg2009-05-071-65/+73
| | | | | | language code based on first audio track language. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2402 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Change CC608 decoder to be its own threadeddyg2009-05-071-10/+115
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2396 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Removed double EOF for CC's (one from dvd and one from cc), fixed compiler ↵eddyg2009-05-061-15/+18
| | | | | | warnings for CC. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2394 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix Closed Caption start/stop times, switched to SRT encoding including ↵eddyg2009-05-061-21/+28
| | | | | | markup for text subs internal to HB. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2392 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Push an EOF onto the subtitle fifos from the reader for DVD VOBSUBs and also ↵eddyg2009-05-061-1/+9
| | | | | | from cc608 for closed captions git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2388 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Soft Subs Part 2: Auto-detect CC during scan, add CC to subtitle list in ↵eddyg2009-05-041-0/+2403
title, if selected then CC's are extracted, MP4 Muxer will dump the subs to the log at the end of encoding. TODO: Translate PTS for buf->start to HB format, add MP4 subtitle track and subs during muxing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2375 b64f7644-9d1e-0410-96f1-a4d463321fa5