Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Carl Eugen Hoyos
compn mi.rr.com> writes: > will try to dig some more. sup samples are attached to ticket #2208, the original file is in http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket2208/ Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ff

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 03:06:08PM +, Carl Eugen Hoyos wrote: > > Other formats are also relatively lazy > > Please point me to such a format, I would like to > fix it. > EXTENSION is ok for 32 bit, MAX is ok for 64bit. Sorry, I missed that EXTENSION is actually MAX/2 nowadays! That's quite

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
On Sun, 31 Aug 2014 15:06:08 + (UTC) Carl Eugen Hoyos wrote: > wm4 googlemail.com> writes: > > > > > +return AVPROBE_SCORE_EXTENSION; > > > > > > I understand if you consider it not worth the effort, > > > but ideally this would scan ahead several packets, > > > and if it all matches u

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Carl Eugen Hoyos
wm4 googlemail.com> writes: > > > +return AVPROBE_SCORE_EXTENSION; > > > > I understand if you consider it not worth the effort, > > but ideally this would scan ahead several packets, > > and if it all matches up return a higher score. > > The MP3 probe function is possibly a good reference

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 04:15:51PM +0200, wm4 wrote: > Well yes, it would be possible to loop over the entire probe buffer, > until it ends on a packet boundary, or there's a partial cut-off > packet. How exactly would you suggest the probe score? > > Personally, I'd probably do the following: if

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
On Sun, 31 Aug 2014 15:16:49 +0200 Reimar Döffinger wrote: > On Sun, Aug 31, 2014 at 02:57:54PM +0200, wm4 wrote: > > On Sun, 31 Aug 2014 14:25:21 +0200 > > Reimar Döffinger wrote: > > > > > On Sun, Aug 31, 2014 at 01:04:29PM +0200, wm4 wrote: > > > > +static int sup_probe(AVProbeData *p) > > >

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 02:57:54PM +0200, wm4 wrote: > On Sun, 31 Aug 2014 14:25:21 +0200 > Reimar Döffinger wrote: > > > On Sun, Aug 31, 2014 at 01:04:29PM +0200, wm4 wrote: > > > +static int sup_probe(AVProbeData *p) > > > +{ > > > +if (p->buf_size < 2 || memcmp(p->buf, "PG", 2)) > > > +

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
On Sun, 31 Aug 2014 14:25:21 +0200 Reimar Döffinger wrote: > On Sun, Aug 31, 2014 at 01:04:29PM +0200, wm4 wrote: > > +static int sup_probe(AVProbeData *p) > > +{ > > +if (p->buf_size < 2 || memcmp(p->buf, "PG", 2)) > > +return 0; > > +return AVPROBE_SCORE_EXTENSION; > > I unders

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 01:04:29PM +0200, wm4 wrote: > +static int sup_probe(AVProbeData *p) > +{ > +if (p->buf_size < 2 || memcmp(p->buf, "PG", 2)) > +return 0; > +return AVPROBE_SCORE_EXTENSION; I understand if you consider it not worth the effort, but ideally this would scan ahe

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread compn
On Sun, 31 Aug 2014 00:33:58 +0200 wm4 wrote: > On Sat, 30 Aug 2014 18:16:27 -0400 > Marcus Johnson wrote: > > > Here's a PGS subtitle sample from Eac3to: > > https://dl.dropboxusercontent.com/u/52358991/English.zip you saw the few samples we have in the repo, right? http://samples.ffmpeg.org/

[FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
--- Following the advice to use av_get_packet() etc. Tese functions still return partial packets, but mark them as corrupted - so returning them should be fine. --- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/supdec.c | 85

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 12:00:13PM +0200, wm4 wrote: > On Sun, 31 Aug 2014 11:50:36 +0200 > Reimar Döffinger wrote: > > > On Sun, Aug 31, 2014 at 11:39:16AM +0200, wm4 wrote: > > > I got the semantics of avio_read wrong: short reads on EOF are in > > > fact allowed and don't return an error. Hope

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
On Sun, 31 Aug 2014 11:50:36 +0200 Reimar Döffinger wrote: > On Sun, Aug 31, 2014 at 11:39:16AM +0200, wm4 wrote: > > I got the semantics of avio_read wrong: short reads on EOF are in > > fact allowed and don't return an error. Hopefully this is correct now... > > What I _really_ dislike about t

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 11:39:16AM +0200, wm4 wrote: > I got the semantics of avio_read wrong: short reads on EOF are in > fact allowed and don't return an error. Hopefully this is correct now... What I _really_ dislike about these approaches is that we hard-code EOF behaviour in every single demu

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Michael Niedermayer
On Sun, Aug 31, 2014 at 09:41:49AM +0200, Reimar Döffinger wrote: > On 30.08.2014, at 15:38, wm4 wrote: > > +// The packet-size is stored as part of the packet. > > +if ((ret = avio_read(s->pb, tmp, 3)) < 0) > > +return ret; > > + > > +len = AV_RB16(tmp + 1); > > + > > +if

[FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
--- I got the semantics of avio_read wrong: short reads on EOF are in fact allowed and don't return an error. Hopefully this is correct now... --- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/supdec.c | 92 3 fil

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread wm4
On Sun, 31 Aug 2014 10:24:13 +0200 Reimar Döffinger wrote: > On Sun, Aug 31, 2014 at 10:15:56AM +0200, Hendrik Leppkes wrote: > > On Sun, Aug 31, 2014 at 9:41 AM, Reimar Döffinger > > wrote: > > > On 30.08.2014, at 15:38, wm4 wrote: > > >> +// The packet-size is stored as part of the packet

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On Sun, Aug 31, 2014 at 10:15:56AM +0200, Hendrik Leppkes wrote: > On Sun, Aug 31, 2014 at 9:41 AM, Reimar Döffinger > wrote: > > On 30.08.2014, at 15:38, wm4 wrote: > >> +// The packet-size is stored as part of the packet. > >> +if ((ret = avio_read(s->pb, tmp, 3)) < 0) > >> +ret

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Hendrik Leppkes
On Sun, Aug 31, 2014 at 9:41 AM, Reimar Döffinger wrote: > On 30.08.2014, at 15:38, wm4 wrote: >> +// The packet-size is stored as part of the packet. >> +if ((ret = avio_read(s->pb, tmp, 3)) < 0) >> +return ret; >> + >> +len = AV_RB16(tmp + 1); >> + >> +if ((ret = av_new_

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-31 Thread Reimar Döffinger
On 30.08.2014, at 15:38, wm4 wrote: > +// The packet-size is stored as part of the packet. > +if ((ret = avio_read(s->pb, tmp, 3)) < 0) > +return ret; > + > +len = AV_RB16(tmp + 1); > + > +if ((ret = av_new_packet(pkt, len + 3)) < 0) > +return ret; > + > +memcpy

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-30 Thread Timothy Gu
On Sat, Aug 30, 2014 at 9:41 PM, Marcus Johnson wrote: > If you don't mind me asking, what is DTS? because when I hear it I think of > the DTS audio codec, but I know it's obviously not that, and googling DTS > in the codec context won't get me anywhere. DTS = decoding time stamp PTS = presentati

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-30 Thread Marcus Johnson
If you don't mind me asking, what is DTS? because when I hear it I think of the DTS audio codec, but I know it's obviously not that, and googling DTS in the codec context won't get me anywhere. On Sat, Aug 30, 2014 at 6:33 PM, wm4 wrote: > On Sat, 30 Aug 2014 18:16:27 -0400 > Marcus Johnson wr

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-30 Thread wm4
On Sat, 30 Aug 2014 18:16:27 -0400 Marcus Johnson wrote: > Here's a PGS subtitle sample from Eac3to: > https://dl.dropboxusercontent.com/u/52358991/English.zip > Thanks! The DTS fields in this one are all 0 too. ___ ffmpeg-devel mailing list ffmpeg-d

Re: [FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-30 Thread Marcus Johnson
Here's a PGS subtitle sample from Eac3to: https://dl.dropboxusercontent.com/u/52358991/English.zip On Sat, Aug 30, 2014 at 9:38 AM, wm4 wrote: > --- > Reverse engineered by looking at Petri Hintukainen's muxer patch, and > also the mkvmerge sources. Tested with files extracted by mkvextract > o

[FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

2014-08-30 Thread wm4
--- Reverse engineered by looking at Petri Hintukainen's muxer patch, and also the mkvmerge sources. Tested with files extracted by mkvextract only (does someone have better samples?). No idea if a parser would be required for correct remuxing, but at least for decoding with lavc it probably isn't