Re: [FFmpeg-devel] [PATCH 1/7] lavf: add cue sheet demuxer

2019-08-23 Thread Reino Wijnsma
Hello ffmpeg-devel,

I've read through https://patchwork.ffmpeg.org/patch/4587/, 
https://ffmpeg.org/pipermail/ffmpeg-devel/2017-August/214360.html and all its 
replies. The discussion suddenly just stops, the path dropped and I can't seem 
to find the reason why. Can anyone tell me why this patch hasn't been applied? 
I was just wondering.

-- Reino
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/7] lavf: add cue sheet demuxer

2017-11-21 Thread Rostislav Pehlivanov
On 2 August 2017 at 07:30, Rodger Combs  wrote:

> ---
>  Changelog|   2 +
>  doc/demuxers.texi|  17 
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/cuedec.c | 246 ++
> +
>  libavformat/version.h|   2 +-
>  6 files changed, 268 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/cuedec.c
>
> diff --git a/Changelog b/Changelog
> index 187ae79..6701d30 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -29,6 +29,8 @@ version :
>  - limiter video filter
>  - libvmaf video filter
>  - Dolby E decoder and SMPTE 337M demuxer
> +- Cue sheet demuxer
> +
>
>  version 3.3:
>  - CrystalHD decoder moved to new decode API
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index 29a23d4..04eaf27 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -244,6 +244,23 @@ file subdir/file-2.wav
>  @end example
>  @end itemize
>
> +@section cue
> +
> +Cue sheet demuxer.
> +
> +This demuxer reads a cue sheet (text file) and exports its track listing
> in
> +the form of AVChapters. Packet data is read from the file listed in the
> sheet,
> +which must be in the same directory. To override the path the packet data
> is
> +read from, use the @code{url} option.
> +
> +This demuxer currently only supports cue sheets with a single audio file.
> +
> +This demuxer can be used along with the segment muxer to split a
> cue+audio pair
> +into individual files for the different tracks:
> +@example
> +ffmpeg -i input.cue -f segment -segment_chapters 1 '%02d $artist$ -
> $title$.flac'
> +@end example
> +
>  @section flv, live_flv
>
>  Adobe Flash Video Format demuxer.
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index b0ef82c..4381c42 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -130,6 +130,7 @@ OBJS-$(CONFIG_CDXL_DEMUXER)  += cdxl.o
>  OBJS-$(CONFIG_CINE_DEMUXER)  += cinedec.o
>  OBJS-$(CONFIG_CONCAT_DEMUXER)+= concatdec.o
>  OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
> +OBJS-$(CONFIG_CUE_DEMUXER)   += cuedec.o
>  OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
>  OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 1ebc142..25afa8b 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -96,6 +96,7 @@ static void register_all(void)
>  REGISTER_DEMUXER (CINE, cine);
>  REGISTER_DEMUXER (CONCAT,   concat);
>  REGISTER_MUXER   (CRC,  crc);
> +REGISTER_DEMUXER (CUE,  cue);
>  REGISTER_MUXER   (DASH, dash);
>  REGISTER_MUXDEMUX(DATA, data);
>  REGISTER_MUXDEMUX(DAUD, daud);
> diff --git a/libavformat/cuedec.c b/libavformat/cuedec.c
> new file mode 100644
> index 000..11b256d
> --- /dev/null
> +++ b/libavformat/cuedec.c
> @@ -0,0 +1,246 @@
> +/*
> + * Cue sheet demuxer
> + * Copyright (c) 2016 The FFmpeg Project
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> + */
> +
> +/**
> + * @file
> + * Cue sheet demuxer
> + * @author Rodger Combs 
> + */
> +
> +#include "avformat.h"
> +#include "internal.h"
> +#include "subtitles.h"
> +#include "url.h"
> +#include "libavutil/intreadwrite.h"
> +#include "libavutil/avstring.h"
> +#include "libavutil/opt.h"
> +
> +typedef struct CueDemuxContext {
> +AVClass *class;
> +char *url;
> +AVFormatContext *avf;
> +} CueDemuxContext;
> +
> +static int cue_probe(AVProbeData *p)
> +{
> +const unsigned char *ptr = p->buf;
> +int has_file = 0, has_track = 0;
> +
> +if (AV_RB24(ptr) == 0xEFBBBF)
> +ptr += 3;  /* skip UTF-8 BOM */
> +while (*ptr && (!has_file || !has_track)) {
> +while (*ptr == ' ' || *ptr == '\t')
> +ptr++;
> +if (!strncmp(ptr, "FILE ", 5)) {
> +ptr += 5;
> +while (*ptr == ' ' || *ptr == '\t')
> +ptr++;
> +if (*ptr == '"')
> +has_file = 1;
> +} else if (!strncmp(ptr, 

Re: [FFmpeg-devel] [PATCH 1/7] lavf: add cue sheet demuxer

2017-09-09 Thread Paul B Mahol
On 8/2/17, Rodger Combs  wrote:
> ---
>  Changelog|   2 +
>  doc/demuxers.texi|  17 
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/cuedec.c | 246
> +++
>  libavformat/version.h|   2 +-
>  6 files changed, 268 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/cuedec.c
>

What is status of this?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/7] lavf: add cue sheet demuxer

2017-08-02 Thread Rodger Combs

> On Aug 1, 2017, at 02:58, Nicolas George  wrote:
> 
> Le quartidi 14 thermidor, an CCXXV, Rodger Combs a écrit :
>> ---
>> Changelog|   2 +
>> doc/demuxers.texi|   8 ++
>> libavformat/Makefile |   1 +
>> libavformat/allformats.c |   1 +
>> libavformat/cuedec.c | 215 
>> +++
>> libavformat/version.h|   2 +-
>> 6 files changed, 228 insertions(+), 1 deletion(-)
>> create mode 100644 libavformat/cuedec.c
>> 
>> diff --git a/Changelog b/Changelog
>> index 187ae79..6701d30 100644
>> --- a/Changelog
>> +++ b/Changelog
>> @@ -29,6 +29,8 @@ version :
>> - limiter video filter
>> - libvmaf video filter
>> - Dolby E decoder and SMPTE 337M demuxer
>> +- Cue sheet demuxer
>> +
>> 
>> version 3.3:
>> - CrystalHD decoder moved to new decode API
>> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
>> index 29a23d4..7ea4f27 100644
>> --- a/doc/demuxers.texi
>> +++ b/doc/demuxers.texi
>> @@ -244,6 +244,14 @@ file subdir/file-2.wav
>> @end example
>> @end itemize
>> 
>> +@section cue
>> +
>> +Cue sheet demuxer.
>> +
>> +This demuxer reads a cue sheet (text file) and exports its track listing in
>> +the form of AVChapters. Packet data is read from the file listed in the 
>> sheet.
>> +To override the path the packet data is read from, use the @code{url} 
>> option.
>> +
>> @section flv, live_flv
>> 
>> Adobe Flash Video Format demuxer.
>> diff --git a/libavformat/Makefile b/libavformat/Makefile
>> index b0ef82c..4381c42 100644
>> --- a/libavformat/Makefile
>> +++ b/libavformat/Makefile
>> @@ -130,6 +130,7 @@ OBJS-$(CONFIG_CDXL_DEMUXER)  += cdxl.o
>> OBJS-$(CONFIG_CINE_DEMUXER)  += cinedec.o
>> OBJS-$(CONFIG_CONCAT_DEMUXER)+= concatdec.o
>> OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
>> +OBJS-$(CONFIG_CUE_DEMUXER)   += cuedec.o
>> OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
>> OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
>> OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
>> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
>> index 1ebc142..25afa8b 100644
>> --- a/libavformat/allformats.c
>> +++ b/libavformat/allformats.c
>> @@ -96,6 +96,7 @@ static void register_all(void)
>> REGISTER_DEMUXER (CINE, cine);
>> REGISTER_DEMUXER (CONCAT,   concat);
>> REGISTER_MUXER   (CRC,  crc);
>> +REGISTER_DEMUXER (CUE,  cue);
>> REGISTER_MUXER   (DASH, dash);
>> REGISTER_MUXDEMUX(DATA, data);
>> REGISTER_MUXDEMUX(DAUD, daud);
>> diff --git a/libavformat/cuedec.c b/libavformat/cuedec.c
>> new file mode 100644
>> index 000..d0dcac4
>> --- /dev/null
>> +++ b/libavformat/cuedec.c
>> @@ -0,0 +1,215 @@
>> +/*
>> + * Cue sheet demuxer
>> + * Copyright (c) 2016 The FFmpeg Project
>> + *
>> + * This file is part of FFmpeg.
>> + *
>> + * FFmpeg is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * FFmpeg is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with FFmpeg; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
>> USA
>> + */
>> +
>> +/**
>> + * @file
>> + * Cue sheet demuxer
>> + * @author Rodger Combs 
>> + */
>> +
>> +#include "avformat.h"
>> +#include "internal.h"
>> +#include "subtitles.h"
>> +#include "url.h"
>> +#include "libavutil/intreadwrite.h"
>> +#include "libavutil/avstring.h"
>> +#include "libavutil/opt.h"
>> +
>> +typedef struct CueDemuxContext {
>> +AVClass *class;
>> +char *url;
>> +AVFormatContext *avf;
>> +} CueDemuxContext;
>> +
>> +static int cue_probe(AVProbeData *p)
>> +{
>> +const unsigned char *ptr = p->buf;
>> +
>> +if (AV_RB24(ptr) == 0xEFBBBF)
>> +ptr += 3;  /* skip UTF-8 BOM */
> 
>> +while (*ptr && strncmp(ptr, "FILE ", 5))
>> +ptr += ff_subtitles_next_line(ptr);
>> +if (!strncmp(ptr, "FILE ", 5))
>> +return AVPROBE_SCORE_MAX - 5;
> 
> The duplicated test feels inelegant to me. Better:
> 
>while (*ptr) {
>   if (strncmp(...))
>   return ...;
>   ptr += ...;
>}

Moving in the direction of this format in my new version.

> 
> Also, this code matches any text file with a line starting with the word
> FILE near the beginning. In other words, it would recognize this very
> mail as a cue sheet! I think it needs to be stricter: at least FILE
> followed 

Re: [FFmpeg-devel] [PATCH 1/7] lavf: add cue sheet demuxer

2017-08-01 Thread Nicolas George
Le quartidi 14 thermidor, an CCXXV, Rodger Combs a écrit :
> ---
>  Changelog|   2 +
>  doc/demuxers.texi|   8 ++
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/cuedec.c | 215 
> +++
>  libavformat/version.h|   2 +-
>  6 files changed, 228 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/cuedec.c
> 
> diff --git a/Changelog b/Changelog
> index 187ae79..6701d30 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -29,6 +29,8 @@ version :
>  - limiter video filter
>  - libvmaf video filter
>  - Dolby E decoder and SMPTE 337M demuxer
> +- Cue sheet demuxer
> +
>  
>  version 3.3:
>  - CrystalHD decoder moved to new decode API
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index 29a23d4..7ea4f27 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -244,6 +244,14 @@ file subdir/file-2.wav
>  @end example
>  @end itemize
>  
> +@section cue
> +
> +Cue sheet demuxer.
> +
> +This demuxer reads a cue sheet (text file) and exports its track listing in
> +the form of AVChapters. Packet data is read from the file listed in the 
> sheet.
> +To override the path the packet data is read from, use the @code{url} option.
> +
>  @section flv, live_flv
>  
>  Adobe Flash Video Format demuxer.
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index b0ef82c..4381c42 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -130,6 +130,7 @@ OBJS-$(CONFIG_CDXL_DEMUXER)  += cdxl.o
>  OBJS-$(CONFIG_CINE_DEMUXER)  += cinedec.o
>  OBJS-$(CONFIG_CONCAT_DEMUXER)+= concatdec.o
>  OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
> +OBJS-$(CONFIG_CUE_DEMUXER)   += cuedec.o
>  OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
>  OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 1ebc142..25afa8b 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -96,6 +96,7 @@ static void register_all(void)
>  REGISTER_DEMUXER (CINE, cine);
>  REGISTER_DEMUXER (CONCAT,   concat);
>  REGISTER_MUXER   (CRC,  crc);
> +REGISTER_DEMUXER (CUE,  cue);
>  REGISTER_MUXER   (DASH, dash);
>  REGISTER_MUXDEMUX(DATA, data);
>  REGISTER_MUXDEMUX(DAUD, daud);
> diff --git a/libavformat/cuedec.c b/libavformat/cuedec.c
> new file mode 100644
> index 000..d0dcac4
> --- /dev/null
> +++ b/libavformat/cuedec.c
> @@ -0,0 +1,215 @@
> +/*
> + * Cue sheet demuxer
> + * Copyright (c) 2016 The FFmpeg Project
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +/**
> + * @file
> + * Cue sheet demuxer
> + * @author Rodger Combs 
> + */
> +
> +#include "avformat.h"
> +#include "internal.h"
> +#include "subtitles.h"
> +#include "url.h"
> +#include "libavutil/intreadwrite.h"
> +#include "libavutil/avstring.h"
> +#include "libavutil/opt.h"
> +
> +typedef struct CueDemuxContext {
> +AVClass *class;
> +char *url;
> +AVFormatContext *avf;
> +} CueDemuxContext;
> +
> +static int cue_probe(AVProbeData *p)
> +{
> +const unsigned char *ptr = p->buf;
> +
> +if (AV_RB24(ptr) == 0xEFBBBF)
> +ptr += 3;  /* skip UTF-8 BOM */

> +while (*ptr && strncmp(ptr, "FILE ", 5))
> +ptr += ff_subtitles_next_line(ptr);
> +if (!strncmp(ptr, "FILE ", 5))
> +return AVPROBE_SCORE_MAX - 5;

The duplicated test feels inelegant to me. Better:

while (*ptr) {
if (strncmp(...))
return ...;
ptr += ...;
}

Also, this code matches any text file with a line starting with the word
FILE near the beginning. In other words, it would recognize this very
mail as a cue sheet! I think it needs to be stricter: at least FILE
followed by spaces and a double quote and "TRACK ?? AUDIO" later.

(It would be nice to have a built-in regex compiler that would combine
all similar probe functions into a single finite-state machine.)

> +return 0;
> +}
> +
> +static char *get_token(char 

Re: [FFmpeg-devel] [PATCH 1/7] lavf: add cue sheet demuxer

2017-08-01 Thread Hendrik Leppkes
On Tue, Aug 1, 2017 at 8:33 AM, Rodger Combs  wrote:
> ---
>  Changelog|   2 +
>  doc/demuxers.texi|   8 ++
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/cuedec.c | 215 
> +++
>  libavformat/version.h|   2 +-
>  6 files changed, 228 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/cuedec.c
>

Cue Sheets not only support a single data file, but can also contain
metadata for multiple files with one track per file already split (or
even a wild mix of multiple files with multiple tracks per file).
If you don't want to support this, you should probably document this
and perhaps also check in the Cue Sheet parsing if multiple FILE
directives are found, and error out.

- Hendrik
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel