Subtitles modules
Hi, subreader.c is huge file with lots of various, and I was planning to extract specific subtitles format functions into sub modules, just like libmpdemux, libmpcodecs, etc. So first step, I'd like to just put specific format functions into specific files: sub/st_jacosub.c sub/st_microdvd.c sub/st_sami.c sub/st_subrip.c ... This will be the first tricky thing since some formats have specific hacky global variable such as previous_sub_end. If I'm not wrong the second step would be to define some instance and info struct just like with at least init, read, postproc, dump and close function. The automatic type detection could be ported in the init function of each type. Does anyone has a grudge against this, or see a big obstacle? Regards, -- Clément B. Not sent from a jesusPhone.
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Hi,
subreader.c is huge file with lots of various, and I was planning to extract specific subtitles format functions into sub modules, just like libmpdemux, libmpcodecs, etc.
So first step, I'd like to just put specific format functions into specific files: <...> If I'm not wrong the second step would be to define some instance and info struct just like with at least init, read, postproc, dump and close function.
The automatic type detection could be ported in the init function of each type.
Does anyone has a grudge against this, or see a big obstacle?
I am all for it in principle, but there may be even better: libavformat has recently gained the capacity to decode some text subtitles format (at least ASS and SRT): rather than working on mplayer, you may want to try to port the subtitles decoders that mplayer has and lavf does not have to lavf, and then entirely rely on lavf in mplayer. On of the pros of this solution is that lavf already has all the probe/init/read infrastructure designed. Regards, -- Nicolas George
On Tue, Nov 30, 2010 at 10:17:51PM +0100, Nicolas George wrote:
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Hi,
subreader.c is huge file with lots of various, and I was planning to extract specific subtitles format functions into sub modules, just like libmpdemux, libmpcodecs, etc.
So first step, I'd like to just put specific format functions into specific files: <...> If I'm not wrong the second step would be to define some instance and info struct just like with at least init, read, postproc, dump and close function.
The automatic type detection could be ported in the init function of each type.
Does anyone has a grudge against this, or see a big obstacle?
I am all for it in principle, but there may be even better: libavformat has recently gained the capacity to decode some text subtitles format (at least ASS and SRT): rather than working on mplayer, you may want to try to port the subtitles decoders that mplayer has and lavf does not have to lavf, and then entirely rely on lavf in mplayer. On of the pros of this solution is that lavf already has all the probe/init/read infrastructure designed.
Indeed I saw the integration of ASS and SubRip in FFmpeg, but I only saw ASS and SubRip as muxed subtitles, so are you sure FFmpeg developers would accept support for external subtitles format such as JacoSub or SAMI? What if one or more format never reach to FFmpeg repository? Do you think dropping some formats in MPlayer would be acceptable? Btw, I really like the idea, but I wonder if it's a real solution. -- Clément B. Not sent from a jesusPhone.
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Indeed I saw the integration of ASS and SubRip in FFmpeg, but I only saw ASS and SubRip as muxed subtitles, so are you sure FFmpeg developers would accept support for external subtitles format such as JacoSub or SAMI?
I just tested with a version a few weeks old: ffmpeg -i foo.ass -scodec copy bar.ass copies the ASS stream from one file to another. This is mostly an identical copy, apart from possibly a few blank lines. The same works for srt. So at the very least, lavf can be used to parse the text data of ASS and SRT, and there is no fundamental objection in ffmpeg for stand-alone text subtitles formats. Regards, -- Nicolas George
On Tue, Nov 30, 2010 at 11:04:14PM +0100, Nicolas George wrote:
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Indeed I saw the integration of ASS and SubRip in FFmpeg, but I only saw ASS and SubRip as muxed subtitles, so are you sure FFmpeg developers would accept support for external subtitles format such as JacoSub or SAMI?
I just tested with a version a few weeks old: ffmpeg -i foo.ass -scodec copy bar.ass copies the ASS stream from one file to another. This is mostly an identical copy, apart from possibly a few blank lines. The same works for srt.
So at the very least, lavf can be used to parse the text data of ASS and SRT, and there is no fundamental objection in ffmpeg for stand-alone text subtitles formats.
Mmmh. OK then. I'll try to make and submit one or two in the next days. Thanks for this feedback. -- Clément B. Not sent from a jesusPhone.
On Tue, Nov 30, 2010 at 10:41:32PM +0100, Clément Bœsch wrote:
On Tue, Nov 30, 2010 at 10:17:51PM +0100, Nicolas George wrote:
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Hi,
subreader.c is huge file with lots of various, and I was planning to extract specific subtitles format functions into sub modules, just like libmpdemux, libmpcodecs, etc.
So first step, I'd like to just put specific format functions into specific files: <...> If I'm not wrong the second step would be to define some instance and info struct just like with at least init, read, postproc, dump and close function.
The automatic type detection could be ported in the init function of each type.
Does anyone has a grudge against this, or see a big obstacle?
I am all for it in principle, but there may be even better: libavformat has recently gained the capacity to decode some text subtitles format (at least ASS and SRT): rather than working on mplayer, you may want to try to port the subtitles decoders that mplayer has and lavf does not have to lavf, and then entirely rely on lavf in mplayer. On of the pros of this solution is that lavf already has all the probe/init/read infrastructure designed.
Indeed I saw the integration of ASS and SubRip in FFmpeg, but I only saw ASS and SubRip as muxed subtitles, so are you sure FFmpeg developers would accept support for external subtitles format such as JacoSub or SAMI?
Definitely yes ! All subtitles format are welcome in FFmpeg. The architecture for muxing/demuxing and for encoding/decoding is already in place. It will certainly take you some more time to implement proper (de)muxer and decoder in FFmpeg but I think it's definitely worth it. I'm planning to add support for various subtitles format, but I have only very limited free time those days so it will probably take quite some time. I have already support for srt, microdvd and movtext close to be ready, just needing some polishing. So if you want to start implementing some subtitles decoders, it would be more useful if you start by some other formats. Anyway, it would be very nice to see someone else working on FFmpeg text subtitle support. Aurel
On Sat, Dec 04, 2010 at 01:07:43AM +0100, Aurelien Jacobs wrote:
On Tue, Nov 30, 2010 at 10:41:32PM +0100, Clément Bœsch wrote:
On Tue, Nov 30, 2010 at 10:17:51PM +0100, Nicolas George wrote:
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Hi,
subreader.c is huge file with lots of various, and I was planning to extract specific subtitles format functions into sub modules, just like libmpdemux, libmpcodecs, etc.
So first step, I'd like to just put specific format functions into specific files: <...> If I'm not wrong the second step would be to define some instance and info struct just like with at least init, read, postproc, dump and close function.
The automatic type detection could be ported in the init function of each type.
Does anyone has a grudge against this, or see a big obstacle?
I am all for it in principle, but there may be even better: libavformat has recently gained the capacity to decode some text subtitles format (at least ASS and SRT): rather than working on mplayer, you may want to try to port the subtitles decoders that mplayer has and lavf does not have to lavf, and then entirely rely on lavf in mplayer. On of the pros of this solution is that lavf already has all the probe/init/read infrastructure designed.
Indeed I saw the integration of ASS and SubRip in FFmpeg, but I only saw ASS and SubRip as muxed subtitles, so are you sure FFmpeg developers would accept support for external subtitles format such as JacoSub or SAMI?
Definitely yes ! All subtitles format are welcome in FFmpeg.
Oh? Al'right then, I'll try to submit some patches when they get ready.
The architecture for muxing/demuxing and for encoding/decoding is already in place. It will certainly take you some more time to implement proper (de)muxer and decoder in FFmpeg but I think it's definitely worth it. I'm planning to add support for various subtitles format, but I have only very limited free time those days so it will probably take quite some time. I have already support for srt, microdvd and movtext close to be ready,
There is already a support for markup in MPlayer, I suppose you're aware of it; maybe you can reuse it. What's the movtext you're talking about?
just needing some polishing. So if you want to start implementing some subtitles decoders, it would be more useful if you start by some other formats.
OK. Well then maybe I'll start with easy ones (MPlayer sub for example, or VPlayer and such), and then I'll for for more complex and crazy ones such as JacoSub or SAMI.
Anyway, it would be very nice to see someone else working on FFmpeg text subtitle support.
Would be a great pleasure. See you soon then if I found enough time in the next days :) -- Clément B. Not sent from a jesusPhone.
On Sat, Dec 04, 2010 at 01:36:16AM +0100, Clément Bœsch wrote:
On Sat, Dec 04, 2010 at 01:07:43AM +0100, Aurelien Jacobs wrote:
On Tue, Nov 30, 2010 at 10:41:32PM +0100, Clément Bœsch wrote:
On Tue, Nov 30, 2010 at 10:17:51PM +0100, Nicolas George wrote:
Le decadi 10 frimaire, an CCXIX, Clément Bœsch a écrit :
Hi,
subreader.c is huge file with lots of various, and I was planning to extract specific subtitles format functions into sub modules, just like libmpdemux, libmpcodecs, etc.
So first step, I'd like to just put specific format functions into specific files: <...> If I'm not wrong the second step would be to define some instance and info struct just like with at least init, read, postproc, dump and close function.
The automatic type detection could be ported in the init function of each type.
Does anyone has a grudge against this, or see a big obstacle?
I am all for it in principle, but there may be even better: libavformat has recently gained the capacity to decode some text subtitles format (at least ASS and SRT): rather than working on mplayer, you may want to try to port the subtitles decoders that mplayer has and lavf does not have to lavf, and then entirely rely on lavf in mplayer. On of the pros of this solution is that lavf already has all the probe/init/read infrastructure designed.
Indeed I saw the integration of ASS and SubRip in FFmpeg, but I only saw ASS and SubRip as muxed subtitles, so are you sure FFmpeg developers would accept support for external subtitles format such as JacoSub or SAMI?
Definitely yes ! All subtitles format are welcome in FFmpeg.
Oh? Al'right then, I'll try to submit some patches when they get ready.
Great !
The architecture for muxing/demuxing and for encoding/decoding is already in place. It will certainly take you some more time to implement proper (de)muxer and decoder in FFmpeg but I think it's definitely worth it. I'm planning to add support for various subtitles format, but I have only very limited free time those days so it will probably take quite some time. I have already support for srt, microdvd and movtext close to be ready,
There is already a support for markup in MPlayer, I suppose you're aware of it; maybe you can reuse it.
Yes I'm aware of it. I made an independent implementation, but I then had a look at MPlayer's code to check if I didn't forgot to support any kind of formatting, etc...
What's the movtext you're talking about?
The native codec embeded in .mov files, which lavf is exporting as CODEC_ID_MOV_TEXT.
just needing some polishing. So if you want to start implementing some subtitles decoders, it would be more useful if you start by some other formats.
OK. Well then maybe I'll start with easy ones (MPlayer sub for example, or VPlayer and such), and then I'll for for more complex and crazy ones such as JacoSub or SAMI.
Wise choice.
Anyway, it would be very nice to see someone else working on FFmpeg text subtitle support.
Would be a great pleasure. See you soon then if I found enough time in the next days :)
:-) Aurel
On Tue, 30 Nov 2010 21:53:43 +0100, Clément Bœsch wrote:
Hi,
subreader.c is huge file with lots of various, and I was planning to
as long as you dont duplicate a bunch of code :) -compn
On Tue, Nov 30, 2010 at 04:27:58PM -0500, compn wrote:
On Tue, 30 Nov 2010 21:53:43 +0100, Clément Bœsch wrote:
Hi,
subreader.c is huge file with lots of various, and I was planning to
I just realized I totally messed my sentence... (*a* huge file, various *code*)
as long as you dont duplicate a bunch of code :)
Just moving it, no duplication of course. -- Clément B. Not sent from a jesusPhone.
participants (4)
-
Aurelien Jacobs -
Clément Bœsch -
compn -
Nicolas George