Re: [FFmpeg-devel] [PATCH 2/7] avformat/hlsenc: make the code easier to read
On 2014-07-29 16:15, Michael Niedermayer wrote: > On Fri, Jul 18, 2014 at 10:57:42AM +0200, Nicolas Martyanoff wrote: > > Before adding new features, I read the code and cleaned it. The main issue > > was > > abstruse identifier names. > > > > The behaviour of the muxer is *not* modified, by this patch, this is only > > cosmetic. If this is not the case, it is a mistake. > > --- > > libavformat/hlsenc.c | 360 > > ++- > > 1 file changed, 213 insertions(+), 147 deletions(-) > > This should be ok if you add yourself to MAINTAINERs for hlsenc, > that is you volunteer to maintain hlsenc. > > Otherwise i think its better if we avoid large cosmetic changes so > merges from any forks stay easy and non conflicting Hi Michael, I would be happy to help if bugs are found or if new features have to be added, but I am not sure I have the time to commit to officially maintaining the module. Would that be satisfying ? Regards, -- Nicolas Martyanoff http://wandrian.net khae...@gmail.com ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/7] avformat/hlsenc: do not regenerate the playlist for each segment
On 2014-07-29 15:59, Michael Niedermayer wrote: > On Fri, Jul 18, 2014 at 10:57:44AM +0200, Nicolas Martyanoff wrote: > > Since we need all segments to find out the target duration, we can only > > generate the playlist after writing all segments. > > > > There is no need to rewrite the segment list every time we create a new > > segment file. > > doesnt this break playing back hls while its still written ? I believe you are right, I did not thing about the case where a client is reading the playlist while it is being written. However I am not sure about the way avio_* functions work. Depending on the way buffering is done, how does one guarantee that at a time T, the playlist is a valid HLS playlist ? The hlsenc muxer uses avio_open2(), a bunch of avio_printf() then avio_closep(). I have no idea whether a part of the file is readable by other processed before the call to avio_closep(). -- Nicolas Martyanoff http://wandrian.net khae...@gmail.com ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] ffprobe: print some basic information about avframe side data
On Wed, Jul 30, 2014 at 02:18:48AM +0200, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > ffprobe.c | 22 +- > 1 file changed, 21 insertions(+), 1 deletion(-) > I believe this is missing doc/ffprobe.xsd updates. > diff --git a/ffprobe.c b/ffprobe.c > index 1329466..114da50 100644 > --- a/ffprobe.c > +++ b/ffprobe.c > @@ -123,6 +123,8 @@ typedef enum { > SECTION_ID_FRAME, > SECTION_ID_FRAMES, > SECTION_ID_FRAME_TAGS, > +SECTION_ID_FRAME_SIDEDATA_LIST, > +SECTION_ID_FRAME_SIDEDATA, > SECTION_ID_LIBRARY_VERSION, > SECTION_ID_LIBRARY_VERSIONS, > SECTION_ID_PACKET, > @@ -152,8 +154,10 @@ static struct section sections[] = { > [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { > SECTION_ID_FORMAT_TAGS, -1 } }, > [SECTION_ID_FORMAT_TAGS] ={ SECTION_ID_FORMAT_TAGS, "tags", > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name > = "format_tags" }, > [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", > SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } }, > -[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { > SECTION_ID_FRAME_TAGS, -1 } }, > +[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { > SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } }, > [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name > = "frame_tags" }, > +[SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, > "sidedata_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } }, > +[SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, > "sidedata", 0, { -1 } }, > [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, > "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } > }, > [SECTION_ID_LIBRARY_VERSION] ={ SECTION_ID_LIBRARY_VERSION, > "library_version", 0, { -1 } }, > [SECTION_ID_PACKETS] ={ SECTION_ID_PACKETS, "packets", > SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} }, > @@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame > *frame, AVStream *stream, > { > AVBPrint pbuf; > const char *s; > +int i; > > av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); > > @@ -1765,6 +1770,21 @@ static void show_frame(WriterContext *w, AVFrame > *frame, AVStream *stream, > print_int("interlaced_frame", frame->interlaced_frame); > print_int("top_field_first",frame->top_field_first); > print_int("repeat_pict",frame->repeat_pict); > +if (frame->nb_side_data) { > +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST); > +for (i = 0; i < frame->nb_side_data; i++) { > +AVFrameSideData *sd = frame->side_data[i]; > +const char *name; > + > +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA); > +name = av_frame_side_data_name(sd->type); > +print_str("side_data_type", name ? name : "unknown"); > +print_int("side_data_size", sd->size); > +writer_print_section_footer(w); > +} > +writer_print_section_footer(w); > +} > + > break; > > case AVMEDIA_TYPE_AUDIO: Should be fine if tested with different writers [...] -- Clément B. pgpKMj7YhiXOD.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
Le duodi 12 thermidor, an CCXXII, wm4 a écrit : >The libavfilter API > for EOF is ok, No, it is not. > So if you're not actually fixing anything I am. > What wrong result? See my first answer when you started this bikeshedding. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg_filter: refuse to configure input without a decoder.
Michael Niedermayer gmx.at> writes: > LGTM Ping. Please add a comment about ticket #3779 to the commit message. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg_filter: refuse to configure input without a decoder.
Le duodi 12 thermidor, an CCXXII, Carl Eugen Hoyos a écrit : > Ping. > > Please add a comment about ticket #3779 to the commit message. Done and pushed to my tree for anyone to merge. (It did not seem urgent, I was waiting to bundle it with other patches to save time to the merger. Or are there hours where I can push directly without interfering with Michael's merges from the fork?) Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffprobe: print some basic information about avframe side data
Signed-off-by: Michael Niedermayer --- doc/ffprobe.xsd | 11 +++ ffprobe.c | 21 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd index 9ef9ecb..e0e9179 100644 --- a/doc/ffprobe.xsd +++ b/doc/ffprobe.xsd @@ -55,6 +55,7 @@ + @@ -91,6 +92,16 @@ + + + + + + + + + + diff --git a/ffprobe.c b/ffprobe.c index 1329466..c9fc79d 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -123,6 +123,8 @@ typedef enum { SECTION_ID_FRAME, SECTION_ID_FRAMES, SECTION_ID_FRAME_TAGS, +SECTION_ID_FRAME_SIDEDATA_LIST, +SECTION_ID_FRAME_SIDEDATA, SECTION_ID_LIBRARY_VERSION, SECTION_ID_LIBRARY_VERSIONS, SECTION_ID_PACKET, @@ -152,8 +154,10 @@ static struct section sections[] = { [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { SECTION_ID_FORMAT_TAGS, -1 } }, [SECTION_ID_FORMAT_TAGS] ={ SECTION_ID_FORMAT_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "format_tags" }, [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } }, -[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, -1 } }, +[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } }, [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "frame_tags" }, +[SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, "sidedata_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } }, +[SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, "sidedata", 0, { -1 } }, [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } }, [SECTION_ID_LIBRARY_VERSION] ={ SECTION_ID_LIBRARY_VERSION, "library_version", 0, { -1 } }, [SECTION_ID_PACKETS] ={ SECTION_ID_PACKETS, "packets", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} }, @@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, { AVBPrint pbuf; const char *s; +int i; av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); @@ -1784,6 +1789,20 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, } if (do_show_frame_tags) show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS); +if (frame->nb_side_data) { +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST); +for (i = 0; i < frame->nb_side_data; i++) { +AVFrameSideData *sd = frame->side_data[i]; +const char *name; + +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA); +name = av_frame_side_data_name(sd->type); +print_str("side_data_type", name ? name : "unknown"); +print_int("side_data_size", sd->size); +writer_print_section_footer(w); +} +writer_print_section_footer(w); +} writer_print_section_footer(w); -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/7] avformat/hlsenc: do not regenerate the playlist for each segment
On Wed, Jul 30, 2014 at 10:30:29AM +0200, Nicolas Martyanoff wrote: > On 2014-07-29 15:59, Michael Niedermayer wrote: > > On Fri, Jul 18, 2014 at 10:57:44AM +0200, Nicolas Martyanoff wrote: > > > Since we need all segments to find out the target duration, we can only > > > generate the playlist after writing all segments. > > > > > > There is no need to rewrite the segment list every time we create a new > > > segment file. > > > > doesnt this break playing back hls while its still written ? > > I believe you are right, I did not thing about the case where a client is > reading the playlist while it is being written. > > However I am not sure about the way avio_* functions work. Depending on the > way buffering is done, how does one guarantee that at a time T, the playlist > is a valid HLS playlist ? > > The hlsenc muxer uses avio_open2(), a bunch of avio_printf() then > avio_closep(). I have no idea whether a part of the file is readable by other > processed before the call to avio_closep(). theres a internal buffer, once its filled data will be flushed out to the OS, which i guess may or may not write data atomically in case of remote FS theres also avio_flush() and AVFMT_FLAG_FLUSH_PACKETS to force earlier flushing so i guess there could be some corner cases where the file is truncated somehow but still it seems better than no file to me [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
Hi, Here's a patch adding ASM transform_add functions for HEVC. Regards, Pierre-Edouard Leperecommit 1db36e2f5bae3a34d1a5db4520234b52afb51bbb Author: plepere Date: Wed Jul 30 10:31:49 2014 +0200 adding ASM transform_add functions for HEVC diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 7469293..658ad5e 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -117,7 +117,8 @@ YASM-OBJS-$(CONFIG_AAC_DECODER)+= x86/sbrdsp.o YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/dcadsp.o YASM-OBJS-$(CONFIG_HEVC_DECODER) += x86/hevc_mc.o \ x86/hevc_deblock.o\ - x86/hevc_idct.o + x86/hevc_idct.o \ + x86/hevc_res_add.o YASM-OBJS-$(CONFIG_PNG_DECODER)+= x86/pngdsp.o YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o diff --git a/libavcodec/x86/hevc_res_add.asm b/libavcodec/x86/hevc_res_add.asm new file mode 100644 index 000..bc550ef --- /dev/null +++ b/libavcodec/x86/hevc_res_add.asm @@ -0,0 +1,454 @@ +; /* +; * Provide intrinsics for transform_add functions for HEVC decoding +; * Copyright (c) 2014 Pierre-Edouard LEPERE +; * +; * 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 +; */ +%include "libavutil/x86/x86util.asm" + +SECTION_RODATA +max_pixels_10: times 16 dw ((1 << 10)-1) +tr_add_10: times 4 dd ((1 << 14-10) + 1) + + +SECTION .text + +;the tr_add macros and functions were largely inspired by x264 project's code in the h264_idct.asm file +%macro TR_ADD_INIT_MMX 2 +mova m2, [r1] +mova m4, [r1+8] +pxor m3, m3 +psubw m3, m2 +packuswb m2, m2 +packuswb m3, m3 +pxor m5, m5 +psubw m5, m4 +packuswb m4, m4 +packuswb m5, m5 +%endmacro + +%macro TR_ADD_OP_MMX 4 +%1m0, [%2 ] +%1m1, [%2+%3 ] +paddusb m0, m2 +paddusb m1, m4 +psubusb m0, m3 +psubusb m1, m5 +%1 [%2 ], m0 +%1 [%2+%3 ], m1 +%endmacro + +%macro TR_ADD_INIT_SSE_8 2 +movu m4, [r1] +movu m6, [r1+16] +movu m8, [r1+32] +movu m10, [r1+48] +lea %1, [%2*3] +pxor m5, m5 +psubw m5, m4 +packuswb m4, m4 +packuswb m5, m5 +pxor m7, m7 +psubw m7, m6 +packuswb m6, m6 +packuswb m7, m7 +pxor m9, m9 +psubw m9, m8 +packuswb m8, m8 +packuswb m9, m9 +pxor m11, m11 +psubwm11, m10 +packuswb m10, m10 +packuswb m11, m11 +%endmacro + +%macro TR_ADD_INIT_SSE_16 2 +lea %1, [%2*3] +movu m4, [r1] +movu m6, [r1+16] +pxor m5, m5 +psubw m7, m5, m6 +psubw m5, m4 +packuswb m4, m6 +packuswb m5, m7 + +movu m6, [r1+32] +movu m8, [r1+48] +pxor m7, m7 +psubw m9, m7, m8 +psubw m7, m6 +packuswb m6, m8 +packuswb m7, m9 + +movu m8, [r1+64] +movu m10, [r1+80] +pxor m9, m9 +psubwm11, m9, m10 +psubw m9, m8 +packuswb m8, m10 +packuswb m9, m11 + +movu m10, [r1+96] +movu m12, [r1+112] +pxor m11, m11 +psubwm13, m11, m12 +psubwm11, m10 +packuswb m10, m12 +packuswb m11, m13 +%endmacro + +%macro TR_ADD_OP_SSE 4 +%1m0, [%2 ] +%1m1, [%2+%3 ] +%1m2, [%2+%3*2] +%1m3, [%2+%4 ] +paddusb m0, m4 +paddusb m
Re: [FFmpeg-devel] [PATCH 1/4] lavfi: add filter messages infrastructure.
Le sextidi 6 thermidor, an CCXXII, Nicolas George a écrit : > Le sextidi 6 thermidor, an CCXXII, Michael Niedermayer a écrit : > > the 4 patch set seems to break fate > > TESTswr-resample-s16p-48000-2626 > > stddev:3.88 PSNR: 84.54 MAXDIFF: 15 bytes:96000/20416 > > Test swr-resample-s16p-8000-44100 failed. Look at > > tests/data/fate/swr-resample-s16p-8000-44100.err for details. > > make: *** [fate-swr-resample-s16p-8000-44100] Error 1 > > make: *** Waiting for unfinished jobs > > stddev:2.27 PSNR: 89.19 MAXDIFF:7 bytes:96000/20416 > > Test swr-resample-s16p-8000-48000 failed. Look at > > tests/data/fate/swr-resample-s16p-8000-48000.err for details. > > make: *** [fate-swr-resample-s16p-8000-48000] Error 1 > > stddev:1.19 PSNR: 94.80 MAXDIFF:4 bytes: 529200/20418 > > Test swr-resample-s16p-44100-48000 failed. Look at > > tests/data/fate/swr-resample-s16p-44100-48000.err for details. > > make: *** [fate-swr-resample-s16p-44100-48000] Error 1 > > stddev: 1395.14 PSNR: 33.44 MAXDIFF: 8594 bytes:31512/20416 > > Test swr-resample-s16p-2626-44100 failed. Look at > > tests/data/fate/swr-resample-s16p-2626-44100.err for details. > > make: *** [fate-swr-resample-s16p-2626-44100] Error 1 > > stddev: 10.18 PSNR: 76.17 MAXDIFF: 27 bytes: 576000/19304 > > Test swr-resample-s16p-48000-2626 failed. Look at > > tests/data/fate/swr-resample-s16p-48000-2626.err for details. > > make: *** [fate-swr-resample-s16p-48000-2626] Error 1 > > stddev: 1395.21 PSNR: 33.44 MAXDIFF: 8606 bytes:31512/20416 > > Test swr-resample-s16p-2626-96000 failed. Look at > > tests/data/fate/swr-resample-s16p-2626-96000.err for details. > > make: *** [fate-swr-resample-s16p-2626-96000] Error 1 These tests do not fail for me. Can you dig up the *.err files and/or give some more details about the configuration? I use this on Debian/x86_64: --enable-shared --disable-static --enable-gpl --enable-libx264 --enable-libopus --enable-libass --enable-libfreetype --enable-avresample --assert-level=2 > Thanks for testing. I usually build without libavresample, so I did not see > this set of errors. I will look into it. My bad, there was nothing about lavr in this. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg_filter: refuse to configure input without a decoder.
On Wed, Jul 30, 2014 at 03:12:19PM +0200, Nicolas George wrote: > Le duodi 12 thermidor, an CCXXII, Carl Eugen Hoyos a écrit : > > Ping. > > > > Please add a comment about ticket #3779 to the commit message. > > Done and pushed to my tree for anyone to merge. merged > > (It did not seem urgent, I was waiting to bundle it with other patches to > save time to the merger. i dont think that makes sense, merging it earlier and more often doesnt take much time and makes the code available earlier to others to test, use and benefit > Or are there hours where I can push directly > without interfering with Michael's merges from the fork?) i dont think its such a big problem currently IMHO the 2nd fate run on a seperate computer and quick look of a second pair of eyes over what changed is a stronger argument for pull requests over direct commits than interfering with merges. Though of course this can (and would) change, if the number of commits and merges increase. Merges done by a single person scale up very well, 10k a day, doable if they dont conflict Direct commits from multiple developers, 1k a day, no everyone would just be rebasing code and be forced to push code thats untested after rebasing [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB He who knows, does not speak. He who speaks, does not know. -- Lao Tsu signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
Hi! On Wed, Jul 30, 2014 at 9:33 AM, Pierre Edouard Lepere < pierre-edouard.lep...@insa-rennes.fr> wrote: > Here's a patch adding ASM transform_add functions for HEVC. Yay! I'll try to review soon. Do you have rough performance metrics? I know it's faster :-p but it's nice to document by how much. Thanks! Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] lavfi: add filter messages infrastructure.
On Wed, Jul 30, 2014 at 03:52:34PM +0200, Nicolas George wrote: > Le sextidi 6 thermidor, an CCXXII, Nicolas George a écrit : > > Le sextidi 6 thermidor, an CCXXII, Michael Niedermayer a écrit : > > > the 4 patch set seems to break fate > > > TESTswr-resample-s16p-48000-2626 > > > stddev:3.88 PSNR: 84.54 MAXDIFF: 15 bytes:96000/20416 > > > Test swr-resample-s16p-8000-44100 failed. Look at > > > tests/data/fate/swr-resample-s16p-8000-44100.err for details. > > > make: *** [fate-swr-resample-s16p-8000-44100] Error 1 > > > make: *** Waiting for unfinished jobs > > > stddev:2.27 PSNR: 89.19 MAXDIFF:7 bytes:96000/20416 > > > Test swr-resample-s16p-8000-48000 failed. Look at > > > tests/data/fate/swr-resample-s16p-8000-48000.err for details. > > > make: *** [fate-swr-resample-s16p-8000-48000] Error 1 > > > stddev:1.19 PSNR: 94.80 MAXDIFF:4 bytes: 529200/20418 > > > Test swr-resample-s16p-44100-48000 failed. Look at > > > tests/data/fate/swr-resample-s16p-44100-48000.err for details. > > > make: *** [fate-swr-resample-s16p-44100-48000] Error 1 > > > stddev: 1395.14 PSNR: 33.44 MAXDIFF: 8594 bytes:31512/20416 > > > Test swr-resample-s16p-2626-44100 failed. Look at > > > tests/data/fate/swr-resample-s16p-2626-44100.err for details. > > > make: *** [fate-swr-resample-s16p-2626-44100] Error 1 > > > stddev: 10.18 PSNR: 76.17 MAXDIFF: 27 bytes: 576000/19304 > > > Test swr-resample-s16p-48000-2626 failed. Look at > > > tests/data/fate/swr-resample-s16p-48000-2626.err for details. > > > make: *** [fate-swr-resample-s16p-48000-2626] Error 1 > > > stddev: 1395.21 PSNR: 33.44 MAXDIFF: 8606 bytes:31512/20416 > > > Test swr-resample-s16p-2626-96000 failed. Look at > > > tests/data/fate/swr-resample-s16p-2626-96000.err for details. > > > make: *** [fate-swr-resample-s16p-2626-96000] Error 1 > > These tests do not fail for me. Can you dig up the *.err files and/or give > some more details about the configuration? I use this on Debian/x86_64: > > --enable-shared --disable-static --enable-gpl --enable-libx264 > --enable-libopus --enable-libass --enable-libfreetype --enable-avresample > --assert-level=2 hmm first try: make distclean ; ./configure --enable-gpl --samples=... --cc='ccache gcc' && make -j12 fate -k TESTfilter-pixfmts-il --- ./tests/ref/fate/filter-pixfmts-fieldmatch 2014-07-28 20:15:41.549377334 +0200 +++ tests/data/fate/filter-pixfmts-fieldmatch 2014-07-30 16:38:36.516743355 +0200 @@ -1,5 +1,5 @@ yuv410p 08518d1ceaf740696b26eb89325987c1 yuv411p ca4b3b96c4f487fc293ad8d631f37660 -yuv420p 2069df6ae54ce80f82d591ac753e66cc +yuv420p e04d8e9607cc5f58feba0735536f1bfe yuv422p 7b4fe261becce67a0a0b6886d9f6 yuv444p 5a0ca602480a00e662017c2ecdfc4e1c Test yuv444p failed. Look at tests/data/fate/filter-pixfmts-fieldmatch.err for details. make: *** [fate-filter-pixfmts-fieldmatch] Error 1 TESTfilter-pixfmts-kerndeint TESTfilter-pixfmts-lut TESTfilter-pixfmts-pad i get the same failure on a second try but none of thw swr ones anymore with the 2nd patch i get swr failures too: [...] Input #0, wav, from '/home/michael/ffmpeg-git/ffmpeg/tests/data/asynth-2626-1.wav': Duration: 00:00:06.00, bitrate: 42 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 2626 Hz, 1 channels, s16, 42 kb/s Output #0, wav, to 'pipe:': Metadata: ISFT: Lavf55.50.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 2626 Hz, mono, s16, 42 kb/s Metadata: encoder : Lavc55.71.100 pcm_s16le Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Error while filtering. [graph 0 input from stream 0:0 @ 0x1bba8c0] No EOF timestamp size= 20kB time=00:00:03.88 bitrate= 42.2kbits/s video:0kB audio:20kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.382053% make fate-swr-resample-s32p-8000-2626 TESTswr-resample-s32p-8000-2626 stddev: 2417.48 PSNR: 28.66 MAXDIFF:10437 bytes:96000/20284 Test swr-resample-s32p-8000-2626 failed. Look at tests/data/fate/swr-resample-s32p-8000-2626.err for details. make: *** [fate-swr-resample-s32p-8000-2626] Error 1 The failure is not always occuring, sometimes it passes [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] lavfi: add filter messages infrastructure.
On Wed, Jul 30, 2014 at 05:14:07PM +0200, Michael Niedermayer wrote: > On Wed, Jul 30, 2014 at 03:52:34PM +0200, Nicolas George wrote: > > Le sextidi 6 thermidor, an CCXXII, Nicolas George a écrit : > > > Le sextidi 6 thermidor, an CCXXII, Michael Niedermayer a écrit : > > > > the 4 patch set seems to break fate > > > > TESTswr-resample-s16p-48000-2626 > > > > stddev:3.88 PSNR: 84.54 MAXDIFF: 15 bytes:96000/20416 > > > > Test swr-resample-s16p-8000-44100 failed. Look at > > > > tests/data/fate/swr-resample-s16p-8000-44100.err for details. > > > > make: *** [fate-swr-resample-s16p-8000-44100] Error 1 > > > > make: *** Waiting for unfinished jobs > > > > stddev:2.27 PSNR: 89.19 MAXDIFF:7 bytes:96000/20416 > > > > Test swr-resample-s16p-8000-48000 failed. Look at > > > > tests/data/fate/swr-resample-s16p-8000-48000.err for details. > > > > make: *** [fate-swr-resample-s16p-8000-48000] Error 1 > > > > stddev:1.19 PSNR: 94.80 MAXDIFF:4 bytes: 529200/20418 > > > > Test swr-resample-s16p-44100-48000 failed. Look at > > > > tests/data/fate/swr-resample-s16p-44100-48000.err for details. > > > > make: *** [fate-swr-resample-s16p-44100-48000] Error 1 > > > > stddev: 1395.14 PSNR: 33.44 MAXDIFF: 8594 bytes:31512/20416 > > > > Test swr-resample-s16p-2626-44100 failed. Look at > > > > tests/data/fate/swr-resample-s16p-2626-44100.err for details. > > > > make: *** [fate-swr-resample-s16p-2626-44100] Error 1 > > > > stddev: 10.18 PSNR: 76.17 MAXDIFF: 27 bytes: 576000/19304 > > > > Test swr-resample-s16p-48000-2626 failed. Look at > > > > tests/data/fate/swr-resample-s16p-48000-2626.err for details. > > > > make: *** [fate-swr-resample-s16p-48000-2626] Error 1 > > > > stddev: 1395.21 PSNR: 33.44 MAXDIFF: 8606 bytes:31512/20416 > > > > Test swr-resample-s16p-2626-96000 failed. Look at > > > > tests/data/fate/swr-resample-s16p-2626-96000.err for details. > > > > make: *** [fate-swr-resample-s16p-2626-96000] Error 1 > > > > These tests do not fail for me. Can you dig up the *.err files and/or give > > some more details about the configuration? I use this on Debian/x86_64: > > > > --enable-shared --disable-static --enable-gpl --enable-libx264 > > --enable-libopus --enable-libass --enable-libfreetype --enable-avresample > > --assert-level=2 > > hmm > > first try: > make distclean ; ./configure --enable-gpl --samples=... --cc='ccache gcc' && > make -j12 fate -k > > > TESTfilter-pixfmts-il > --- ./tests/ref/fate/filter-pixfmts-fieldmatch 2014-07-28 20:15:41.549377334 > +0200 > +++ tests/data/fate/filter-pixfmts-fieldmatch 2014-07-30 16:38:36.516743355 > +0200 > @@ -1,5 +1,5 @@ > yuv410p 08518d1ceaf740696b26eb89325987c1 > yuv411p ca4b3b96c4f487fc293ad8d631f37660 > -yuv420p 2069df6ae54ce80f82d591ac753e66cc > +yuv420p e04d8e9607cc5f58feba0735536f1bfe > yuv422p 7b4fe261becce67a0a0b6886d9f6 > yuv444p 5a0ca602480a00e662017c2ecdfc4e1c > Test yuv444p failed. Look at tests/data/fate/filter-pixfmts-fieldmatch.err > for details. > make: *** [fate-filter-pixfmts-fieldmatch] Error 1 > TESTfilter-pixfmts-kerndeint > TESTfilter-pixfmts-lut > TESTfilter-pixfmts-pad > > i get the same failure on a second try but none of thw swr ones anymore > > with the 2nd patch i get swr failures too: > [...] > Input #0, wav, from > '/home/michael/ffmpeg-git/ffmpeg/tests/data/asynth-2626-1.wav': > Duration: 00:00:06.00, bitrate: 42 kb/s > Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 2626 Hz, 1 > channels, s16, 42 kb/s > Output #0, wav, to 'pipe:': > Metadata: > ISFT: Lavf55.50.100 > Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 2626 Hz, mono, > s16, 42 kb/s > Metadata: > encoder : Lavc55.71.100 pcm_s16le > Stream mapping: > Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) > Press [q] to stop, [?] for help > Error while filtering. > [graph 0 input from stream 0:0 @ 0x1bba8c0] No EOF timestamp > size= 20kB time=00:00:03.88 bitrate= 42.2kbits/s > video:0kB audio:20kB subtitle:0kB other streams:0kB global headers:0kB muxing > overhead: 0.382053% > > make fate-swr-resample-s32p-8000-2626 > TESTswr-resample-s32p-8000-2626 > stddev: 2417.48 PSNR: 28.66 MAXDIFF:10437 bytes:96000/20284 > Test swr-resample-s32p-8000-2626 failed. Look at > tests/data/fate/swr-resample-s32p-8000-2626.err for details. > make: *** [fate-swr-resample-s32p-8000-2626] Error 1 > > The failure is not always occuring, sometimes it passes heres some valgrind output: ==20004== Conditional jump or move depends on uninitialised value(s) ==20004==at 0x500BF7: request_frame (af_aresample.c:231) ==20004==by 0x4971D1: ff_request_frame (avfilter.c:346) ==20004==by 0x497253: ff_request_frame (avfilter.c:348) ==20004==by 0x500BF4: request_frame (af_aresample.c:230) ==20004==by 0x4971D1: ff_re
Re: [FFmpeg-devel] [PATCH] ffprobe: print some basic information about avframe side data
On date Wednesday 2014-07-30 15:21:06 +0200, Michael Niedermayer encoded: > Signed-off-by: Michael Niedermayer > --- > doc/ffprobe.xsd | 11 +++ > ffprobe.c | 21 - > 2 files changed, 31 insertions(+), 1 deletion(-) > > diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd > index 9ef9ecb..e0e9179 100644 > --- a/doc/ffprobe.xsd > +++ b/doc/ffprobe.xsd > @@ -55,6 +55,7 @@ > > > maxOccurs="unbounded"/> > + type="ffprobe:frameSideDataListType" minOccurs="0" maxOccurs="1" /> > > > > @@ -91,6 +92,16 @@ > > > > + > + > + minOccurs="1" maxOccurs="unbounded"/> I'd say side_data for consistency > + > + > + > + > + > + > + > > fixed="subtitle" use="required"/> > > diff --git a/ffprobe.c b/ffprobe.c > index 1329466..c9fc79d 100644 > --- a/ffprobe.c > +++ b/ffprobe.c > @@ -123,6 +123,8 @@ typedef enum { > SECTION_ID_FRAME, > SECTION_ID_FRAMES, > SECTION_ID_FRAME_TAGS, > +SECTION_ID_FRAME_SIDEDATA_LIST, > +SECTION_ID_FRAME_SIDEDATA, same here SIDE_DATA* > SECTION_ID_LIBRARY_VERSION, > SECTION_ID_LIBRARY_VERSIONS, > SECTION_ID_PACKET, > @@ -152,8 +154,10 @@ static struct section sections[] = { > [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { > SECTION_ID_FORMAT_TAGS, -1 } }, > [SECTION_ID_FORMAT_TAGS] ={ SECTION_ID_FORMAT_TAGS, "tags", > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name > = "format_tags" }, > [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", > SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } }, > -[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { > SECTION_ID_FRAME_TAGS, -1 } }, > +[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { > SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } }, > [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name > = "frame_tags" }, > +[SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, > "sidedata_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } }, > +[SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, > "sidedata", 0, { -1 } }, > [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, > "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } > }, > [SECTION_ID_LIBRARY_VERSION] ={ SECTION_ID_LIBRARY_VERSION, > "library_version", 0, { -1 } }, > [SECTION_ID_PACKETS] ={ SECTION_ID_PACKETS, "packets", > SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} }, > @@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame > *frame, AVStream *stream, > { > AVBPrint pbuf; > const char *s; > +int i; > > av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); > > @@ -1784,6 +1789,20 @@ static void show_frame(WriterContext *w, AVFrame > *frame, AVStream *stream, > } > if (do_show_frame_tags) > show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS); > +if (frame->nb_side_data) { > +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST); > +for (i = 0; i < frame->nb_side_data; i++) { > +AVFrameSideData *sd = frame->side_data[i]; > +const char *name; > + > +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA); > +name = av_frame_side_data_name(sd->type); > +print_str("side_data_type", name ? name : "unknown"); > +print_int("side_data_size", sd->size); > +writer_print_section_footer(w); > +} > +writer_print_section_footer(w); > +} > > writer_print_section_footer(w); LGTM otherwise, thanks. -- FFmpeg = Fascinating Fundamental Maxi Philosophical Emblematic Geek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
On Wed, 30 Jul 2014 10:37:12 +0200 Nicolas George wrote: > Le duodi 12 thermidor, an CCXXII, wm4 a écrit : > > The libavfilter API > > for EOF is ok, > > No, it is not. You never explained what's wrong with it. > > So if you're not actually fixing anything > > I am. Implementation, not API AFAIK. But you didn't bother explaining anything anyway. > > What wrong result? > > See my first answer when you started this bikeshedding. What's the name for patches that change API around without any sense of design? If bikeshedding is needed to avoid making the API even more confusing, so be it. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
Le duodi 12 thermidor, an CCXXII, wm4 a écrit : > You never explained what's wrong with it. This is tiring. Everyone knows it already and it has been explained numerous times. THERE IS NO TIMESTAMP FOR THE END OF STREAM. Is it enough, or do I have to waste more time explaining how that makes the duration of the last frame wrong, and how that is a problem when accurate timing is necessary, for concatenating or looping for example? -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
On Wed, 30 Jul 2014 19:10:04 +0200 Nicolas George wrote: > Le duodi 12 thermidor, an CCXXII, wm4 a écrit : > > You never explained what's wrong with it. > > This is tiring. Everyone knows it already and it has been explained numerous > times. > > THERE IS NO TIMESTAMP FOR THE END OF STREAM. You could just have said that right in the beginning. Even in the commit message you could have made explicit that the purpose of the change is adding an end PTS, instead of that being a positive side-effect. > Is it enough, or do I have to waste more time explaining how that makes the > duration of the last frame wrong, and how that is a problem when accurate > timing is necessary, for concatenating or looping for example? > Demuxers and decoding don't return such an end PTS, so why should filters? Demuxers apparently use the frame duration to time the last frame, so why not use that in lavfi too? (Demuxers also report the total length, but that is probably not useful at all for timing the last frame.) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] avutil/frame: add av_frame_side_data_name()
On Wed, Jul 30, 2014 at 02:18:47AM +0200, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > libavutil/frame.c | 14 ++ > libavutil/frame.h |5 + > 2 files changed, 19 insertions(+) patch applied with APIChages & version bump [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffprobe: print some basic information about avframe side data
On Wed, Jul 30, 2014 at 05:21:15PM +0200, Stefano Sabatini wrote: > On date Wednesday 2014-07-30 15:21:06 +0200, Michael Niedermayer encoded: > > Signed-off-by: Michael Niedermayer > > --- > > doc/ffprobe.xsd | 11 +++ > > ffprobe.c | 21 - > > 2 files changed, 31 insertions(+), 1 deletion(-) > > > > diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd > > index 9ef9ecb..e0e9179 100644 > > --- a/doc/ffprobe.xsd > > +++ b/doc/ffprobe.xsd > > @@ -55,6 +55,7 @@ > > > > > > > maxOccurs="unbounded"/> > > + > type="ffprobe:frameSideDataListType" minOccurs="0" maxOccurs="1" /> > > > > > > > use="required"/> > > @@ -91,6 +92,16 @@ > > > > > > > > + > > + > > + > minOccurs="1" maxOccurs="unbounded"/> > > I'd say side_data for consistency > > > + > > + > > + > > + > type="xsd:string"/> > > + > /> > > + > > + > > > > > fixed="subtitle" use="required"/> > > > > diff --git a/ffprobe.c b/ffprobe.c > > index 1329466..c9fc79d 100644 > > --- a/ffprobe.c > > +++ b/ffprobe.c > > @@ -123,6 +123,8 @@ typedef enum { > > SECTION_ID_FRAME, > > SECTION_ID_FRAMES, > > SECTION_ID_FRAME_TAGS, > > > +SECTION_ID_FRAME_SIDEDATA_LIST, > > +SECTION_ID_FRAME_SIDEDATA, > > same here SIDE_DATA* > > > SECTION_ID_LIBRARY_VERSION, > > SECTION_ID_LIBRARY_VERSIONS, > > SECTION_ID_PACKET, > > @@ -152,8 +154,10 @@ static struct section sections[] = { > > [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { > > SECTION_ID_FORMAT_TAGS, -1 } }, > > [SECTION_ID_FORMAT_TAGS] ={ SECTION_ID_FORMAT_TAGS, "tags", > > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", > > .unique_name = "format_tags" }, > > [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", > > SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } }, > > -[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { > > SECTION_ID_FRAME_TAGS, -1 } }, > > +[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { > > SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } }, > > [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", > > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", > > .unique_name = "frame_tags" }, > > +[SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, > > "sidedata_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } }, > > +[SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, > > "sidedata", 0, { -1 } }, > > [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, > > "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 > > } }, > > [SECTION_ID_LIBRARY_VERSION] ={ SECTION_ID_LIBRARY_VERSION, > > "library_version", 0, { -1 } }, > > [SECTION_ID_PACKETS] ={ SECTION_ID_PACKETS, "packets", > > SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} }, > > @@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame > > *frame, AVStream *stream, > > { > > AVBPrint pbuf; > > const char *s; > > +int i; > > > > av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); > > > > @@ -1784,6 +1789,20 @@ static void show_frame(WriterContext *w, AVFrame > > *frame, AVStream *stream, > > } > > if (do_show_frame_tags) > > show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS); > > +if (frame->nb_side_data) { > > +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST); > > +for (i = 0; i < frame->nb_side_data; i++) { > > +AVFrameSideData *sd = frame->side_data[i]; > > +const char *name; > > + > > +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA); > > +name = av_frame_side_data_name(sd->type); > > +print_str("side_data_type", name ? name : "unknown"); > > +print_int("side_data_size", sd->size); > > +writer_print_section_footer(w); > > +} > > +writer_print_section_footer(w); > > +} > > > > writer_print_section_footer(w); > > LGTM otherwise, thanks. sidedatas renamed applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
Le duodi 12 thermidor, an CCXXII, wm4 a écrit : > Demuxers and decoding don't return such an end PTS, so why should > filters? Demuxers apparently use the frame duration to time the last > frame, so why not use that in lavfi too? (Demuxers also report the > total length, but that is probably not useful at all for timing the > last frame.) Packets have duration, frames do not. Using the duration causes consistency problems. This has been discussed numerous times, I do not intend to spend more time repeating the obvious. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/4] dict.c: minor simplification.
Signed-off-by: Reimar Döffinger --- libavutil/dict.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavutil/dict.c b/libavutil/dict.c index 358958c..aea8910 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -90,10 +90,9 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, } else { AVDictionaryEntry *tmp = av_realloc(m->elems, (m->count + 1) * sizeof(*m->elems)); -if (tmp) -m->elems = tmp; -else +if (!tmp) return AVERROR(ENOMEM); +m->elems = tmp; } if (value) { if (flags & AV_DICT_DONT_STRDUP_KEY) -- 2.0.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.
This allows getting rid of the many, slightly differing, implementations of basically the same thing. Signed-off-by: Reimar Döffinger --- doc/APIchanges | 3 +++ ffmpeg_opt.c | 12 +++- ffplay.c | 2 +- libavfilter/vf_bbox.c| 4 +--- libavfilter/vf_cropdetect.c | 4 +--- libavformat/cinedec.c| 4 +--- libavformat/ftp.c| 10 -- libavformat/hls.c| 17 - libavformat/id3v1.c | 4 +--- libavformat/matroskadec.c| 31 +++ libavformat/mlvdec.c | 16 libavformat/mov.c| 14 +++--- libavformat/mxfdec.c | 8 ++-- libavformat/smoothstreamingenc.c | 4 +--- libavformat/vqf.c| 6 +- libavutil/dict.c | 8 libavutil/dict.h | 8 libavutil/version.h | 2 +- 18 files changed, 54 insertions(+), 103 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 5a0989d..84d46d1 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2012-10-22 API changes, most recent first: +2014-xx-xx - xxx - lavu 52.95.100 - dict.h + Add av_dict_set_int helper function. + 2014-07-30 - xxx - lavu 52.94.100 - frame.h Add av_frame_side_data_name() diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 2adefc5..4ff9f0a 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -785,7 +785,6 @@ static int open_input_file(OptionsContext *o, const char *filename) AVInputFormat *file_iformat = NULL; int err, i, ret; int64_t timestamp; -uint8_t buf[128]; AVDictionary **opts; AVDictionary *unused_opts = NULL; AVDictionaryEntry *e = NULL; @@ -814,8 +813,7 @@ static int open_input_file(OptionsContext *o, const char *filename) exit_program(1); } if (o->nb_audio_sample_rate) { -snprintf(buf, sizeof(buf), "%d", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i); -av_dict_set(&o->g->format_opts, "sample_rate", buf, 0); +av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0); } if (o->nb_audio_channels) { /* because we set audio_channels based on both the "ac" and @@ -824,9 +822,7 @@ static int open_input_file(OptionsContext *o, const char *filename) if (file_iformat && file_iformat->priv_class && av_opt_find(&file_iformat->priv_class, "channels", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)) { -snprintf(buf, sizeof(buf), "%d", - o->audio_channels[o->nb_audio_channels - 1].u.i); -av_dict_set(&o->g->format_opts, "channels", buf, 0); +av_dict_set_int(&o->g->format_opts, "channels", o->audio_channels[o->nb_audio_channels - 1].u.i, 0); } } if (o->nb_frame_rates) { @@ -2038,9 +2034,7 @@ loop_end: assert_file_overwrite(filename); if (o->mux_preload) { -uint8_t buf[64]; -snprintf(buf, sizeof(buf), "%d", (int)(o->mux_preload*AV_TIME_BASE)); -av_dict_set(&of->opts, "preload", buf, 0); +av_dict_set_int(&of->opts, "preload", o->mux_preload*AV_TIME_BASE, 0); } oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE); diff --git a/ffplay.c b/ffplay.c index af0e199..173a2e4 100644 --- a/ffplay.c +++ b/ffplay.c @@ -2582,7 +2582,7 @@ static int stream_component_open(VideoState *is, int stream_index) if (!av_dict_get(opts, "threads", NULL, 0)) av_dict_set(&opts, "threads", "auto", 0); if (stream_lowres) -av_dict_set(&opts, "lowres", av_asprintf("%d", stream_lowres), AV_DICT_DONT_STRDUP_VAL); +av_dict_set_int(&opts, "lowres", stream_lowres, 0); if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) av_dict_set(&opts, "refcounted_frames", "1", 0); if (avcodec_open2(avctx, codec, &opts) < 0) diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c index 6c6aab1..1e6feff 100644 --- a/libavfilter/vf_bbox.c +++ b/libavfilter/vf_bbox.c @@ -61,8 +61,7 @@ static int query_formats(AVFilterContext *ctx) } #define SET_META(key, value) \ -snprintf(buf, sizeof(buf), "%d", value); \ -av_dict_set(metadata, key, buf, 0); +av_dict_set_int(metadata, key, value, 0); static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { @@ -70,7 +69,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) BBoxContext *bbox = ctx->priv; FFBoundingBox box; int has_bbox, w, h; -char buf[32]; has_bbox = ff_calculate_bounding_box(&box, diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index ed8e7a8..f85a0bb 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -113,8 +113,7 @@ static int config
[FFmpeg-devel] [PATCH 3/4] dict.c: Free non-strduped av_dict_set arguments on error.
Unfortunately this was not explicitly documented and thus might be very risky. But basically all uses I saw in FFmpeg had a memleak in these cases. Signed-off-by: Reimar Döffinger --- libavutil/dict.c | 9 +++-- libavutil/dict.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libavutil/dict.c b/libavutil/dict.c index cb7be9c..2cd67e8 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -91,7 +91,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, AVDictionaryEntry *tmp = av_realloc(m->elems, (m->count + 1) * sizeof(*m->elems)); if (!tmp) -return AVERROR(ENOMEM); +goto err_out; m->elems = tmp; } if (value) { @@ -105,7 +105,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int len = strlen(oldval) + strlen(value) + 1; char *newval = av_mallocz(len); if (!newval) -return AVERROR(ENOMEM); +goto err_out; av_strlcat(newval, oldval, len); av_freep(&oldval); av_strlcat(newval, value, len); @@ -120,6 +120,11 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, } return 0; + +err_out: +if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key); +if (flags & AV_DICT_DONT_STRDUP_VAL) av_free(value); +return AVERROR(ENOMEM); } int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, diff --git a/libavutil/dict.h b/libavutil/dict.h index 06f1621..5e319fe 100644 --- a/libavutil/dict.h +++ b/libavutil/dict.h @@ -115,6 +115,8 @@ int av_dict_count(const AVDictionary *m); /** * Set the given entry in *pm, overwriting an existing entry. * + * Note: On error non-av_strduped arguments will be freed. + * * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL * a dictionary struct is allocated and put in *pm. * @param key entry key to add to *pm (will be av_strduped depending on flags) -- 2.0.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/4] dict.c: empty dictionaries should be a NULL pointer.
Ensure this is even the case if they are empty because we failed adding the first entry. Signed-off-by: Reimar Döffinger --- libavutil/dict.c | 4 1 file changed, 4 insertions(+) diff --git a/libavutil/dict.c b/libavutil/dict.c index 2cd67e8..9063a57 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -122,6 +122,10 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, return 0; err_out: +if (!m->count) { +av_free(m->elems); +av_freep(pm); +} if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key); if (flags & AV_DICT_DONT_STRDUP_VAL) av_free(value); return AVERROR(ENOMEM); -- 2.0.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] dict.c: Free non-strduped av_dict_set arguments on error.
On Tue, Jul 29, 2014 at 10:13:39PM +0200, Michael Niedermayer wrote: > On Tue, Jul 29, 2014 at 09:26:48PM +0200, Reimar Döffinger wrote: > > Unfortunately this was not explicitly documented and thus > > might be very risky. > > But basically all uses I saw in FFmpeg had a memleak in these > > cases. > > > > Signed-off-by: Reimar Döffinger > > --- > > libavutil/dict.c | 9 +++-- > > libavutil/dict.h | 2 ++ > > 2 files changed, 9 insertions(+), 2 deletions(-) > > doesnt apply > > Applying: dict.c: Free non-strduped av_dict_set arguments on error. > fatal: sha1 information is lacking or useless (libavutil/dict.c). > Repository lacks necessary blobs to fall back on 3-way merge. > Cannot fall back to three-way merge. > Patch failed at 0001 dict.c: Free non-strduped av_dict_set arguments on error. Sorry, I messed this up at some point. Resent, with the missing patch which was the real reason for all this, and with order changed to make a bit more sense. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
On 30/07/14 10:33 AM, Pierre Edouard Lepere wrote: > Hi, > > Here's a patch adding ASM transform_add functions for HEVC. > > Regards, > Pierre-Edouard Lepere Some remarks below. > diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile > index 7469293..658ad5e 100644 > --- a/libavcodec/x86/Makefile > +++ b/libavcodec/x86/Makefile > @@ -117,7 +117,8 @@ YASM-OBJS-$(CONFIG_AAC_DECODER)+= x86/sbrdsp.o > YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/dcadsp.o > YASM-OBJS-$(CONFIG_HEVC_DECODER) += x86/hevc_mc.o \ >x86/hevc_deblock.o\ > - x86/hevc_idct.o > + x86/hevc_idct.o \ > + x86/hevc_res_add.o Why not adding this to hevc_idct.c? It technically used to be there before the rext split. > YASM-OBJS-$(CONFIG_PNG_DECODER)+= x86/pngdsp.o > YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o > YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o > diff --git a/libavcodec/x86/hevc_res_add.asm b/libavcodec/x86/hevc_res_add.asm > new file mode 100644 > index 000..bc550ef > --- /dev/null > +++ b/libavcodec/x86/hevc_res_add.asm > @@ -0,0 +1,454 @@ > +; /* > +; * Provide intrinsics for transform_add functions for HEVC decoding It's not intrisics anymore :P > +; * Copyright (c) 2014 Pierre-Edouard LEPERE > +; * > +; * 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 > +; */ > +%include "libavutil/x86/x86util.asm" > + > +SECTION_RODATA SECTION_RODATA 32 It's needed for the AVX2 functions. > +max_pixels_10: times 16 dw ((1 << 10)-1) > +tr_add_10: times 4 dd ((1 << 14-10) + 1) > + > + > +SECTION .text > + > +;the tr_add macros and functions were largely inspired by x264 project's > code in the h264_idct.asm file > +%macro TR_ADD_INIT_MMX 2 > +mova m2, [r1] > +mova m4, [r1+8] > +pxor m3, m3 > +psubw m3, m2 > +packuswb m2, m2 > +packuswb m3, m3 > +pxor m5, m5 > +psubw m5, m4 > +packuswb m4, m4 > +packuswb m5, m5 > +%endmacro > + > +%macro TR_ADD_OP_MMX 4 This macro is used only by one function. %1 is always movh. Just hardcode it like the movas above. > +%1m0, [%2 ] > +%1m1, [%2+%3 ] > +paddusb m0, m2 > +paddusb m1, m4 > +psubusb m0, m3 > +psubusb m1, m5 > +%1 [%2 ], m0 > +%1 [%2+%3 ], m1 > +%endmacro > + > +%macro TR_ADD_INIT_SSE_8 2 > +movu m4, [r1] > +movu m6, [r1+16] > +movu m8, [r1+32] > +movu m10, [r1+48] > +lea %1, [%2*3] > +pxor m5, m5 > +psubw m5, m4 > +packuswb m4, m4 > +packuswb m5, m5 > +pxor m7, m7 > +psubw m7, m6 > +packuswb m6, m6 > +packuswb m7, m7 > +pxor m9, m9 > +psubw m9, m8 > +packuswb m8, m8 > +packuswb m9, m9 > +pxor m11, m11 > +psubwm11, m10 > +packuswb m10, m10 > +packuswb m11, m11 > +%endmacro > + > +%macro TR_ADD_INIT_SSE_16 2 > +lea %1, [%2*3] > +movu m4, [r1] > +movu m6, [r1+16] > +pxor m5, m5 > +psubw m7, m5, m6 > +psubw m5, m4 > +packuswb m4, m6 > +packuswb m5, m7 > + > +movu m6, [r1+32] > +movu m8, [r1+48] > +pxor m7, m7 > +psubw m9, m7, m8 > +psubw m7, m6 > +packuswb m6, m8 > +packuswb m7, m9 > + > +movu m8, [r1+64] > +movu m10, [r1+80] > +pxor m9, m9 > +psubwm11, m9, m10 > +psubw m9, m8 > +packuswb m8, m10 > +packuswb m9, m11 > +
[FFmpeg-devel] [PATCH] doc: add very basic libcdio documentation
--- doc/indevs.texi | 15 +++ 1 file changed, 15 insertions(+) diff --git a/doc/indevs.texi b/doc/indevs.texi index 4ca12ff..e0e7e67 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -483,6 +483,21 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]" @end itemize +@section libcdio + +Audio-CD input device based on cdio. + +To enable this input device during configuration you need libcdio +installed on your system. + +This device allows playing and grabbing from an Audio-CD. + +For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0, +you may run the command: +@example +ffmpeg -f libcdio -i /dev/sr0 cd.wav +@end example + @section libdc1394 IIDC1394 input device, based on libdc1394 and libraw1394. -- 1.8.5.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.
On Wed, Jul 30, 2014 at 08:38:06PM +0200, Reimar Döffinger wrote: > This allows getting rid of the many, slightly differing, implementations > of basically the same thing. This one really can need a few extra eyes. It's likely I missed a few places, and there's a risk I messed up one or the other place where I did the replacement. Still, the massive number of places this is useful IMHO speaks strongly for doing something like this, and I suspect the situation looks similar in some of the programs using FFmpeg... ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
On 7/30/2014 6:10 PM, Nicolas George wrote: > This is tiring. Everyone knows it already and it has been explained numerous > times. Yeah, why should you have to explain the reason for a change in a review of that change? How silly. I should just divine the reason why. I guess we don't count as "everyone". - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.
On Wed, 30 Jul 2014 20:38:06 +0200 Reimar Döffinger wrote: > This allows getting rid of the many, slightly differing, implementations > of basically the same thing. > > Signed-off-by: Reimar Döffinger > --- > doc/APIchanges | 3 +++ > ffmpeg_opt.c | 12 +++- > ffplay.c | 2 +- > libavfilter/vf_bbox.c| 4 +--- > libavfilter/vf_cropdetect.c | 4 +--- > libavformat/cinedec.c| 4 +--- > libavformat/ftp.c| 10 -- > libavformat/hls.c| 17 - > libavformat/id3v1.c | 4 +--- > libavformat/matroskadec.c| 31 +++ > libavformat/mlvdec.c | 16 > libavformat/mov.c| 14 +++--- > libavformat/mxfdec.c | 8 ++-- > libavformat/smoothstreamingenc.c | 4 +--- > libavformat/vqf.c| 6 +- > libavutil/dict.c | 8 > libavutil/dict.h | 8 > libavutil/version.h | 2 +- > 18 files changed, 54 insertions(+), 103 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 5a0989d..84d46d1 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -15,6 +15,9 @@ libavutil: 2012-10-22 > > API changes, most recent first: > > +2014-xx-xx - xxx - lavu 52.95.100 - dict.h > + Add av_dict_set_int helper function. > + > 2014-07-30 - xxx - lavu 52.94.100 - frame.h >Add av_frame_side_data_name() > > diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c > index 2adefc5..4ff9f0a 100644 > --- a/ffmpeg_opt.c > +++ b/ffmpeg_opt.c > @@ -785,7 +785,6 @@ static int open_input_file(OptionsContext *o, const char > *filename) > AVInputFormat *file_iformat = NULL; > int err, i, ret; > int64_t timestamp; > -uint8_t buf[128]; > AVDictionary **opts; > AVDictionary *unused_opts = NULL; > AVDictionaryEntry *e = NULL; > @@ -814,8 +813,7 @@ static int open_input_file(OptionsContext *o, const char > *filename) > exit_program(1); > } > if (o->nb_audio_sample_rate) { > -snprintf(buf, sizeof(buf), "%d", > o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i); > -av_dict_set(&o->g->format_opts, "sample_rate", buf, 0); > +av_dict_set_int(&o->g->format_opts, "sample_rate", > o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0); > } > if (o->nb_audio_channels) { > /* because we set audio_channels based on both the "ac" and > @@ -824,9 +822,7 @@ static int open_input_file(OptionsContext *o, const char > *filename) > if (file_iformat && file_iformat->priv_class && > av_opt_find(&file_iformat->priv_class, "channels", NULL, 0, > AV_OPT_SEARCH_FAKE_OBJ)) { > -snprintf(buf, sizeof(buf), "%d", > - o->audio_channels[o->nb_audio_channels - 1].u.i); > -av_dict_set(&o->g->format_opts, "channels", buf, 0); > +av_dict_set_int(&o->g->format_opts, "channels", > o->audio_channels[o->nb_audio_channels - 1].u.i, 0); > } > } > if (o->nb_frame_rates) { > @@ -2038,9 +2034,7 @@ loop_end: > assert_file_overwrite(filename); > > if (o->mux_preload) { > -uint8_t buf[64]; > -snprintf(buf, sizeof(buf), "%d", (int)(o->mux_preload*AV_TIME_BASE)); > -av_dict_set(&of->opts, "preload", buf, 0); > +av_dict_set_int(&of->opts, "preload", o->mux_preload*AV_TIME_BASE, > 0); > } > oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE); > > diff --git a/ffplay.c b/ffplay.c > index af0e199..173a2e4 100644 > --- a/ffplay.c > +++ b/ffplay.c > @@ -2582,7 +2582,7 @@ static int stream_component_open(VideoState *is, int > stream_index) > if (!av_dict_get(opts, "threads", NULL, 0)) > av_dict_set(&opts, "threads", "auto", 0); > if (stream_lowres) > -av_dict_set(&opts, "lowres", av_asprintf("%d", stream_lowres), > AV_DICT_DONT_STRDUP_VAL); > +av_dict_set_int(&opts, "lowres", stream_lowres, 0); > if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == > AVMEDIA_TYPE_AUDIO) > av_dict_set(&opts, "refcounted_frames", "1", 0); > if (avcodec_open2(avctx, codec, &opts) < 0) > diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c > index 6c6aab1..1e6feff 100644 > --- a/libavfilter/vf_bbox.c > +++ b/libavfilter/vf_bbox.c > @@ -61,8 +61,7 @@ static int query_formats(AVFilterContext *ctx) > } > > #define SET_META(key, value) \ > -snprintf(buf, sizeof(buf), "%d", value); \ > -av_dict_set(metadata, key, buf, 0); > +av_dict_set_int(metadata, key, value, 0); > > static int filter_frame(AVFilterLink *inlink, AVFrame *frame) > { > @@ -70,7 +69,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > *frame) > BBoxContext *bbox = ctx->priv; > FFBoundingBox box
Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
Le 30 juil. 2014 à 16:35, Ronald S. Bultje a écrit : > Hi! > > On Wed, Jul 30, 2014 at 9:33 AM, Pierre Edouard Lepere < > pierre-edouard.lep...@insa-rennes.fr> wrote: > >> Here's a patch adding ASM transform_add functions for HEVC. > > > Yay! I'll try to review soon. Do you have rough performance metrics? I know > it's faster :-p but it's nice to document by how much. > Rather faster, yes. Some benches below. But note that these optimizations do not contain IDCTs. 8bits wo assembly: - 1753 decicycles in transform add, 975751 runs, 72825 skips SSE2: - 490 decicycles in transform add, 1048545 runs, 31 skips 10bits wo assembly: 3534 decicycles in transform add, 1046294 runs, 2282 skips SSE2: 527 decicycles in transform add, 1048525 runs, 51 skips AVX: 483 decicycles in transform add, 1048542 runs, 34 skips AVX2: 338 decicycles in transform add, 1048558 runs, 18 skips Mickaël ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.
On Wed, Jul 30, 2014 at 09:22:27PM +0200, wm4 wrote: > > /** > > @@ -123,6 +125,12 @@ int av_dict_count(const AVDictionary *m); > > int av_dict_set(AVDictionary **pm, const char *key, const char *value, int > > flags); > > > > /** > > + * Convenience wrapper for av_dict_set that converts the value to a string > > + * and stores it. > > + */ > > +int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int > > flags); > > + > > +/** > > I think that's a pretty good idea, but you could make it more general > by adding something like av_dict_set_fmt(), which adds a > snprintf-formatted value. av_dict_set_int could then call this too. It seemed to me that there just wouldn't be enough places to really justify it. A generic function will still allow the various variations of using %d vs. %u vs. %PRId64 etc. for doing essentially the same thing. Also since I wouldn't know the length beforehand, I'd have to use something like our asprintf. However to do that efficiently, no "no strdup" flag should be used. But then you run into the memleak issue my other patch is about, and that would have to be resolved first. And at that point I concluded that maybe this is a solution with fairly good complexity/benefit ratio, something I am not convinced of for a more generic one. Especially if the difference would likely be between (more or less) av_dict_set(d, "KEY", flags, "%xyz", somevar); and av_dict_set(d, "KEY", av_asprintf("%xyz", somevar), flags | DONT_STRDUP_VAL); Note that I think we have code that does things much more messily than the latter one for no good reason, so that might be worth looking at. More or less that was my thought process, though I might have missed some things. > Also, maybe it would be better to split the libavutil and the other > changes into 2 commits. I guess I just wanted to have the proof of usefulness and the API together, but I admit just mailing them out together is probably good enough. I can do that later once there aren't further comments if it's preferred. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
On 30/07/14 10:33 AM, Pierre Edouard Lepere wrote: > +%macro TR_ADD_INIT_SSE_8 2 > +movu m4, [r1] > +movu m6, [r1+16] > +movu m8, [r1+32] > +movu m10, [r1+48] You can use mova here, and probably in every other movu as well. > +lea %1, [%2*3] > +pxor m5, m5 > +psubw m5, m4 > +packuswb m4, m4 > +packuswb m5, m5 > +pxor m7, m7 > +psubw m7, m6 > +packuswb m6, m6 > +packuswb m7, m7 > +pxor m9, m9 > +psubw m9, m8 > +packuswb m8, m8 > +packuswb m9, m9 > +pxor m11, m11 > +psubwm11, m10 > +packuswb m10, m10 > +packuswb m11, m11 > +%endmacro > > +%macro TR_ADD_OP_SSE 4 > +%1m0, [%2 ] > +%1m1, [%2+%3 ] > +%1m2, [%2+%3*2] > +%1m3, [%2+%4 ] > +paddusb m0, m4 > +paddusb m1, m6 > +paddusb m2, m8 > +paddusb m3, m10 > +psubusb m0, m5 > +psubusb m1, m7 > +psubusb m2, m9 > +psubusb m3, m11 > +%1 [%2 ], m0 > +%1 [%2+%3 ], m1 > +%1 [%2+2*%3], m2 > +%1 [%2+%4 ], m3 > +%endmacro You can use packuswb to pack two regs into one, like you did in TR_ADD_INIT_SSE_16. Then you simply use movq+movhps to load and store data, like so: %macro TR_ADD_INIT_SSE_8 2 mova m4, [r1] mova m6, [r1+16] mova m0, [r1+32] mova m2, [r1+48] lea %1, [%2*3] pxor m5, m5 psubw m5, m4 pxor m7, m7 psubw m7, m6 pxor m1, m1 psubw m1, m0 packuswb m4, m0 packuswb m5, m1 pxor m3, m3 psubw m3, m2 packuswb m6, m2 packuswb m7, m3 %endmacro %macro TR_ADD_OP_SSE 4 movqm0, [%2 ] movqm1, [%2+%3 ] movhps m0, [%2+%3*2] movhps m1, [%2+%4 ] paddusb m0, m4 paddusb m1, m6 psubusb m0, m5 psubusb m1, m7 movq [%2 ], m0 movq [%2+%3 ], m1 movhps [%2+2*%3], m0 movhps [%2+%4 ], m1 %endmacro This not only reduced the instruction count, but also made it use 8 xmm regs instead of 12. Reordering the instructions might prevent some dependencies as well. The TR_ADD_OP_SSE macro as edited above will not work for hevc_transform_add16_8 anymore, so you will have to duplicate it. Haven't looked at hevc_transform_add16_8, but I'm sure it can be done with less than 14 xmm registers. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
Hi, On Wed, Jul 30, 2014 at 5:04 PM, James Almer wrote: > On 30/07/14 10:33 AM, Pierre Edouard Lepere wrote: > > > +%macro TR_ADD_INIT_SSE_8 2 > > +movu m4, [r1] > > +movu m6, [r1+16] > > +movu m8, [r1+32] > > +movu m10, [r1+48] > > You can use mova here, and probably in every other movu as well. > > > +lea %1, [%2*3] > > +pxor m5, m5 > > +psubw m5, m4 > > +packuswb m4, m4 > > +packuswb m5, m5 > > +pxor m7, m7 > > +psubw m7, m6 > > +packuswb m6, m6 > > +packuswb m7, m7 > > +pxor m9, m9 > > +psubw m9, m8 > > +packuswb m8, m8 > > +packuswb m9, m9 > > +pxor m11, m11 > > +psubwm11, m10 > > +packuswb m10, m10 > > +packuswb m11, m11 > > +%endmacro > > > > +%macro TR_ADD_OP_SSE 4 > > +%1m0, [%2 ] > > +%1m1, [%2+%3 ] > > +%1m2, [%2+%3*2] > > +%1m3, [%2+%4 ] > > +paddusb m0, m4 > > +paddusb m1, m6 > > +paddusb m2, m8 > > +paddusb m3, m10 > > +psubusb m0, m5 > > +psubusb m1, m7 > > +psubusb m2, m9 > > +psubusb m3, m11 > > +%1 [%2 ], m0 > > +%1 [%2+%3 ], m1 > > +%1 [%2+2*%3], m2 > > +%1 [%2+%4 ], m3 > > +%endmacro > > You can use packuswb to pack two regs into one, like you did in > TR_ADD_INIT_SSE_16. > Then you simply use movq+movhps to load and store data, like so: > > %macro TR_ADD_INIT_SSE_8 2 > mova m4, [r1] > mova m6, [r1+16] > mova m0, [r1+32] > mova m2, [r1+48] > lea %1, [%2*3] > pxor m5, m5 > psubw m5, m4 > pxor m7, m7 > psubw m7, m6 > pxor m1, m1 > psubw m1, m0 > packuswb m4, m0 > packuswb m5, m1 > pxor m3, m3 > psubw m3, m2 > packuswb m6, m2 > packuswb m7, m3 > %endmacro > > %macro TR_ADD_OP_SSE 4 > movqm0, [%2 ] > movqm1, [%2+%3 ] > movhps m0, [%2+%3*2] > movhps m1, [%2+%4 ] > paddusb m0, m4 > paddusb m1, m6 > psubusb m0, m5 > psubusb m1, m7 > movq [%2 ], m0 > movq [%2+%3 ], m1 > movhps [%2+2*%3], m0 > movhps [%2+%4 ], m1 > %endmacro Why all these memory round-trips? Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.
+int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, +int flags) +{ +char valuestr[22]; +snprintf(valuestr, sizeof(valuestr), "%"PRId64, value); +return av_dict_set_int(pm, key, valuestr, flags); +} I guess it's infinite recurrence. ffplay crashes when ftp:// source with -timeout option is provided. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.
On 30.07.2014 23:16, Lukasz Marek wrote: +int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, +int flags) +{ +char valuestr[22]; +snprintf(valuestr, sizeof(valuestr), "%"PRId64, value); +return av_dict_set_int(pm, key, valuestr, flags); +} I guess it's infinite recurrence. ffplay crashes when ftp:// source with -timeout option is provided. Of course I meant recursion. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add
On 30/07/14 6:12 PM, Ronald S. Bultje wrote: > Why all these memory round-trips? > > Ronald What do you suggest? I only simplified the function without trying to refactor it much. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/4] lavfi: add filter metaframes infrastructure.
Metaframes are frames without data, identified by a negative format code, used to carry special conditions. They are sent only to filter that declare supporting them. The only metaframe for now is EOF; this mechanism augments the current mechanism based on request_frame() returning AVERROR_EOF, with the advantage that the EOF metaframe carries a timestamp. The metaframes are a purely internal API and do not leak to the application. Signed-off-by: Nicolas George --- libavfilter/avfilter.c | 73 +- libavfilter/internal.h | 34 +++ 2 files changed, 100 insertions(+), 7 deletions(-) Changed the name to "metaframes". Allocate the frame with the classic method. diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 7b11467..7894173 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -346,15 +346,16 @@ int ff_request_frame(AVFilterLink *link) ret = link->srcpad->request_frame(link); else if (link->src->inputs[0]) ret = ff_request_frame(link->src->inputs[0]); -if (ret == AVERROR_EOF && link->partial_buf) { -AVFrame *pbuf = link->partial_buf; -link->partial_buf = NULL; -ret = ff_filter_frame_framed(link, pbuf); -} if (ret < 0) { +if (!link->frame_requested) { +av_assert0(ret == AVERROR_EOF); +ret = 0; +} link->frame_requested = 0; -if (ret == AVERROR_EOF) -link->closed = 1; +if (ret == AVERROR_EOF) { +ret = ff_filter_link_close(link, AV_NOPTS_VALUE); +return ret < 0 ? ret : AVERROR_EOF; +} } else { av_assert0(!link->frame_requested || link->flags & FF_LINK_FLAG_REQUEST_LOOP); @@ -1132,10 +1133,52 @@ static int ff_filter_frame_needs_framing(AVFilterLink *link, AVFrame *frame) return ret; } +static int ff_filter_metaframe(AVFilterLink *link, AVFrame *frame) +{ +AVFrame *pbuf = link->partial_buf; +int ret; + +if (pbuf) { +link->partial_buf = NULL; +if ((ret = ff_filter_frame_framed(link, pbuf)) < 0) +return ret; +} + +if ((link->dst->filter->flags & FF_FILTER_FLAG_SUPPORT_METAFRAMES)) { +ret = link->dstpad->filter_frame ? + link->dstpad->filter_frame(link, frame) : + default_filter_frame(link, frame); +if (ret < 0) +return ret; +} + +switch (frame->format) { + +case FF_METAFRAME_EOF: +link->closed = 1; +break; + +case 0: +case FF_METAFRAME_NOP: +/* Not implemented yet because not used either for now. + Caveat: if the same metaframe is forwarded to the next filter + and the next filter changes the type, the type change must not be + taken into account for the first link. */ + +default: +av_assert0(!"reached"); +} + +return ret; +} + int ff_filter_frame(AVFilterLink *link, AVFrame *frame) { FF_TPRINTF_START(NULL, filter_frame); ff_tlog_link(NULL, link, 1); ff_tlog(NULL, " "); ff_tlog_ref(NULL, frame, 1); +if (frame->format < -1) +return ff_filter_metaframe(link, frame); + /* Consistency checks */ if (link->type == AVMEDIA_TYPE_VIDEO) { if (strcmp(link->dst->filter->name, "scale")) { @@ -1162,6 +1205,22 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame) } } +int ff_filter_link_close(AVFilterLink *link, int64_t pts) +{ +AVFrame *frame; +int ret; + +if (link->closed) +return 0; +if (!(frame = av_frame_alloc())) +return AVERROR(ENOMEM); +frame->format = FF_METAFRAME_EOF; +frame->pts = pts; +ret = ff_filter_frame(link, frame); +av_frame_free(&frame); +return ret; +} + const AVClass *avfilter_get_class(void) { return &avfilter_class; diff --git a/libavfilter/internal.h b/libavfilter/internal.h index 308b115..fbe603a 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -374,4 +374,38 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name); */ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter); +/** + * The filter can accept metaframes. + * Metaframes are AVFrame structures with a negative format field. + * The framework will take default actions based on the metaframe type. + * The destination filter is allowed to reset the type to inhibit the + * default actions. + */ +#define FF_FILTER_FLAG_SUPPORT_METAFRAMES (1 << 24) + +/** + * Types of metaframes that can be passer to a filter. + */ +enum { +/** + * Do not do anything. + * Can be used by the destination filter to inhibit default handling. + */ +FF_METAFRAME_NOP = -1, + +/** + * The input has reached EOF. + * The pts field holds the timestamp of the end of t
[FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
Also deprecate adding a NULL frame to mark EOF. TODO APIchanges entry, version bump. Signed-off-by: Nicolas George --- libavfilter/buffersrc.c | 40 ++-- libavfilter/buffersrc.h | 15 +++ 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 27d3db0..6d71587 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -63,6 +63,7 @@ typedef struct BufferSourceContext { char*channel_layout_str; int eof; +int64_t eof_pts; } BufferSourceContext; #define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format)\ @@ -77,6 +78,27 @@ typedef struct BufferSourceContext { return AVERROR(EINVAL);\ } +static int push_if_flag(AVFilterContext *ctx, int flags) +{ +return (flags & AV_BUFFERSRC_FLAG_PUSH) ? +ctx->output_pads[0].request_frame(ctx->outputs[0]) : 0; +} + +int av_buffersrc_close(AVFilterContext *ctx, int64_t pts, int flags) +{ +BufferSourceContext *s = ctx->priv; + +if (pts == AV_NOPTS_VALUE) { +av_log(ctx, AV_LOG_WARNING, "No EOF timestamp\n"); +/* FIXME use duration for audio */ +pts = av_rescale_q(ctx->outputs[0]->current_pts, + AV_TIME_BASE_Q, ctx->outputs[0]->time_base) + 1; +} +s->eof_pts = pts; +s->eof = 1; +return push_if_flag(ctx, flags); +} + int attribute_align_arg av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame) { return av_buffersrc_add_frame_flags(ctx, (AVFrame *)frame, @@ -125,8 +147,7 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, s->nb_failed_requests = 0; if (!frame) { -s->eof = 1; -return 0; +return av_buffersrc_close(ctx, AV_NOPTS_VALUE, flags); } else if (s->eof) return AVERROR(EINVAL); @@ -177,11 +198,7 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, return ret; } -if ((flags & AV_BUFFERSRC_FLAG_PUSH)) -if ((ret = ctx->output_pads[0].request_frame(ctx->outputs[0])) < 0) -return ret; - -return 0; +return push_if_flag(ctx, flags); } #if FF_API_AVFILTERBUFFER @@ -211,8 +228,7 @@ int av_buffersrc_add_ref(AVFilterContext *ctx, AVFilterBufferRef *buf, int ret = 0, planes, i; if (!buf) { -s->eof = 1; -return 0; +return av_buffersrc_close(ctx, AV_NOPTS_VALUE, flags); } else if (s->eof) return AVERROR(EINVAL); @@ -487,10 +503,14 @@ static int request_frame(AVFilterLink *link) { BufferSourceContext *c = link->src->priv; AVFrame *frame; +int ret; if (!av_fifo_size(c->fifo)) { -if (c->eof) +if (c->eof) { +if ((ret = ff_filter_link_close(link, c->eof_pts)) < 0) +return ret; return AVERROR_EOF; +} c->nb_failed_requests++; return AVERROR(EAGAIN); } diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h index ea34c04..28ca545 100644 --- a/libavfilter/buffersrc.h +++ b/libavfilter/buffersrc.h @@ -145,6 +145,8 @@ int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame); * * @param buffer_src pointer to a buffer source context * @param frame a frame, or NULL to mark EOF + *(Using NULL to mark EOF is deprecated, use + *av_buffersrc_close() instead.) * @param flags a combination of AV_BUFFERSRC_FLAG_* * @return>= 0 in case of success, a negative AVERROR code *in case of failure @@ -154,6 +156,19 @@ int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src, /** + * Close a buffer source. + * + * This cause EOF to be propagated along the filter graph. + * + * @param buffer_src pointer to a buffer source context + * @param pts the timestamp of the end of stream + * @param flags a combination of AV_BUFFERSRC_FLAG_* + * @return>= 0 in case of success, a negative AVERROR code + *in case of failure + */ +int av_buffersrc_close(AVFilterContext *buffer_src, int64_t pts, int flags); + +/** * @} */ -- 2.0.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/4] ffmpeg: use av_buffersrc_close().
Signed-off-by: Nicolas George --- ffmpeg.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 1c1a559..3ac6620 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1741,12 +1741,9 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) if (!*got_output || ret < 0) { if (!pkt->size) { +int64_t pts = av_rescale_q(ist->next_pts, AV_TIME_BASE_Q, ist->st->time_base); for (i = 0; i < ist->nb_filters; i++) -#if 1 -av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0); -#else -av_buffersrc_add_frame(ist->filters[i]->filter, NULL); -#endif +av_buffersrc_close(ist->filters[i]->filter, pts, 0); } return ret; } @@ -1894,12 +1891,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output) if (!*got_output || ret < 0) { if (!pkt->size) { +int64_t pts = av_rescale_q(ist->next_pts, AV_TIME_BASE_Q, ist->st->time_base); for (i = 0; i < ist->nb_filters; i++) -#if 1 -av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0); -#else -av_buffersrc_add_frame(ist->filters[i]->filter, NULL); -#endif +av_buffersrc_close(ist->filters[i]->filter, pts, 0); } return ret; } -- 2.0.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/4] lavfi/vf_fps: accept EOF timestamp.
This makes the FPS filter duplicate the last frame to take its duration into account, exactly like the other ones. TODO find corresponding trac ticket(s). Signed-off-by: Nicolas George --- libavfilter/vf_fps.c | 58 +++- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index a38633d..e969335 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -28,6 +28,7 @@ #include #include +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/fifo.h" #include "libavutil/mathematics.h" @@ -88,6 +89,7 @@ static av_cold int init(AVFilterContext *ctx) return 0; } +/* FIXME: misnommer, the frames are discarded, not flushed */ static void flush_fifo(AVFifoBuffer *fifo) { while (av_fifo_size(fifo)) { @@ -131,25 +133,10 @@ static int request_frame(AVFilterLink *outlink) while (ret >= 0 && s->frames_out == frames_out) ret = ff_request_frame(ctx->inputs[0]); - -/* flush the fifo */ -if (ret == AVERROR_EOF && av_fifo_size(s->fifo)) { -int i; -for (i = 0; av_fifo_size(s->fifo); i++) { -AVFrame *buf; - -av_fifo_generic_read(s->fifo, &buf, sizeof(buf), NULL); -buf->pts = av_rescale_q(s->first_pts, ctx->inputs[0]->time_base, -outlink->time_base) + s->frames_out; - -if ((ret = ff_filter_frame(outlink, buf)) < 0) -return ret; - -s->frames_out++; -} -return 0; +if (ret == AVERROR_EOF) { +flush_fifo(s->fifo); +av_assert1(!av_fifo_size(s->fifo)); } - return ret; } @@ -157,6 +144,7 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFrame *buf) { int ret; +av_assert1(buf->format >= 0); if (!av_fifo_space(fifo) && (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo { av_frame_free(&buf); @@ -167,6 +155,25 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFrame *buf) return 0; } +static int flush_fifo_to_out(AVFilterContext *ctx) +{ +FPSContext *s = ctx->priv; +AVFilterLink *outlink = ctx->outputs[0]; +AVFrame *frame; +int ret; + +while (av_fifo_size(s->fifo)) { + +av_fifo_generic_read(s->fifo, &frame, sizeof(frame), NULL); +frame->pts = av_rescale_q(s->first_pts, ctx->inputs[0]->time_base, +outlink->time_base) + s->frames_out; +if ((ret = ff_filter_frame(outlink, frame)) < 0) +return ret; +s->frames_out++; +} +return 0; +} + static int filter_frame(AVFilterLink *inlink, AVFrame *buf) { AVFilterContext*ctx = inlink->dst; @@ -194,6 +201,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) } else { s->first_pts = buf->pts; } +} else if (buf->format < 0) { +return 0; } else { av_log(ctx, AV_LOG_WARNING, "Discarding initial frame(s) with no " "timestamp.\n"); @@ -203,8 +212,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) return 0; } +if (buf->format < 0) { +if (buf->format != FF_METAFRAME_EOF) +return 0; +if (buf->pts == AV_NOPTS_VALUE) +return flush_fifo_to_out(ctx); +if (!av_fifo_size(s->fifo)) +return 0; +} + /* now wait for the next timestamp */ if (buf->pts == AV_NOPTS_VALUE || av_fifo_size(s->fifo) <= 0) { +av_assert1(buf->format >= 0); return write_to_fifo(s->fifo, buf); } @@ -264,7 +283,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) } flush_fifo(s->fifo); -ret = write_to_fifo(s->fifo, buf); +ret = buf->format < 0 ? 0 : write_to_fifo(s->fifo, buf); return ret; } @@ -295,6 +314,7 @@ AVFilter ff_vf_fps = { .uninit = uninit, .priv_size = sizeof(FPSContext), .priv_class = &fps_class, +.flags = FF_FILTER_FLAG_SUPPORT_METAFRAMES, .inputs = avfilter_vf_fps_inputs, .outputs = avfilter_vf_fps_outputs, }; -- 2.0.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().
Le duodi 12 thermidor, an CCXXII, Derek Buitenhuis a écrit : > Yeah, why should you have to explain the reason for a change in > a review of that change? How silly. I should just divine the reason > why. I guess we don't count as "everyone". To review a change, the minimum is to read it. The answers to the first questions were in the proposed commit messages. I hope you'll excuse me if I take offence when someone nags me with questions while they obviously did not care enough to read them. If you have read them and would like details or find something unclear, OTOH, I would gladly explain what needs explaining. New patch series sent, with the constructive comments hopefully taken into account. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] lavfi: add filter messages infrastructure.
Le duodi 12 thermidor, an CCXXII, Michael Niedermayer a écrit : > heres some valgrind output: Thanks for the precisions. I was unable to reproduce any of it, despite running FATE through valgrind. Either the bug went away when I changed the allocation of the frame or there is something very strange going on. I just sent an updated version. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [FATESERVER/PATCH] Update to new website style
Signed-off-by: Timothy Gu --- FATE.pm | 130 -- fate.css| 154 ++-- history.cgi | 32 +++-- index.cgi | 117 - report.cgi | 46 ++ 5 files changed, 226 insertions(+), 253 deletions(-) diff --git a/FATE.pm b/FATE.pm index 806168d..544e80f 100644 --- a/FATE.pm +++ b/FATE.pm @@ -27,7 +27,8 @@ BEGIN { @ISA = qw/Exporter/; @EXPORT = qw/split_header split_config split_rec parse_date agestr split_stats load_summary load_report load_lastpass - doctype start end tag h1 span trow trowa trowh th td anchor navbar + start end tag h1 span trow trowa trowh th td anchor + head1 head2 head3 footer fail $fatedir $recent_age $ancient_age $hidden_age href $gitweb/; } @@ -199,10 +200,6 @@ $block_tags{$_} = 1 for @block_tags; my @tags; -sub doctype { -print q{http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>}, "\n"; -} - sub opentag { my ($tag, %attrs) = @_; print qq{<$tag}; @@ -301,35 +298,116 @@ sub href { } } -sub navbar { +sub head1 { +print < + + + +EOF +} + +sub head2 { # Copied from ffmpeg-web print < - - - - - -News | -About | -Download | -Documentation | -Bug Reports | -Contact | -Donations | -Consulting | -Projects | -Legal | -Security | -http://fate.ffmpeg.org";>FATE - +https://ffmpeg.org/css/font-awesome.min.css"; /> +https://ffmpeg.org/css/bootstrap.min.css"; /> +https://ffmpeg.org/css/simple-sidebar.css"; /> +https://ffmpeg.org/css/style.min.css"; /> + + + + +https://ffmpeg.org/favicon.ico"; /> + + + + + + + + + https://ffmpeg.org/img/ffmpeg3d_white_20.png"; alt="FFmpeg" /> + FFmpeg + + https://ffmpeg.org/about.html";>About + https://ffmpeg.org/index.html#news";>News + https://ffmpeg.org/download.html";>Download + https://ffmpeg.org/documentation.html";>Documentation + https://ffmpeg.org/contact.html#MailingLists";>Community + + https://ffmpeg.org/contact.html#MailingLists";>Mailing Lists + https://ffmpeg.org/contact.html#IRCChannels";>IRC + https://ffmpeg.org/contact.html#Forums";>Forums + https://ffmpeg.org/bugreports.html";>Bug Reports + http://trac.ffmpeg.org";>Wiki + + + Developers + + https://ffmpeg.org/download.html#get-sources";>Source Code + FATE + http://coverage.ffmpeg.org";>Code Coverage + + + More + + https://ffmpeg.org/donations.html";> + Donate + https://ffmpeg.org/consulting.html";>Hire Developers + https://ffmpeg.org/contact.html";>Contact + https://ffmpeg.org/security.html";>Security + https://ffmpeg.org/legal.html";>Legal + + + + + + + + + +EOF +} + +sub head3 { +print < + + +EOF +} + +sub footer { +print < + + + +https://ffmpeg.org/js/jquery.min.js";> +https://ffmpeg.org/js/bootstrap.min.js";> + + + + \$("#menu-toggle").click(function(e) { + e.preventDefault(); + \$("#wrapper").toggleClass("active"); + }); + + + + + EOF } sub fail { my ($msg) = @_; print "Content-type: text/html\r\n\r\n"; -doctype; +print "\n"; start 'html', xmlns => "http://www.w3.org/1999/xhtml";; start 'head'; tag 'meta', 'http-equiv' => "Content-Type", diff --git a/fate.css b/fate.css index 3a83511..cd73f6b 100644 --- a/fate.css +++ b/fate.css @@ -1,5 +1,6 @@ /* * Copyright (c) 2011 Mans Rullgard + * Copyright (c) 2014 Tiancheng "Timothy" Gu * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,41 +15,38 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -table { -border-collapse: collapse; -} - -th { -background: #ccc; -padding: 0.5em; -} - .recent { font-weight: bold; } .ancient { color: #888; } -.fail { background: #e44; } -.pass { background: #5e5; } -.warn { background: #ff3; } +.fail { +background: #d9534f !important; +color: white; +} +.pass { +background: #5cb85c !important; +color: white; +} +.warn { +background: #ecd046 !important; +color: black; +} -.alert { color: #911; } +.fate-alert { color: #911; } .rejoice { color: #191; } #failometer { padding: 0; } -#failometer span { -display: inline-block; +#failometer .progress { +border-bot
Re: [FFmpeg-devel] [PATCH 2/7] avformat/hlsenc: make the code easier to read
On Wed, Jul 30, 2014 at 10:25:45AM +0200, Nicolas Martyanoff wrote: > On 2014-07-29 16:15, Michael Niedermayer wrote: > > On Fri, Jul 18, 2014 at 10:57:42AM +0200, Nicolas Martyanoff wrote: > > > Before adding new features, I read the code and cleaned it. The main > > > issue was > > > abstruse identifier names. > > > > > > The behaviour of the muxer is *not* modified, by this patch, this is only > > > cosmetic. If this is not the case, it is a mistake. > > > --- > > > libavformat/hlsenc.c | 360 > > > ++- > > > 1 file changed, 213 insertions(+), 147 deletions(-) > > > > This should be ok if you add yourself to MAINTAINERs for hlsenc, > > that is you volunteer to maintain hlsenc. > > > > Otherwise i think its better if we avoid large cosmetic changes so > > merges from any forks stay easy and non conflicting > > Hi Michael, > > I would be happy to help if bugs are found or if new features have to be > added, but I am not sure I have the time to commit to officially maintaining > the module. > > Would that be satisfying ? ok, ive split and applied some parts of the patch. Iam happy to apply the rest too, if you want and split it cleanly But we then might need help in integrating changes that are based on the pre-cleanup version. (I dont know if anyone / any fork will ignore the cleanup and work on top of the old code or not). Alternatively we of course could in that case revert the cleanup if it causes conflicts ... also, "I would be happy to help if bugs are found or if new features have to be added" <--- thats pretty much what maintainership is about and also reviewing patches, but there havnt been that many patches for hlsenc IIRC So maybe you want to add yourself to MAINTAINERs anyway ? You can always post a patch to remove yourself again if you loose interrest. Thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc: add very basic libcdio documentation
Am Mittwoch 30 Juli 2014, 01:53:32 schrieb Gerion Entrup: > --- > doc/indevs.texi | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/doc/indevs.texi b/doc/indevs.texi > index 4ca12ff..e0e7e67 100644 > --- a/doc/indevs.texi > +++ b/doc/indevs.texi > @@ -483,6 +483,21 @@ ffplay -f lavfi > "movie=test.avi[out0];amovie=test.wav[out1]" > > @end itemize > > +@section libcdio > + > +Audio-CD input device based on cdio. > + > +To enable this input device during configuration you need libcdio > +installed on your system. > + > +This device allows playing and grabbing from an Audio-CD. > + > +For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0, > +you may run the command: > +@example > +ffmpeg -f libcdio -i /dev/sr0 cd.wav > +@end example > + > @section libdc1394 > > IIDC1394 input device, based on libdc1394 and libraw1394. If you apply this patch, please use my t-online address. cheers, Gerion ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] FFmpeg OPW
On Mon, 28 Jul 2014 17:46:33 -0400, Reynaldo H. Verdejo Pinochet wrote: > Once posted, it would be great if you can set aside 2 minutes to > tweet/blogpost/whatever about it so it gets noticed. We need all the > $ help we can get. I mentioned this at https://twitter.com/FFmpeg Lou ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc: add very basic libcdio documentation
On Thu, Jul 31, 2014 at 01:14:30AM +0200, Gerion Entrup wrote: > Am Mittwoch 30 Juli 2014, 01:53:32 schrieb Gerion Entrup: > > --- > > doc/indevs.texi | 15 +++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/doc/indevs.texi b/doc/indevs.texi > > index 4ca12ff..e0e7e67 100644 > > --- a/doc/indevs.texi > > +++ b/doc/indevs.texi > > @@ -483,6 +483,21 @@ ffplay -f lavfi > > "movie=test.avi[out0];amovie=test.wav[out1]" > > > > @end itemize > > > > +@section libcdio > > + > > +Audio-CD input device based on cdio. > > + > > +To enable this input device during configuration you need libcdio > > +installed on your system. > > + > > +This device allows playing and grabbing from an Audio-CD. > > + > > +For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0, > > +you may run the command: > > +@example > > +ffmpeg -f libcdio -i /dev/sr0 cd.wav > > +@end example > > + > > @section libdc1394 > > > > IIDC1394 input device, based on libdc1394 and libraw1394. > > If you apply this patch, please use my t-online address. ok, applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] dict.c: minor simplification.
On Wed, Jul 30, 2014 at 08:38:05PM +0200, Reimar Döffinger wrote: > Signed-off-by: Reimar Döffinger > --- > libavutil/dict.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Asymptotically faster algorithms should always be preferred if you have asymptotical amounts of data signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] lavfi: add filter metaframes infrastructure.
On Wed, Jul 30, 2014 at 11:44:46PM +0200, Nicolas George wrote: > Metaframes are frames without data, identified by a negative > format code, used to carry special conditions. > They are sent only to filter that declare supporting them. > The only metaframe for now is EOF; this mechanism augments > the current mechanism based on request_frame() returning > AVERROR_EOF, with the advantage that the EOF metaframe carries > a timestamp. > The metaframes are a purely internal API and do not leak to > the application. > > Signed-off-by: Nicolas George > --- > libavfilter/avfilter.c | 73 > +- > libavfilter/internal.h | 34 +++ > 2 files changed, 100 insertions(+), 7 deletions(-) > > > Changed the name to "metaframes". > Allocate the frame with the classic method. > > > diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c > index 7b11467..7894173 100644 > --- a/libavfilter/avfilter.c > +++ b/libavfilter/avfilter.c > @@ -346,15 +346,16 @@ int ff_request_frame(AVFilterLink *link) > ret = link->srcpad->request_frame(link); > else if (link->src->inputs[0]) > ret = ff_request_frame(link->src->inputs[0]); > -if (ret == AVERROR_EOF && link->partial_buf) { > -AVFrame *pbuf = link->partial_buf; > -link->partial_buf = NULL; > -ret = ff_filter_frame_framed(link, pbuf); > -} > if (ret < 0) { > +if (!link->frame_requested) { > +av_assert0(ret == AVERROR_EOF); > +ret = 0; > +} > link->frame_requested = 0; > -if (ret == AVERROR_EOF) > -link->closed = 1; > +if (ret == AVERROR_EOF) { > +ret = ff_filter_link_close(link, AV_NOPTS_VALUE); > +return ret < 0 ? ret : AVERROR_EOF; > +} > } else { > av_assert0(!link->frame_requested || > link->flags & FF_LINK_FLAG_REQUEST_LOOP); > @@ -1132,10 +1133,52 @@ static int ff_filter_frame_needs_framing(AVFilterLink > *link, AVFrame *frame) > return ret; > } > > +static int ff_filter_metaframe(AVFilterLink *link, AVFrame *frame) > +{ > +AVFrame *pbuf = link->partial_buf; > +int ret; ret needs to be initialized to 0 here (this was what caused tha swr failures i belive) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel