[FFmpeg-cvslog] configure: bump year
ffmpeg | branch: master | Carl Eugen Hoyos | Mon Jan 1 18:05:55 2018 +0100| [bddf31ba7570325dd2c8d033eae3d0dd74127f96] | committer: Carl Eugen Hoyos configure: bump year Happy new year! > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bddf31ba7570325dd2c8d033eae3d0dd74127f96 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 688f6ab803..606cdd0004 100755 --- a/configure +++ b/configure @@ -6959,7 +6959,7 @@ cat > $TMPH
[FFmpeg-cvslog] avformat/hlsenc: configurable variant stream index position in filenames
ffmpeg | branch: master | Vishwanath Dixit | Tue Jan 2 10:46:17 2018 +0800| [e872befdb5974bb609e337c895cefbf9bb51187c] | committer: Steven Liu avformat/hlsenc: configurable variant stream index position in filenames > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e872befdb5974bb609e337c895cefbf9bb51187c --- doc/muxers.texi | 31 +-- libavformat/hlsenc.c | 153 ++- 2 files changed, 126 insertions(+), 58 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 8ce964b0a0..553765cff8 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -577,6 +577,17 @@ Should a relative path be specified, the path of the created segment files will be relative to the current working directory. When use_localtime_mkdir is set, the whole expanded value of @var{filename} will be written into the m3u8 segment list. +When @code{var_stream_map} is set with two or more variant streams, the +@var{filename} pattern must contain the string "%v", this string specifies +the position of variant stream index in the generated segment file names. +@example +ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \ + -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \ + -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8 +@end example +This example will produce the playlists segment file sets: +@file{file_0_000.ts}, @file{file_0_001.ts}, @file{file_0_002.ts}, etc. and +@file{file_1_000.ts}, @file{file_1_001.ts}, @file{file_1_002.ts}, etc. @item use_localtime Use strftime() on @var{filename} to expand the segment filename with localtime. @@ -703,6 +714,10 @@ the fmp4 files is used in hls after version 7. @item hls_fmp4_init_filename @var{filename} set filename to the fragment files header file, default filename is @file{init.mp4}. +When @code{var_stream_map} is set with two or more variant streams, the +@var{filename} pattern must contain the string "%v", this string specifies +the position of variant stream index in the generated init file names. + @item hls_flags @var{flags} Possible values: @@ -816,32 +831,36 @@ Expected string format is like this "a:0,v:0 a:1,v:1 ". Here a:, v:, s: are the keys to specify audio, video and subtitle streams respectively. Allowed values are 0 to 9 (limited just based on practical usage). +When there are two or more variant streams, the output filename pattern must +contain the string "%v", this string specifies the position of variant stream +index in the output media playlist filenames. + @example ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \ -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \ - http://example.com/live/out.m3u8 + http://example.com/live/out_%v.m3u8 @end example This example creates two hls variant streams. The first variant stream will contain video stream of bitrate 1000k and audio stream of bitrate 64k and the second variant stream will contain video stream of bitrate 256k and audio -stream of bitrate 32k. Here, two media playlist with file names out_1.m3u8 and -out_2.m3u8 will be created. +stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and +out_1.m3u8 will be created. @example ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \ -map 0:v -map 0:a -map 0:v -f hls -var_stream_map "v:0 a:0 v:1" \ - http://example.com/live/out.m3u8 + http://example.com/live/out_%v.m3u8 @end example This example creates three hls variant streams. The first variant stream will be a video only stream with video bitrate 1000k, the second variant stream will be an audio only stream with bitrate 64k and the third variant stream will be a video only stream with bitrate 256k. Here, three media playlist with file names -out_1.m3u8, out_2.m3u8 and out_3.m3u8 will be created. +out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created. @example ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \ -map 0:a -map 0:a -map 0:v -map 0:v -f hls \ -var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high" \ -master_pl_name master.m3u8 \ - http://example.com/live/out.m3u8 + http://example.com/live/out_%v.m3u8 @end example This example creates two audio only and two video only variant streams. In addition to the #EXT-X-STREAM-INF tag for each variant stream in the master diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 3ea16c6d7d..e1dd606a61 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1528,7 +1528,7 @@ static const char * get_default_pattern_localtime_fmt(AVFormatContext *s) return (HAVE_LIBC_MSVCRT || !strftime(b, sizeof(b), "%s", p) || !strcmp(b, "%s")) ? "-%Y%m%d%H%M%S.ts" : "-%s.ts"; } -static int format_name(char *name, int name_buf_len, int i) +static int append_postfix(char *name, int name_buf_len, int i) { char *p; char extension[10] = {'\0
[FFmpeg-cvslog] lavc/Makefile: fix opus_parser dependencies
ffmpeg | branch: master | Rostislav Pehlivanov | Mon Jan 1 19:55:25 2018 +| [fdbd26196702120561a6a9b32928443b04fcbd11] | committer: Rostislav Pehlivanov lavc/Makefile: fix opus_parser dependencies Fix suggested by RiCON. Signed-off-by: Rostislav Pehlivanov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fdbd26196702120561a6a9b32928443b04fcbd11 --- libavcodec/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index ca72138c02..cfacd6b70c 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1005,7 +1005,8 @@ OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_MPEGAUDIO_PARSER)+= mpegaudio_parser.o OBJS-$(CONFIG_MPEGVIDEO_PARSER)+= mpegvideo_parser.o\ mpeg12.o mpeg12data.o -OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus.o opustab.o vorbis_data.o +OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus.o opustab.o \ + opus_rc.o vorbis_data.o OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_crystalizer: use outlink instead of inlink
ffmpeg | branch: master | Paul B Mahol | Mon Jan 1 21:53:10 2018 +0100| [9f7dbaad7e36e11237ab76ed5e1932af7dfd2df2] | committer: Paul B Mahol avfilter/af_crystalizer: use outlink instead of inlink Doesn't change anything but is more correct. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f7dbaad7e36e11237ab76ed5e1932af7dfd2df2 --- libavfilter/af_crystalizer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_crystalizer.c b/libavfilter/af_crystalizer.c index dec30aa5f4..5b27e1fb79 100644 --- a/libavfilter/af_crystalizer.c +++ b/libavfilter/af_crystalizer.c @@ -173,7 +173,7 @@ static void filter_dblp(void **d, void **p, const void **s, static int config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; -CrystalizerContext *s= ctx->priv; +CrystalizerContext *s = ctx->priv; switch (inlink->format) { case AV_SAMPLE_FMT_FLT: s->filter = filter_flt; break; @@ -203,7 +203,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (av_frame_is_writable(in)) { out = in; } else { -out = ff_get_audio_buffer(inlink, in->nb_samples); +out = ff_get_audio_buffer(outlink, in->nb_samples); if (!out) { av_frame_free(&in); return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavu/mem: Do not realloc in av_fast_realloc() if size == min_size.
ffmpeg | branch: master | Carl Eugen Hoyos | Sat Dec 30 14:38:33 2017 +0100| [21b5990da461e4f83cf53994715ed42e22cce9e0] | committer: Carl Eugen Hoyos lavu/mem: Do not realloc in av_fast_realloc() if size == min_size. This can avoid OOM for min_size close to FFmpeg's arbitrary alloc limits. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21b5990da461e4f83cf53994715ed42e22cce9e0 --- libavutil/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/mem.c b/libavutil/mem.c index 79e8b597f1..0729e1dd50 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -463,7 +463,7 @@ void av_memcpy_backptr(uint8_t *dst, int back, int cnt) void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size) { -if (min_size < *size) +if (min_size <= *size) return ptr; min_size = FFMAX(min_size + min_size / 16 + 32, min_size); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc: creation of variant streams in subdirectories
ffmpeg | branch: master | Vishwanath Dixit | Tue Jan 2 10:46:48 2018 +0800| [41e51fbcd9ed3fd3d9e8f98a017b152506a965d2] | committer: Steven Liu avformat/hlsenc: creation of variant streams in subdirectories Reviewed-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41e51fbcd9ed3fd3d9e8f98a017b152506a965d2 --- doc/muxers.texi | 33 - libavformat/hlsenc.c | 68 +--- 2 files changed, 92 insertions(+), 9 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 553765cff8..b060c4f360 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -589,6 +589,20 @@ This example will produce the playlists segment file sets: @file{file_0_000.ts}, @file{file_0_001.ts}, @file{file_0_002.ts}, etc. and @file{file_1_000.ts}, @file{file_1_001.ts}, @file{file_1_002.ts}, etc. +The string "%v" may be present in the filename or in the last directory name +containing the file. If the string is present in the directory name, then +sub-directories are created after expanding the directory name pattern. This +enables creation of segments corresponding to different variant streams in +subdirectories. +@example +ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \ + -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \ + -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8 +@end example +This example will produce the playlists segment file sets: +@file{vs0/file_000.ts}, @file{vs0/file_001.ts}, @file{vs0/file_002.ts}, etc. and +@file{vs1/file_000.ts}, @file{vs1/file_001.ts}, @file{vs1/file_002.ts}, etc. + @item use_localtime Use strftime() on @var{filename} to expand the segment filename with localtime. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index @@ -717,6 +731,11 @@ set filename to the fragment files header file, default filename is @file{init.m When @code{var_stream_map} is set with two or more variant streams, the @var{filename} pattern must contain the string "%v", this string specifies the position of variant stream index in the generated init file names. +The string "%v" may be present in the filename or in the last directory name +containing the file. If the string is present in the directory name, then +sub-directories are created after expanding the directory name pattern. This +enables creation of init files corresponding to different variant streams in +subdirectories. @item hls_flags @var{flags} Possible values: @@ -833,7 +852,11 @@ Allowed values are 0 to 9 (limited just based on practical usage). When there are two or more variant streams, the output filename pattern must contain the string "%v", this string specifies the position of variant stream -index in the output media playlist filenames. +index in the output media playlist filenames. The string "%v" may be present in +the filename or in the last directory name containing the file. If the string is +present in the directory name, then sub-directories are created after expanding +the directory name pattern. This enables creation of variant streams in +subdirectories. @example ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \ @@ -856,6 +879,14 @@ be an audio only stream with bitrate 64k and the third variant stream will be a video only stream with bitrate 256k. Here, three media playlist with file names out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created. @example +ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \ + -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \ + http://example.com/live/vs_%v/out.m3u8 +@end example +This example creates the variant streams in subdirectories. Here, the first +media playlist is created at @file{http://example.com/live/vs_0/out.m3u8} and +the second one at @file{http://example.com/live/vs_1/out.m3u8}. +@example ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \ -map 0:a -map 0:a -map 0:v -map 0:v -f hls \ -var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high" \ diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e1dd606a61..e36120c320 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1549,7 +1549,8 @@ static int append_postfix(char *name, int name_buf_len, int i) static int validate_name(int nb_vs, const char *fn) { -const char *filename; +const char *filename, *subdir_name; +char *fn_dup = NULL; int ret = 0; if (!fn) { @@ -1557,22 +1558,38 @@ static int validate_name(int nb_vs, const char *fn) goto fail; } +fn_dup = av_strdup(fn); +if (!fn_dup) { +ret = AVERROR(ENOMEM); +goto fail; +} + filename = av_basename(fn); +subdir_name = av_dirname(fn_dup); -if (nb_vs > 1 && !av_stristr(filename, "%v")) { +if (nb_vs > 1 && !av_strist
[FFmpeg-cvslog] avformat/hlsenc: revamped master playlist url creation logic
ffmpeg | branch: master | Vishwanath Dixit | Tue Jan 2 10:45:28 2018 +0800| [26e1efb04f3864b813c74eaf85fbe1ea352bb7f0] | committer: Steven Liu avformat/hlsenc: revamped master playlist url creation logic > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=26e1efb04f3864b813c74eaf85fbe1ea352bb7f0 --- libavformat/hlsenc.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e6f3241765..3ea16c6d7d 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1689,28 +1689,30 @@ static int update_variant_stream_info(AVFormatContext *s) { static int update_master_pl_info(AVFormatContext *s) { HLSContext *hls = s->priv_data; -int m3u8_name_size, ret; -char *p; +const char *dir; +char *fn; +int ret = 0; -m3u8_name_size = strlen(s->filename) + strlen(hls->master_pl_name) + 1; -hls->master_m3u8_url = av_malloc(m3u8_name_size); -if (!hls->master_m3u8_url) { +fn = av_strdup(s->filename); +if (!fn) { ret = AVERROR(ENOMEM); -return ret; +goto fail; } -av_strlcpy(hls->master_m3u8_url, s->filename, m3u8_name_size); -p = strrchr(hls->master_m3u8_url, '/') ? -strrchr(hls->master_m3u8_url, '/') : -strrchr(hls->master_m3u8_url, '\\'); -if (p) { -*(p + 1) = '\0'; -av_strlcat(hls->master_m3u8_url, hls->master_pl_name, m3u8_name_size); -} else { -av_strlcpy(hls->master_m3u8_url, hls->master_pl_name, m3u8_name_size); +dir = av_dirname(fn); +if (dir && strcmp(dir, ".")) +hls->master_m3u8_url = av_append_path_component(dir, hls->master_pl_name); +else +hls->master_m3u8_url = av_strdup(hls->master_pl_name); + +if (!hls->master_m3u8_url) { +ret = AVERROR(ENOMEM); +goto fail; } -return 0; +fail: +av_freep(&fn); +return ret; } static int hls_write_header(AVFormatContext *s) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/mov: Use av_fast_realloc() in mov_read_stts().
ffmpeg | branch: master | Carl Eugen Hoyos | Sun Dec 31 22:30:57 2017 +0100| [1112ba012df38d486694154b03f5007341f43b24] | committer: Carl Eugen Hoyos lavf/mov: Use av_fast_realloc() in mov_read_stts(). Avoids large allocations for short files with invalid stts entry. Fixes bugzilla 1102. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1112ba012df38d486694154b03f5007341f43b24 --- libavformat/mov.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 20644734dc..22faecfc17 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2830,7 +2830,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; -unsigned int i, entries; +unsigned int i, entries, alloc_size = 0; int64_t duration=0; int64_t total_sample_count=0; @@ -2848,15 +2848,24 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (sc->stts_data) av_log(c->fc, AV_LOG_WARNING, "Duplicated STTS atom\n"); -av_free(sc->stts_data); +av_freep(&sc->stts_data); sc->stts_count = 0; -sc->stts_data = av_malloc_array(entries, sizeof(*sc->stts_data)); -if (!sc->stts_data) +if (entries >= INT_MAX / sizeof(*sc->stts_data)) return AVERROR(ENOMEM); for (i = 0; i < entries && !pb->eof_reached; i++) { int sample_duration; unsigned int sample_count; +unsigned min_entries = FFMIN(FFMAX(i, 1024 * 1024), entries); +MOVStts *stts_data = av_fast_realloc(sc->stts_data, &alloc_size, + min_entries * sizeof(*sc->stts_data)); +if (!stts_data) { +av_freep(&sc->stts_data); +sc->stts_count = 0; +return AVERROR(ENOMEM); +} +sc->stts_count = min_entries; +sc->stts_data = stts_data; sample_count=avio_rb32(pb); sample_duration = avio_rb32(pb); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog