Re: [FFmpeg-devel] [PATCH] avformat/flvdec: added support for KUX container
On Tue, Mar 26, 2019 at 00:24:40 +0100, Carl Eugen Hoyos wrote: > > Fixes ticket #4519. > I will push this if there are no objections. While trying to see if the proposed XV demuxer[1] can be simplified, I tripped over the fact that this KUX patch introduces a new demuxer for what looks like "only" a minor variant of FLV. Could the patch not just as well extend the flv probe and the extension list? Of course, this would need to be implemented differently (perhaps a flag within the Class?): > if(!strcmp(s->iformat->name, "kux")) Or is the difference between "a variant" and "a demuxer of its own" too small to justify the former? Just wondering. And I personally would have only bumped micro, not minor, but that's just a gut feeling, I haven't checked what is usually done. Cheers, Moritz P.S.: I will subsequently propose a similar initial XV patch. Either as this KUX patch does, or as I suggested above. [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/241483.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/flvdec: added support for KUX container
On more remark: On Tue, Mar 19, 2019 at 22:41:32 +0530, swarajhota...@gmail.com wrote: > +static int kux_probe(AVProbeData *p) I get a warning if this isn't declared "const AVProbeData *p". Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/flvdec: added support for KUX container
On Tue, Mar 26, 2019 at 11:22:58 +0100, Carl Eugen Hoyos wrote: > > While trying to see if the proposed XV demuxer[1] can be simplified, I > > tripped over the fact that this KUX patch introduces a new demuxer for > > what looks like "only" a minor variant of FLV. Could the patch not just > > as well extend the flv probe and the extension list? > > What would be the advantage? Not exploding the list of supported formats by many minor subvariants. (It seems KUX is 99% FLV, with a different header tag and an offset.) I know it's a special example, but imagine "mov,mp4,m4a,3gp,3g2,mj2" implemented as six separate formats, six separate probes, ... Just my $0.02. > Minor is what is usually done for a new demuxer. Okay, I will do so for XV as well. Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] ffmpeg: add -drop_deviant_frames option
On Wed, Mar 27, 2019 at 18:05:32 +0530, Gyan wrote: > +@item -drop_deviant_frames (@emph{input,per-stream}) > +Allows discarding decoded frames whose parameters differ from initialized > +stream parameters. May be useful in > + It looks like this was truncated. Moritz Cheers, ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 4/4] lavc/qsvenc_h264: remove the privite option trellis
On Wed, Mar 27, 2019 at 20:51:47 +0800, Zhong Li wrote: > Just simply remove the private option, and switch to the AVCodecContext > definition. Compatibility should not a big problem (expect can't exact map) > since the option name is same as AVCodecContext. You should probably bump libavcodec's micro version if the option mapping changes. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Fixed corrupt segment video files when using hls_init_time option.
On Thu, Mar 28, 2019 at 16:48:51 -0700, Laszlo Kovacs wrote: > (P.S. I hope this text will be the body and not the subject :) ) > --- > libavformat/hlsenc.c | 5 +++-- This time, the text is in the correct position. ;-) (Yes, you need an empty line between what lands in the subject and what lands in the body. But your P.S. remark belongs below the "---" line, and not into the commit message. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/libaomenc: fix default value for row-mt option
On Sat, Mar 30, 2019 at 16:50:52 +0530, Gyan wrote: > And what are the semantics of the user setting row_mt or enable-intrabc > as -1? The user doesn't set -1, they set 0 or 1 as bool. -1 helps to indicate that nothing was set, and - in these cases - falls back to not setting anything in the libary interface and choosing its own default. In other words, -1 helps to avoid setting a default in the options definition. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v5] lavf/flv: Add XV (Xunlei Video) Support. Fixes ticket #3720
Some minor nitpicking remarks from me: > Subject: [PATCH] lavf/flv: Add XV (Xunlei Video) Support. Fixes ticket #3720. Basically, the second sentence belongs into the body of the commit message, after a single empty line separator. (It may not matter here.) > Changelog| 1 + > libavformat/Makefile | 1 + > libavformat/allformats.c | 1 + > libavformat/flvdec.c | 85 You could also add a documentation entry for xv, referring to the flv doc. That would be in doc/demuxers.texi. (Can be added later, IMO.) > +if (d[0] == 'X' && > +d[1] == 'L' && > +d[2] == 'V' && > +d[3] == 'F') { Question to the other core developers: Is there any preference for this style of code over: if (AV_RL32(d) == MKTAG('X', 'L', 'V', 'F') which some other probes use? (flv rightly doesn't use the latter style, because d[3] is variable.) > +return AVPROBE_SCORE_EXTENSION + 1; I believe Carl Eugen asked you to change this to: AVPROBE_SCORE_EXTENSION / 2 + 1 > +if (!strcmp(s->iformat->name , "xv")) { > +for (i=0; i < FFMIN(2,fileposlen); i++) { i = 0 (whitespace around all operators) > +}; > \ No newline at end of file You should also consider adding a newline at the end of the last line. If this works (I haven't tested): Nice improvement versus your first patch! Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v5] lavf/flv: Add XV (Xunlei Video) Support. Fixes ticket #3720
On Tue, Apr 09, 2019 at 20:45:41 +0530, Shivam Goyal wrote: > > I believe Carl Eugen asked you to change this to: > > AVPROBE_SCORE_EXTENSION / 2 + 1 > Carl Eugen suggested me to change to AVPROBE_SCORE_MAX /2 +1 Ah, sorry, my bad - I missed that. Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [GSOC] [PATCH] avfilter: add panorama filter
On Sat, Apr 13, 2019 at 15:50:14 +0300, Eugene Lyapustin wrote: > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/vf_panorama.c | 637 ++ The documentation in doc/filters.texi also needs to be amended. > +static const AVOption panorama_options[] = { > +{"input", "set input projection", OFFSET(in), > AV_OPT_TYPE_INT, {.i64=EQUIRECTANGULAR}, 0,NB_PROJECTIONS-1, FLAGS, > "in" }, > +{"e", "equirectangular", 0, > AV_OPT_TYPE_CONST, {.i64=EQUIRECTANGULAR}, 0, 0, FLAGS, > "in" }, > +{ "c6x1", "cubemap", 0, > AV_OPT_TYPE_CONST, {.i64=CUBEMAP_6_1}, 0, 0, FLAGS, > "in" }, > +{ "c3x2", "cubemap", 0, > AV_OPT_TYPE_CONST, {.i64=CUBEMAP_3_2}, 0, 0, FLAGS, > "in" }, These two options should get differing descriptions. (BTW, though others may hate it, I find this formatting very well readable!) > +static inline int equal(double a, double b, double epsilon) > +{ > +return fabs(a - b) < epsilon; > +} > + > +static inline int smaller(double a, double b, double epsilon) > +{ > +return ((a - b) < 0.0) && (!equal(a, b, epsilon)); > +} If something comparable doesn't already exist, these could become macros similar to FF_MAX/MIX et.al. > +if (face == BACK) { [...] > +} else if (face == LEFT) { [...] > +} else if (face == FRONT) { [...] What about switch/case? Just wondering. > +} else { > +; > +} I'm not sure an empty else should be expressed. ;-) (Both previous comments are valid for various sections in the code.) I don't understand most of the code, so no further comments from me. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Add RTMFP support with librtmfp library
On Fri, Apr 19, 2019 at 19:20:50 +0200, Thomas Jammet wrote: > @@ -6189,6 +6192,7 @@ enabled libopus && { > enabled libpulse && require_pkg_config libpulse libpulse > pulse/pulseaudio.h pa_context_new > enabled librsvg && require_pkg_config librsvg librsvg-2.0 > librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo It looks like your mail client automatically wrapped the lines of the patch, which will not allow it to be applied. You need to reconfigure your mailer, or attach the patch (or use git send-email). > +@item rtmfp_socketReceiveSize CamelCase options aren't accepted by the project, AFAIU. > +(Only with @code{rtmfp_negtroup}) Try to play an RTMFP unicast stream url ^ You nicely misspelled this option reference six times (thanks to copy/paste, likely). ;-) > +(Only with @code{rtmfp_negtroup}) Specifies the maximum number (-1) of > +peers to which we will send push fragments. Does -1 mean no maximum? Or what does it mean here? > OBJS-$(CONFIG_LIBRTMPTE_PROTOCOL)+= librtmp.o > +OBJS-$(CONFIG_LIBRTMFP_PROTOCOL) += librtmfp.o > OBJS-$(CONFIG_LIBSMBCLIENT_PROTOCOL) += libsmbclient.o This is not quite the correct alphabetical order. > +typedef struct LibRTMFPContext { > +const AVClass* class; > +RTMFPConfig rtmfp; > +unsigned intid; > +int audioUnbuffered; > +int videoUnbuffered; > +int p2pPublishing; > +char* peerId; > +char* publication; > +unsigned short streamId; > +const char* swfUrl; > +const char* app; > +const char* pageUrl; > +const char* flashVer; > +const char* host; > +const char* hostIPv6; The asterisks attach to the variable, not the type. And ffmpeg doesn't use CamelCase for regular variables. > +static void onStatusEvent(const char* code, const char* description) { > + av_log(NULL, AV_LOG_INFO, "onStatusEvent : %s - %s\n", code, description); > +} This should get a log context. > +int res = 0; > + > +res = RTMFP_Write(ctx->id, buf, size); The first assignment is redundant. > +int res = 0; > + > +res = RTMFP_Read(ctx->streamId, ctx->id, buf, size); Same here. > +return (res < 0)? AVERROR_UNKNOWN : res; Can you not find a better error code? > +{"audioUnbuffered", "Unbuffered audio mode (default to false)", > OFFSET(audioUnbuffered), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, > DEC|ENC}, > +{"videoUnbuffered", "Unbuffered video mode (default to false)", > OFFSET(videoUnbuffered), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, > DEC|ENC}, These defaults usually don't need to be documented here (ffmpeg -h does that for you). > +{"netgroup", "Publish/Play the stream into a NetGroup > (multicast)", OFFSET(netgroup), AV_OPT_TYPE_STRING, {.str = NULL }, 0, > 0, DEC|ENC}, The description makes it sound like a boolean. What does this parameter actually expect? > +{"pushLimit", "Specifies the maximum number (-1) of peers to > which we will send push fragments", OFFSET(pushLimit), > AV_OPT_TYPE_INT, {.i64 = 4 }, 0, 255, DEC|ENC}, I still don't understand the "-1". And try to avoid the "we". (Yes, I know passive form is sometimes considered weird in English.) > +{"updatePeriod", "Specifies the interval in milliseconds between > messages sent to peers informating them that the local node has new > p2p multicast media fragments available", I believe the description should be shorter. (You can additionally save some by dropping the "specifies", as each parameter specifies something by nature.) This was likely not complete, and no technical review though, sorry. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] libavformat: forced PCR pid in mpegts muxer
On Tue, Apr 23, 2019 at 11:15:40 +, Andreas Håkon wrote: Nits: > Subject: libavformat: forced PCR pid in mpegts muxer "libavformat/mpegtsenc: allow to force the PID carrying the PCR" (or something along those lines) > By default FFmpeg selects the first video stream, or the first one in > the service if no video stream is found. This could also go into the documentation, if it doesn't already say so somewhere. > All then the output audio stream (with pid:202) will host the PCR marks. "All then the"? > +Override the pid for carring the PCR clock. ^ Typo: carrying Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] libavformat: forced PCR pid in mpegts muxer
On Tue, Apr 23, 2019 at 12:03:11 +, Andreas Håkon wrote: > In addition, one correction regarding the initialization. > Sorry, but first version has an error. This is clean! I had seen that the option got initialized to 0x, but checked that that is never a legally assigned pid (there's a "< 16" check somewhere), so figured it would be okay as a default. > ts_st->discontinuity = ts->flags & MPEGTS_FLAG_DISCONT; > -/* update PCR pid by using the first video stream */ > -if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && > -service->pcr_pid == 0x1fff) { > +/* update PCR pid by: forced pid or using the first video stream */ > +if ((ts->pcr_forced_pid != 0x0010 && ts_st->pid == > ts->pcr_forced_pid) || > +(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && > service->pcr_pid == 0x1fff)) { > service->pcr_pid = ts_st->pid; Okay if pid 0x0010 shall actually never carry the PCR. (Probably 0x0010-0x001F if I guess by Wikipedia's list of PIDs properly, but then, the article isn't very well written for my understanding, and I have no idea about PIDs.) Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_lut3d: increase MAX_LEVEL
On Thu, Apr 25, 2019 at 14:57:25 +0200, Paul B Mahol wrote: > Found 65x65x65 3D LUT in wild [...] > /* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT > * of 512x512 (64x64x64) */ > -#define MAX_LEVEL 64 > +#define MAX_LEVEL 65 You may also want to fix the values in the comment right above. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] lavfi: add gblur_opencl filter
On Thu, Apr 25, 2019 at 22:41:49 +1000, Dylan Fernando wrote: > +static const AVOption gblur_opencl_options[] = { > +{ "sigma", "set horizontal size", OFFSET(sigma), AV_OPT_TYPE_FLOAT, > {.dbl=0.5}, 0.0, 1024, FLAGS }, ^ Shouldn't this be "set sigma"? > +{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, > {.i64=0xF}, 0, 0xF, FLAGS }, > +{ "sigmaV", "set vertical sigma", OFFSET(sigmaV), AV_OPT_TYPE_FLOAT, > {.dbl=-1}, -1, 1024, FLAGS }, > +{ NULL } Please also add documentation to doc/filters.texi. You could do this by reference to the "gblur" filter, but as this filter's options are slightly different, you will need to copy the relevant sections. Furthermore, CamelCase variables aren't usually accepted for ffmpeg own variables, but this mirrors the gblur filter, so - oh well. > +matrix_horiz = av_malloc(matrix_bytes_horiz); > +if (!matrix_horiz) { > +av_freep(&matrix_horiz); If av_malloc() returned 0/NULL, does it ever need to be freed??? > +matrix_vert = av_malloc(matrix_bytes_vert); > +if (!matrix_vert) { > +av_freep(&matrix_vert); Ditto I can't judge on the rest. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avfilter: add bilateral filter
Hi Paul, On Sun, Apr 28, 2019 at 16:42:45 +0200, Paul B Mahol wrote: Cosmetic nits: > +Alowed range is from 1 to 6. ^ Allowed > +Alowed range is from 2 to 256. ^ Ditto. > +float *bbufers[256]; ^ I'm not sure of the intent, but would this be "buffers" or "bbuffers"? > +static float lut_lookup(const float *lut, const int val1, const int val2) > +{ > +return lut[val1 > val2 ? val1 - val2 : val2 - val1]; FFABS() may help for readability. I can't judge on the rest, as always. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] lavfi: add gblur_opencl filter
On Tue, Apr 30, 2019 at 15:45:23 +0200, Paul B Mahol wrote: > On 4/30/19, Dylan Fernando wrote: > > > > Anyone have any feedback? > > If I'm not mistaken there is already one available. Dylan did post a v2 of this patch (with changes made to those things I commented on), but unfortunately posted this question in reply to v1. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2] avfilter/f_realtime: add option to scale speed
--- doc/filters.texi | 8 libavfilter/f_realtime.c | 7 +-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index cd82869849..2f9333c3f3 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -21136,6 +21136,14 @@ They accept the following options: @item limit Time limit for the pauses. Any pause longer than that will be considered a timestamp discontinuity and reset the timer. Default is 2 seconds. +@item speed +Speed factor for processing. The value must be a float larger than zero. +Values larger than 1.0 will result in faster than realtime processing, +smaller will slow processing down. The @var{limit} is automatically adapted +accordingly. Default is 1.0. + +A processing speed faster than what is possible without these filters cannot +be achieved. @end table @anchor{select} diff --git a/libavfilter/f_realtime.c b/libavfilter/f_realtime.c index 171c16..6fd3559dac 100644 --- a/libavfilter/f_realtime.c +++ b/libavfilter/f_realtime.c @@ -22,11 +22,13 @@ #include "libavutil/time.h" #include "avfilter.h" #include "internal.h" +#include typedef struct RealtimeContext { const AVClass *class; int64_t delta; int64_t limit; +double speed; unsigned inited; } RealtimeContext; @@ -36,7 +38,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) RealtimeContext *s = ctx->priv; if (frame->pts != AV_NOPTS_VALUE) { -int64_t pts = av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q); +int64_t pts = av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q) / s->speed; int64_t now = av_gettime_relative(); int64_t sleep = pts - now + s->delta; if (!s->inited) { @@ -44,7 +46,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) sleep = 0; s->delta = now - pts; } -if (sleep > s->limit || sleep < -s->limit) { +if (FFABS(sleep) > s->limit / s->speed) { av_log(ctx, AV_LOG_WARNING, "time discontinuity detected: %"PRIi64" us, resetting\n", sleep); @@ -65,6 +67,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM static const AVOption options[] = { { "limit", "sleep time limit", OFFSET(limit), AV_OPT_TYPE_DURATION, { .i64 = 200 }, 0, INT64_MAX, FLAGS }, +{ "speed", "speed factor", OFFSET(speed), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, DBL_MIN, DBL_MAX, FLAGS }, { NULL } }; -- 2.14.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2] avcodec: add realtime bitstream filter
Works for video and audio streams. Similar to the "-re" option in ffmpeg, but unlike that option does not only work for input files, and is not only implemented for the command line tool. This filter is available through the libraries, and unlike the "realtime" filter also works when using the "copy" encoder. Implementation mostly taken from libavfilter/f_realtime.c. --- doc/bitstream_filters.texi | 24 +++ libavcodec/Makefile| 1 + libavcodec/bitstream_filters.c | 1 + libavcodec/realtime_bsf.c | 93 ++ 4 files changed, 119 insertions(+) create mode 100644 libavcodec/realtime_bsf.c diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 25bbf8372b..18ddb2e52b 100644 --- a/doc/bitstream_filters.texi +++ b/doc/bitstream_filters.texi @@ -599,6 +599,30 @@ Set Rec709 colorspace for each frame of the file ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov @end example +@section realtime + +Slow down output processing to match real time approximately. + +This bitstream filter will pause the filtering for a variable amount of time +to match the output rate with the input timestamps. It is similar to the +@option{re} option to @code{ffmpeg}. + +It accepts the following options: + +@table @option +@item limit +Time limit for the pauses. Any pause longer than that will be considered +a timestamp discontinuity and reset the timer. Default is 2 seconds. +@item speed +Speed factor for processing. The value must be a float larger than zero. +Values larger than 1.0 will result in faster than realtime processing, +smaller will slow processing down. The @var{limit} is automatically adapted +accordingly. Default is 1.0. + +A processing speed faster than what is possible without this bitstream +filter cannot be achieved. +@end table + @section remove_extra Remove extradata from packets. diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f37135fc07..83f143922f 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1094,6 +1094,7 @@ OBJS-$(CONFIG_MPEG2_METADATA_BSF) += mpeg2_metadata_bsf.o OBJS-$(CONFIG_NOISE_BSF) += noise_bsf.o OBJS-$(CONFIG_NULL_BSF) += null_bsf.o OBJS-$(CONFIG_PRORES_METADATA_BSF)+= prores_metadata_bsf.o +OBJS-$(CONFIG_REALTIME_BSF) += realtime_bsf.o OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o OBJS-$(CONFIG_TEXT2MOVSUB_BSF)+= movsub_bsf.o OBJS-$(CONFIG_TRACE_HEADERS_BSF) += trace_headers_bsf.o diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c index 463003966a..741a240380 100644 --- a/libavcodec/bitstream_filters.c +++ b/libavcodec/bitstream_filters.c @@ -49,6 +49,7 @@ extern const AVBitStreamFilter ff_mov2textsub_bsf; extern const AVBitStreamFilter ff_noise_bsf; extern const AVBitStreamFilter ff_null_bsf; extern const AVBitStreamFilter ff_prores_metadata_bsf; +extern const AVBitStreamFilter ff_realtime_bsf; extern const AVBitStreamFilter ff_remove_extradata_bsf; extern const AVBitStreamFilter ff_text2movsub_bsf; extern const AVBitStreamFilter ff_trace_headers_bsf; diff --git a/libavcodec/realtime_bsf.c b/libavcodec/realtime_bsf.c new file mode 100644 index 00..b9abda90a4 --- /dev/null +++ b/libavcodec/realtime_bsf.c @@ -0,0 +1,93 @@ +/* + * Realtime filter + * Copyright (c) 2015 Nicolas George + * Copyright (c) 2018 Moritz Barsnick + * + * 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/time.h" +#include "libavutil/opt.h" +#include "avcodec.h" +#include "bsf.h" +#include + +typedef struct RealtimeContext { +const AVClass *class; +int64_t delta; +int64_t limit; +double speed; +unsigned inited; +} RealtimeContext; + +static int realtime_filter(AVBSFContext *bsf, AVPacket *pkt) +{ +int ret; +RealtimeContext *ctx = bsf->priv_data; + +ret = ff_bsf_get_packet_ref(bsf, pkt); +if (ret < 0) +return ret; + +if (pkt->pts != AV_NOPTS_VALUE) { +int64_t pts = av_rescale_q(pkt->pts, bsf->time_base_in, AV_TIME
Re: [FFmpeg-devel] [PATCH] avfilter/f_realtime: add option to scale speed
On Tue, Apr 30, 2019 at 22:13:13 +0200, Paul B Mahol wrote: > > This adds two double precision divisions per frame, which seems acceptable. > > What is status of this patch? While contemplating over it, I apparently got over it. V2 posted. Retained the automatic sleep adjustment. Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec: add realtime bitstream filter
On Wed, May 01, 2019 at 12:03:41 -0300, James Almer wrote: > > +if (pkt->pts != AV_NOPTS_VALUE) { > > +int64_t pts = av_rescale_q(pkt->pts, bsf->time_base_in, > > AV_TIME_BASE_Q) / ctx->speed; > > +int64_t now = av_gettime_relative(); > > +int64_t sleep = pts - now + ctx->delta; > > +if (!ctx->inited) { > > +ctx->inited = 1; > > +sleep = 0; > > +ctx->delta = now - pts; > > If this is meant to be used for input, where seeking can take place, > wouldn't a flush() callback to set ctx->inited and ctx->delta back to 0 > be needed? Interesting point. I suppose you mean backward seeking. Is that a valid use case for a bitstream filter? Would it also apply to the standard filter, where I took this code from? I don't know, but I can try to add that, if required. Can you tell me how to emulate or test seeking from the command line? Would I create a file with backward jumps in PTS (and how)? I also missed to bump libavcodec version, or to at least mention it, BTW. Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v7] lavf/flv: Add XV (Xunlei Video) Support. Fixes ticket #3720
On Thu, May 02, 2019 at 10:33:41 +0530, shi...@iitk.ac.in wrote: A minor nitpick (which the person pushing will/should notice): > #define LIBAVFORMAT_VERSION_MAJOR 58 > -#define LIBAVFORMAT_VERSION_MINOR 27 > +#define LIBAVFORMAT_VERSION_MINOR 28 > #define LIBAVFORMAT_VERSION_MICRO 103 When bumping MINOR, you need to reset MICRO to 100. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [DECISION] scaletempo filter
On Sat, May 04, 2019 at 15:10:03 +0100, John Warburton wrote: > Is there a patch I can use to test scaletempo to compare it against atempo? You can see the patch and follow the discussion here. The patch is at the bottom (also available in raw form as download): https://patchwork.ffmpeg.org/patch/6513/ Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avfilter/f_realtime: add option to scale speed
On Sat, May 04, 2019 at 16:19:13 +0200, Paul B Mahol wrote: > > +{ "speed", "speed factor", OFFSET(speed), AV_OPT_TYPE_DOUBLE, { .dbl = > > 1.0 }, DBL_MIN, DBL_MAX, FLAGS }, > > Why is this allowed to be negative? In my reading (and intent), it's forbidden to be negative. Both min and max are macros representing positives. I don't own a standard, but web sources tell me DBL_MIN is the "minimum, normalized, positive value of [type] double", e.g. https://en.cppreference.com/w/c/types/limits Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec: add realtime bitstream filter
On Fri, May 03, 2019 at 23:47:47 -0300, James Almer wrote: > The flush() callback exists to reset the bsf into its initial state > without the need to destroy and recreate the context. > For example, some decoders auto-insert certain bitstream filters that [...] > avcodec_flush_buffers(), which must be called every time seeking needs > to be done in a decoding scenario, flushes both the decoder and said > bitstream filters. Thanks for the explanation! > I guess the simplest way would be to auto insert this bsf into some > decoder (AVCodec.bsfs string), then seek using some libavcodec based > application that doesn't already decodes at realtime. It doesn't sound simple, but I'll try to construct a test and fix the code. Meanwhile, this version of the patch is withdrawn. Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] libavutil: add an FFT & MDCT implementation
On Mon, May 06, 2019 at 02:23:26 +0200, Lynne wrote: > This allowed for the exptabs to be computed just once on startup and > stored in a global array. I have no real understanding of this, but: Would there be a desire for a static implementation as well, for those using "-enable-hardcoded-tables" (CONFIG_HARDCODED_TABLES)? Just wondering whether that's esoteric, optional, or really nice to have. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] libavutil: add an FFT & MDCT implementation
On Tue, May 07, 2019 at 01:33:08 +0200, Lynne wrote: > May 6, 2019, 11:41 PM by barsn...@gmx.net: > > Would there be a desire for a static implementation as well, for those > > using "-enable-hardcoded-tables" (CONFIG_HARDCODED_TABLES)? Just > > wondering whether that's esoteric, optional, or really nice to have. > > Not really, its just nicer, saves 64 bytes per context and some time on > subsequent inits, > and might help with SIMD because more can be hardcoded into the assembly. [...] Thanks for the explanation. Such development details aren't well documented (or I have a hard time re-discovering threads where such stuff was covered). Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3 1/2] fftools/ffmpeg_filter, ffplay: Add flip support to rotation
On Mon, May 06, 2019 at 22:36:41 -0700, Jun Li wrote: > +double av_display_rotation_hflip_get(const int32_t matrix[9], int *hflip) > +{ > +int32_t m[9]; > +*hflip = 0; > +memcpy(m, matrix, sizeof(int32_t) * 9); You were asked to avoid this (at another code location though). BTW, sizeof(m) would be a better use of sizeof() here. (Or a constant for the triple but related use of "9".) > +return av_display_rotation_get(m); > +} > \ No newline at end of file Cosmetic, but please add a line feed in the last line of the file. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avfilter/xstack: set better error msg for missing layout
On Tue, May 07, 2019 at 16:26:01 +0530, Gyan wrote: > { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, > {.i64=2}, 2, INT_MAX, .flags = FLAGS }, > -{ "layout", "set custom layout", OFFSET(layout), AV_OPT_TYPE_STRING, > {.str="0_0|w0_0"}, 0, 0, .flags = FLAGS }, > +{ "layout", "set custom layout", OFFSET(layout), AV_OPT_TYPE_STRING, > {.str=NULL}, 0, 0, .flags = FLAGS }, > { "shortest", "force termination when the shortest input terminates", > OFFSET(shortest), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags = FLAGS }, Because the default is no longer self-documenting ("ffmpeg -h filter=xstack"), filters.texi should be updated to mention the default. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3] lavf/h264: add support for h264 video from Arecont camera, fixes ticket #5154
On Thu, May 09, 2019 at 07:28:20 +0530, Shivam Goyal wrote: > >> +//Extra to find the http header > >> +size = 2 * ARECONT_H264_MIME_SIZE + RAW_PACKET_SIZE; > >> +data = av_malloc(size); > >> + > >> +if (av_new_packet(pkt, size) < 0) > >> +return AVERROR(ENOMEM); > > > > memleak on error > > I have tested this on the file attached to the ticket, the error didn't > came. Please, could you tell me how to solve this error and why it came. It's a hypothetical case. You can see the memleak by code review, without the need for actually reproducing it with a real world test. You need to clean up your allocated memory in error paths as well. Please see many other places in the ffmpeg code. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] ffplay: added option always on top for video window
On Mon, May 13, 2019 at 12:54:58 +0530, Gyan wrote: > >> Since 2.0.6 it works on Windows too. > > Ping. > > Michael needs to confirm whether the build failure he had was due to his > SDL version < 2.0.5 I can at least confirm that 2.0.4, which I have installed on one machine, doesn't define this in the provided headers, and that ffmpeg doesn't build against 2.0.4 with this patch. So there should be an #ifdef SDL_WINDOW_ALWAYS_ON_TOP guard around this, and possibly around the options definition. (And the docs should mention it?) https://hg.libsdl.org/SDL/annotate/3beca914a2ad/include/SDL_video.h Not sure how Windows behaves if compiled against 2.0.5 with availability of the flag, but not the feature. ;-) [*] BTW, would this also be an option which could go into the "sdl2" output device? (I'm not happy with separate code bases for these, personally.) Moritz [*] My guess is that Windows just ignored this flag before its implementation: https://hg.libsdl.org/SDL/rev/2653833db94e ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/4] avcodec: add siren audio decoder
On Thu, May 16, 2019 at 12:51:46 +0200, Lynne wrote: > > +#define STEPSIZE0.3010299957 > > Just hardcode this in the powf call. With an appended 'f'. > > +const float scale = 1.0f; > const float scale = 1.0 / 32768; 1.0f, but it doesn't matter here, as the preprocessor reduces it to float (alledgedly). > > +s->deviation_inverse[i] = 1.f / s->standard_deviation[i]; > > Nit: 1.0 instead of 1.f No, 1.f or 1.0f. Otherwise, it promotes the division to a double precision operation before casting back to the left hand side float. (It only matters on hardware which requires double precision software emulation, but if explicitly using float, make sure to stick to float.) Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] Help: Get motion vector value from previous and next frame FFMPEG
On Wed, May 22, 2019 at 16:06:39 +0300, Boris wrote: > Apologize me if this mailing list is not for such questions. > I want help, then I think that here is the best place. No, this is exactly the wrong place. ffmpeg-devel is for discussing the development *of* the ffmpeg tools and libraries. For discussing the use of the libraries, please turn to the list libav-user: https://ffmpeg.org/mailing-list-faq.html#What-type-of-questions-can-I-ask_003f Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v4] Fix integer parameters size check in SDP fmtp line
On Wed, May 22, 2019 at 12:03:55 +0200, Olivier Maignial wrote: > In SDP provided by my RTSP server I had this fmtp line: > a=fmtp:98 streamType=5; profile-level-id=40; mode=AAC-hbr; config=1188; > sizeLength=13; indexLength=3; indexDeltaLength=3; > > In FFmpeg code, I found a check introduced by commit > 24130234cd9dd733116d17b724ea4c8e12ce097a. It disallow values greater than 32 > for fmtp line parameters. > However, In RFC-6416 (RTP Payload Format for MPEG-4 Audio/Visual Streams) > give examples of "profile-level-id" values for AAC, up to 55. > Furthermore, RFC-4566 (SDP: Session Description Protocol) do not give any > limit of size on interger parameters given in fmtp line. This explanation is much more concise than before. Thanks. Thus, understanding the intent, I can now finally comment on the code: > Using INT_MIN, LONG_MIN, INT_MAX and LON_MAX definitions ensure that it will > work whatever the size of int/long given by compiler. [...] > +long int val = strtol(value, &end_ptr, 10); According to your comment, you do realize that this depends on the compiler. I actually believe it depends mainly on the platform, but that's an academic discussion. Either way, why not support the same range regardless of compiler or platform? I.e. avoid "long int", which is sometimes 32 bits, sometimes 64. (Anything else could lead to unexpected behavior. In other words, an observation such as: "That's peculiar, my [64 bit] PC handles this stream just fine, but my [32 bit] RaspPi doesn't.") > + "Value of field %s overflow maximum integer > value.\n", Singular: "underflows". > + "Value of field %s underflow minimum integer > value.\n", Ditto. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Add -first_rtcp_ntp_time_path option to write the first NTP time to a file.
On Thu, May 23, 2019 at 16:51:16 +1200, Jonathan Viney wrote: > > The NTP time from the first RTCP packet is currently extracted in > > libavformat/rtsp.c and stored in AVFormatContext.start_time_realtime. > > However, there is no way to access this value when using ffmpeg from the > > commandline. > > > > This patch adds an option when using an RTSP input to write the value to a > > file when it is received. Is this useful for anything? Would it be more useful in a metadata key? (Just wondering, not critisizing.) > +av_strlcatf(buf, sizeof(buf), "%lld", > s->start_time_realtime); start_time_realtime is int64_t, so the format identifier should be '"%" PRIi64'. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] avformat/mpjpegdec: fix finding multipart boundary parameter
The string matching function's return value was evaluated incorrectly. Fixes trac #7920. Signed-off-by: Moritz Barsnick --- libavformat/mpjpegdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index e653b5cc93..a23469c0ec 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -271,7 +271,7 @@ static char* mpjpeg_get_boundary(AVIOContext* pb) while (av_isspace(*start)) start++; -if (!av_stristart(start, "boundary=", &start)) { +if (av_stristart(start, "boundary=", &start)) { end = strchr(start, ';'); if (end) len = end - start - 1; -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] avformat/mpjpegdec: fix strict boundary search string
According to RFC1341, the multipart boundary indicated by the Content-Type header must be prepended by CRLF + "--", and followed by CRLF. In the case of strict MIME header boundary handling, the "--" was forgotten to add. Fixes trac #7921. Signed-off-by: Moritz Barsnick --- libavformat/mpjpegdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index a23469c0ec..f145766e6e 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -306,8 +306,8 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt) boundary = mpjpeg_get_boundary(s->pb); } if (boundary != NULL) { -mpjpeg->boundary = boundary; -mpjpeg->searchstr = av_asprintf( "\r\n%s\r\n", boundary ); +mpjpeg->boundary = av_asprintf("--%s", boundary); +mpjpeg->searchstr = av_asprintf("\r\n--%s\r\n", boundary); } else { mpjpeg->boundary = av_strdup("--"); mpjpeg->searchstr = av_strdup("\r\n--"); -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 0/2] avformat/mpjpegdec: fixes for strict MIME boundary checking
The mpjpegdec option "-strict_mime_boundary 1" didn't actually work with streams strictly adhering to RFC1341. Moritz Barsnick (2): avformat/mpjpegdec: fix finding multipart boundary parameter avformat/mpjpegdec: fix strict boundary search string libavformat/mpjpegdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/7] libavfilter/vf_overlay.c: change the commands style for the macro defined function
On Fri, May 24, 2019 at 17:36:10 +0800, lance.lmw...@gmail.com wrote: > Subject: [PATCH 1/7] libavfilter/vf_overlay.c: change the commands style for > the macro defined function ^ It's not "commands", it's "comments", or "comment style". Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avformat/mpjpegdec: fix finding multipart boundary parameter
On Fri, May 24, 2019 at 11:54:20 +0200, Michael Niedermayer wrote: > LGTM > a testcase in fate would be good Thanks. Indeed, I'll work on adding a fate testcase next week (have never done so previously). There's valid input material in the as-yet unsolved ticket #5023. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avformat/mpjpegdec: fix strict boundary search string
On Fri, May 24, 2019 at 11:58:51 +0200, Michael Niedermayer wrote: > > if (boundary != NULL) { > > -mpjpeg->boundary = boundary; > > -mpjpeg->searchstr = av_asprintf( "\r\n%s\r\n", boundary ); > > +mpjpeg->boundary = av_asprintf("--%s", boundary); > > memleak Thanks for noticing. I'll post a V2 - verified with valgrind. > also a testcase would be good to have, idealy in fate Will try. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] avformat/mpjpegdec: fix strict boundary search string
According to RFC1341, the multipart boundary indicated by the Content-Type header must be prepended by CRLF + "--", and followed by CRLF. In the case of strict MIME header boundary handling, the "--" was forgotten to add. Fixes trac #7921. Signed-off-by: Moritz Barsnick --- libavformat/mpjpegdec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index a23469c0ec..f8741cc3b0 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -306,8 +306,9 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt) boundary = mpjpeg_get_boundary(s->pb); } if (boundary != NULL) { -mpjpeg->boundary = boundary; -mpjpeg->searchstr = av_asprintf( "\r\n%s\r\n", boundary ); +mpjpeg->boundary = av_asprintf("--%s", boundary); +mpjpeg->searchstr = av_asprintf("\r\n--%s\r\n", boundary); +av_freep(&boundary); } else { mpjpeg->boundary = av_strdup("--"); mpjpeg->searchstr = av_strdup("\r\n--"); -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avformat/mpjpegdec: fix strict boundary search string
On Sun, May 26, 2019 at 22:44:00 +0200, Moritz Barsnick wrote: > Subject: [FFmpeg-devel] [PATCH 2/2] avformat/mpjpegdec: fix strict boundary > search string D'uh, I told git send-email that the subject should contain "V2". I wonder why that gets ignored. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avfilter/avf_aphasemeter: Add out-of-phase and mono detection
On Mon, May 20, 2019 at 14:40:24 +0200, Romane Lafon wrote: > +float tolerance = 1.0 - s->tolerance; Strictly speaking 1.0f (or 1.f). > +float angle = cos(s->angle/180.0*PI); If you want a float as result, use cosf(s->angle / 180.f * M_PI). (I'm aware PI and M_PI aren't explicitly marked as float, but you can't have it all.) > +if (!s->is_mono && ((tolerance - fphase) < FLT_EPSILON)) { [...] > +if (s->is_mono && ((tolerance - fphase) < FLT_EPSILON) && > s->start_mono_presence) { [...] > +if (s->is_mono && ((tolerance - fphase) > FLT_EPSILON)) { [...] As tolerance and fphase are constant throughout this block of code, you could do this floating point comparison once, and reuse the boolean result. BTW, I reckon the third of those comparisons should be ">=", to properly complement the "<". > +if (!s->is_out_phase && (angle - fphase) > FLT_EPSILON) { [...] > +if (s->is_out_phase && ((angle - fphase) > FLT_EPSILON) && > s->start_out_phase_presence) { [...] > +if (s->is_out_phase && (angle - fphase) < FLT_EPSILON) { [...] Same here. > +float tolerance = 1.0 - s->tolerance; > +float angle = cos(s->angle/180.0*PI); Same as above. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder
Hi, > +during configuration. You need to explicitly configue the build with ^ configure > +Sets the maximum qauntizer (floor) to use when using bitrate mode. ^ quantizer Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3] avcodec: Add librav1e encoder
On Wed, May 29, 2019 at 19:28:24 +0100, Derek Buitenhuis wrote: > +during configuration. You need to explicitly configue the build with ^ configure > +Sets the maximum qauntizer (floor) to use when using bitrate mode. ^ quantizer > +Set rav1e options using a list of @var{key}=@var{value} couples separated I believe they're mostly referred to as "pairs", but it doesn't really matter. > +For example to specify librav1e encoding options with @option{-rav1e-params}: So are they "rav1e options" or "librav1e [encoding] options"? Just wondering. > +av_log(avctx, AV_LOG_ERROR, "Invalid width passed to rav1e.\n"); > +ret = AVERROR_INVALIDDATA; Isn't AVERROR_INVALIDDATA meant for invalid *stream* data? Not invalid options. I believe other codecs return AVERROR(EINVAL). > +av_log(avctx, AV_LOG_ERROR, "Could not set max quantizer.\n"); > +ret = AVERROR_EXTERNAL; How is this different? > +ctx->ctx = rav1e_context_new(cfg); > +if (!ctx->ctx) { > +av_log(avctx, AV_LOG_ERROR, "Failed to create rav1e encode > context.\n"); > +ret = AVERROR_EXTERNAL; This, OTOH, looks correct. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec: Add librav1e encoder
On Sun, Jun 02, 2019 at 18:46:17 +0100, Derek Buitenhuis wrote: > take at least 1-2 months. The API itself won't change. https://github.com/lu-zero/crav1e says: Status The API is far from stable Just sayin', Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3 5/5] lavfi: addroi filter
On Tue, Jun 04, 2019 at 00:19:05 +0100, Mark Thompson wrote: > This can be used to add region of interest side data to video frames. Very valuable addition for use of ROI the command line tool! > +Mark regions of interest in a video frame. Since you're using the plural, it's probably worth mentioning how to specify several regions. > +@item x > +Region distance in pixels from the left edge of the frame. Mention that it's an expression, and that it (or all four) support "iw" and "ih". > +@item qoffset > +Quantisation offset to apply within the region. > + > +Must be in the range -1 to +1. It would be nice to mention somewhere that it's a float (even though the text implies that.) > +@item clear > +Remove any existing regions of interest marked on the frame before > +adding the new one. Mention that it needs to be "1", or that it's a boolean. Overall, very well described. An example or two would be very welcome though. > +for (i = 0; i < 4; i++) { > +int max_value; > +switch (i) { I like avoiding magic numbers such as 4, and would prefer sizeof(addroi_param_names) - but that's probably just me. > +av_assert0(old_roi_size && sd->size % old_roi_size == 0); Someone recently posted a patch splitting up composite assert()s. I don't recall whether it was merged though. > +static av_cold int addroi_init(AVFilterContext *avctx) > +{ > +AddROIContext *ctx = avctx->priv; > +int i, err; > + > +for (i = 0; i < 4; i++) { Magic 4 again (also in uninit()). Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v4 1/7] vf_crop: Add support for cropping hardware frames
On Sun, Jun 02, 2019 at 17:47:24 +0100, Mark Thompson wrote: > >> Set the cropping fields in the AVFrame. > > The patchset looks fine to me. But I am not quite sure if others are happy > > with this crop patch. > > If nobody against. I think you can go pushing the patchset when you make > > sure it will not trigger build failures as reported by Michael. > > (one unnecessary empty line below, please remove it) > > All noted changes done, and tested with libva 1.3. Applied. Apparently broke all of x86_64 fate on http://fate.ffmpeg.org/, likely due to the version of libva. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffmpeg: log skipped initial non-keyframes
On Thu, Jun 06, 2019 at 22:31:45 +0200, Stephan Hilb wrote: > If `AV_PKT_FLAG_KEY` stays unset on `pkt->flags`, the output stream > stays empty with little information about what is going on. > This change makes it easier to debug the situation for the user who > could then choose to use the `-copyinkf` option. [...] > -!ost->copy_initial_nonkeyframes) > +!ost->copy_initial_nonkeyframes) { > +av_log(NULL, AV_LOG_DEBUG, "skipping initial non-keyframe\n"); > return; Incorrect indentation. More seriously: I welcome this message. There was a question on ffmpeg-user[1] recently where a user provided a file without any keyframes at all, which could be played by ffplay, but not copy-coded by ffmpeg. I suggest this message should be at INFO level, but appear only once. Unfortunately, the file said user provided is no longer available (and I have deleted my copy). I believe ffprobe also suffers from such files and never displays anyhing with -show_frames. In fact, does ffprobe perhaps always begin from, or at least wait for, the first keyframe? Cheers, Moritz [1] http://ffmpeg.org/pipermail/ffmpeg-user/2019-June/044526.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffmpeg: log skipped initial non-keyframes
On Fri, Jun 07, 2019 at 22:35:03 +0200, Stephan Hilb wrote: > > Incorrect indentation. > > It's actually the same indentation as in other places in the same file, > what would be the correct way then? Sorry, my mind went flaky, you're corrent. > > I suggest this message should be at INFO level, but appear only once. > > I'm fine with INFO level. Repeated messages get supressed anyways, does > that suffice? If it only appears once, then fine. I couldn't test (see below), so couldn't see whether this comes for every skipped frame. > > I believe ffprobe also suffers from such files and never displays > > anyhing with -show_frames. In fact, does ffprobe perhaps always begin > > from, or at least wait for, the first keyframe? > > Cannot really comment on that. For me it happens when stream copying > from v4l2, since the keyframe flag is not being set there, Probing > works just fine. Okay, I may have a look at ffprobe myself. Thanks for the v4l2 hint, I can use that to produce a sample. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vf_gblur: add x86 SIMD optimizations
On Wed, Jun 12, 2019 at 08:23:29 +, Song, Ruiling wrote: > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of Reimar D?ffinger > > Where does this license come from? > The license is from vf_gblur.c, because the code was copied from there. > If I read correctly, this is "Simplified BSD License". To me, it looks like the BSD 3-clause, a.k.a. "Modified BSD" license. Several files in ffmpeg's source tree seem to carry this license. > > Is that even GPL-compatible? According to gnu.org: Yes. > > I mean how is someone compiling ffmpeg even supposed to know > > they have to put this license text in their documentation? Good question. ffmpeg's LICENSE.md provides some license references, but is probably not meant as a template for distribution with a binary, and doesn't explicitly quote the BSD-licensed components. It does mention all GPL-licensed components, bit I assume to raise awareness for when ffmpeg is GPL and when it it LGPL - and what non-free means. IANAL, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3 2/3] libavfilter/vf_cover_rect: support for cover image with more pixel format and different width and height
On Tue, Jun 11, 2019 at 13:38:43 +0800, lance.lmw...@gmail.com wrote: > @@ -220,11 +248,6 @@ static av_cold int init(AVFilterContext *ctx) > &cover->cover_frame->width, > &cover->cover_frame->height, > &cover->cover_frame->format, > cover->cover_filename, ctx)) < 0) > return ret; > - > -if (cover->cover_frame->format != AV_PIX_FMT_YUV420P && > cover->cover_frame->format != AV_PIX_FMT_YUVJ420P) { > -av_log(ctx, AV_LOG_ERROR, "cover image is not a YUV420 image\n"); > -return AVERROR(EINVAL); > -} > } Don't you also need to update query_formats()? Just wondering, untested. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3 3/3] doc/filters.texi: Don't need to be yuv420 format for cover image
On Tue, Jun 11, 2019 at 13:38:44 +0800, lance.lmw...@gmail.com wrote: > doc/filters.texi | 2 +- While you're at it, could you kindly add another patch to fix the descriptions of the examples for find_rect and cover_rect? They are copy pasted from pallettegen, and are totally misleading: > Generate a representative palette of a given video using @command{ffmpeg}: Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] vf_drawtext: Add pkt_pos, pkt_duration, pkt_size as variables
On Wed, Jun 12, 2019 at 12:11:16 -0400, greg Luce wrote: > Ooops apologies, .patch file attached and with hopefully better line breaks Yes, but something went wrong with its contents: > Subject: [PATCH] Signed-off-by: greg Luce This doesn't look correct. It's supposed to contain Subject: vf_drawtext: Add pkt_pos, pkt_duration, pkt_size as variables and the Signed-off-by line is to be somewhere in the remaining commit message. How did you create the patch? > These parameters allow the @var{x} and @var{y} expressions to refer > -each other, so you can for example specify @code{y=x/dar}. > +to each other, so you can for example specify @code{y=x/dar}. > + > +@item pict_type > +A 1 character description of the current packet's input picture type. > + Strictly speaking, you're fixing and amending existing documentation, not related to your modifications. I personally don't mind, but others will request you to do this is a separate patch. > +@item pkt_pos > +The current packet's position in the input datastream > +(in bytes from the head of the source file). > + > +A value of -1 indicates this info is not available. A non-related question: Do you understand when this is -1? (I myself am looking for some filter or log info which can give me the pkt_pos related to a certain time offset from the beginning of a file, as when seeked using "-ss".) > +The current packet's input duration. "input duration" sounds confusing. You can likely drop the "input". > +The current packet's input size (in bytes). Ditto. I can't comment on the rest, but like the feature. You may need to bump libavfilter's MICRO version, as you are adding features. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 4/4] avcodec/fitsdec: Check data_min/max
On Thu, Jun 13, 2019 at 01:20:20 +0200, Michael Niedermayer wrote: > +if (header->data_min == header->data_max) { Just a note: Equality comparison of floats/doubles may trigger a warning. (Possibly needs to be explicitly enabled though, like with "-Wfloat-equal" on gcc.) Might be okay though nevertheless. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v4] vaapi_encode_mjpeg: fix bad component id bug
On Thu, Jun 13, 2019 at 15:41:55 +, Eoff, Ullysses A wrote: > According to comments in the gcc request, it looks like we > could use " -fsanitize=address". Anyone care to test it > out to see if it will work? The AddressSanatizer does not make this a warning at compile time (or perhaps it may, additionally), but it instruments the binary with code for analyzing and debugging address accesses, similar to valgrind: https://github.com/google/sanitizers/wiki/AddressSanitizer So this is not a permanent solution, but might be something for fate. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] set AVFrame decode_error_flags in case of decoding error by h264dec
On Thu, Jun 13, 2019 at 08:52:22 -0700, Amir Pauker wrote: > doc/APIchanges | 3 +++ > libavcodec/h264dec.c | 5 + > libavutil/frame.h| 1 + > libavutil/version.h | 2 +- You should split the introduction of the API (libavutil and doc) and the use of the API (libavcodec) into two separate patches. > +if( (ret < 0 || h->slice_ctx->er.error_occurred) && h->cur_pic_ptr){ Please fix the bracket/whitespace style: https://ffmpeg.org/developer.html#Code-formatting-conventions -> if ((ret < 0 || h->slice_ctx->er.error_occurred) && h->cur_pic_ptr) { Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 3/4] avcodec/fitsdec: Fix division be 0 in size check
On Thu, Jun 13, 2019 at 20:32:35 +0200, Michael Niedermayer wrote: > avcodec/fitsdec: Fix division be 0 in size check Nit:^ by Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/3] avcodec/qdm2: Do not read out of array in fix_coding_method_array()
On Mon, Jun 24, 2019 at 01:01:02 +0200, Michael Niedermayer wrote: > +if (sb + (j + k) / 64 > 29) { [...] > if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > > coding_method[ch][sb][j]) { You could do the "sb + (j + k) / 64]" calculation only once and reuse the result. OTOH, this code is full of magic numbers (notably 30, where your 29 derives from) which could nicely make use of macros, but don't, so it probably doesn't matter. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec: add delayer bitstream filter
On Wed, Jun 26, 2019 at 01:06:56 +0530, Gyan wrote: > Wouldn't this be better if extended to be a BSF version of setpts? In > addition to delays, rescaling as well as other ops could be carried out > on TS. I second that notion, or at least the suggestion of a setpts bsf. IMO, there is probably some functionality in filters which could be implemented in bitstream filters, to allow it to apply to stream copy. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] print pts as min:sec
On Tue, Jun 25, 2019 at 23:13:51 +0200, Ulf Zibis wrote: > is there a functionality in the ffmpeg library to print AVFrame pts > values in respect to AVRational time_base in human readable form? This list is for the development *of* ffmpeg and its libraries. For the use of the libraries and the development *with* them, please turn to the mailing list "libav-user". Regarding your request, you can look at libavfilter/vf_showinfo.c. filter_frame() has an av_log() line which should show the calculation you are looking for: av_log(ctx, AV_LOG_INFO, "n:%4"PRId64" pts:%7s pts_time:%-7s pos:%9"PRId64" " [...] av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), frame->pkt_pos, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] lavf/vf_find_rect: add the dual input support function
On Thu, Jun 27, 2019 at 10:12:35 +0800, lance.lmw...@gmail.com wrote: > +This filter takes in two video input, the first input is considered ^ inputs > +the "main" source and is passed unchanged to the output. The "second" > +input is used as a rectangular object for finding, now the "second" ^ Now? The part from "now" - once you have clarified why the word "now" belongs here - should be a separate sentence. > -ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover > new.mkv > +ffmpeg -i file.ts -newref.pgm -filter_complex > find_rect,cover_rect=cover.jpg:mode=cover new.mkv This is certainly wrong. > -ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover > new.mkv > +ffmpeg -i file.ts -newref.pgm -filter_complex > find_rect,cover_rect=cover.jpg:mode=cover new.mkv ditto If you change the options behavior of a filter, you should bump libavfilter micro version. I can't just on most of the rest of your changes. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] lavf/vf_find_rect: add the dual input support function
On Thu, Jun 27, 2019 at 09:40:22 +0200, Moritz Barsnick wrote: > I can't just on most of the rest of your changes. Whot? Meant to say: I can't judge most of the rest of your changes. M. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/4] lavd/avfoundation: Add human readable option arguments.
On Sun, Jun 30, 2019 at 14:14:13 +0200, Thilo Borgmann wrote: > -{ "capture_cursor", "capture the screen cursor", offsetof(AVFContext, > capture_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM > }, > -{ "capture_mouse_clicks", "capture the screen mouse clicks", > offsetof(AVFContext, capture_mouse_clicks), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, > AV_OPT_FLAG_DECODING_PARAM }, > +{ "capture_cursor", "capture the screen cursor", offsetof(AVFContext, > capture_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, > "capture_cursor" }, > +{ "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, > AV_OPT_FLAG_DECODING_PARAM, "capture_cursor" }, > +{ "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, > AV_OPT_FLAG_DECODING_PARAM, "capture_cursor" }, > +{ "capture_mouse_clicks", "capture the screen mouse clicks", > offsetof(AVFContext, capture_mouse_clicks), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, > AV_OPT_FLAG_DECODING_PARAM, "capture_mouse_clicks" }, > +{ "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, > AV_OPT_FLAG_DECODING_PARAM, "capture_mouse_clicks" }, > +{ "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, > AV_OPT_FLAG_DECODING_PARAM, "capture_mouse_clicks" }, Can't you just make the options AV_OPT_TYPE_BOOL? No additional consts requires. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/http: change error message from numeric code to string
On Mon, Jul 01, 2019 at 17:43:59 +0800, Steven Liu wrote: > -av_log(h, AV_LOG_ERROR, "URL read error: %d\n", read_ret); > +av_log(h, AV_LOG_ERROR, "URL read error: %s\n", > av_err2str(read_ret)); ^^ You could also drop one of the two spaces. I don't think they are meant to align anything. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avfilter: add deesser audio filter
On Sun, Jun 30, 2019 at 18:05:36 +0200, Paul B Mahol wrote: > +DeesserChannel *chan = &s->chan[i];; Duplicate semicolon. > +av_frame_copy_props(out, in); This can also return AVERROR(ENOMEM)? Everything else looks fine, with my little knowledge, incl. docs. Untested. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] lavf/vf_stack: add keep_dar option for vstack and hstack
On Mon, Jul 08, 2019 at 18:48:46 +0800, lance.lmw...@gmail.com wrote: > +@item keep_dar > +stack with 1/nb_inputs of each inputs screen to keep the same DAR, Default > is 0. ^ Probably "input's". Is screen the correct term here at all? (In three places in the patch.) > +{ "keep_dar", "stack with 1/nb_inputs of each inputs screen to keep the > same DAR", OFFSET(keep_dar), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = FLAGS > }, AV_OPT_TYPE_BOOL Not sure about the actual implementation, can't judge. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCHv4] avcodec: Add librav1e encoder
Hi, On Tue, Jul 09, 2019 at 19:34:33 +0100, Derek Buitenhuis wrote: > Port to the new send/receive API by: James Almer . Two nits: > +Sets the minimum quantizer (ceiling) to use when in bitrate mdoe. Typo -> "mode" > +av_log(avctx, AV_LOG_ERROR, "Unknown return code from > rav1e_send_frame.\n"); > +return AVERROR_UNKNOWN; Feel free to include the error code in the message, as you did in librav1e_receive_packet(). Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Add support for Display Definition Segment to DVB Subtitle
On Sat, Jul 13, 2019 at 00:24:29 +0200, mikroh...@gmail.com wrote: > From: Jernej I think you had your full name in here originally. Note that whatever you provide here will be in the repo forever. > > Patch with requested changes. Your original commit text should be in here, not your message to the mailing list. Is this really the commit message you provided when committing locally? Your original text "Current version of dvbsub encoder doesn't support HD DVB subtitles. ..." was fine, except that it was missing some line breaks. > > --- [...] Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] doc/ffmpeg.texi: update docs for autoscale/autorotate
On Mon, Jul 15, 2019 at 18:39:14 +0800, Linjie Fu wrote: Nit: > +@item -noautoscale > +Disable automatically scale video based on first frame resolution. ^ scaling Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Setup for extracting quantization parameters from encoded streams
On Wed, Jul 17, 2019 at 16:18:11 -0700, Juan De León wrote: > --- > libavfilter/vf_extractqp.c | 116 > libavutil/Makefile | 2 + > libavutil/quantization_params.c | 28 > libavutil/quantization_params.h | 98 +++ > 4 files changed, 244 insertions(+) > create mode 100644 libavfilter/vf_extractqp.c > create mode 100644 libavutil/quantization_params.c > create mode 100644 libavutil/quantization_params.h Is this just an initial proposal and a proof of concept? The side data which is supposed to come from the codecs isn't available yet. I don't see AV_FRAME_DATA_QUANTIZATION_PARAMS defined anywhere. I see no example of how to let the decoders detect the quantization and insert that side data. The "extractqp" filter apparently demonstrates how to detect availability of this side data, i.e. shows how to call av_frame_get_side_data(). It doesn't do anything useful at all though, and it isn't included in the build (or documented). Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] dash: add descriptor which is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
On Fri, Jul 19, 2019 at 11:08:00 +0800, leozhang wrote: > change history: > 1. Use normal descriptor string instead of base64 encoded > 2. Add example to muxers.texi > 3. Change descriptor char * and allocate it dynamically > > Please review, thanks Please take care, the above text has become part of the commit message but shouldn't be, so it shouldn't be pushed that way either. You need to add remarks to your emails below the '---' line: > > Signed-off-by: leozhang > --- Right here. > doc/muxers.texi | 4 > libavformat/dashenc.c | 27 +++ > 2 files changed, 27 insertions(+), 4 deletions(-) Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Setup for extracting quantization parameters from encoded streams
On Fri, Jul 19, 2019 at 10:00:52 +0200, Nicolas George wrote: > I do not judge whether this filter would be useful and should be > included, but if so, then I would appreciate that the output be done > using AVIO, so that it can go to any supported protocol. The metadata filter has a nice example of how to use avio, incl. mapping to stdout: https://github.com/FFmpeg/FFmpeg/blob/f102a4efcef33014d414f9bf4492a04feab20c82/libavfilter/f_metadata.c#L250 I suppose this can been used as a reference. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] how to create sub project / git repo under FFMPEG
On Mon, Jul 22, 2019 at 02:03:33 +, Guo, Yejun wrote: > I do not mean the official repository https://git.ffmpeg.org/ffmpeg.git, I > mean another > new repo and ffmpeg community has the right to assign/remove someone to have > the write access. [...] > thanks, I think we can create a git repo at > code.videolan.org/ffmpeg/dnn_material. Actually, http://git.videolan.org/?p=ffmpeg.git;a=summary is the official repo (or rather its visualization). Github is the secondary repo, a mirror. See this thread: http://ffmpeg.org/pipermail/ffmpeg-devel/2015-October/180844.html Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] lavc/tiff: Decode embedded JPEGs in DNG images
Even though you requested not to review: On Tue, Jul 23, 2019 at 14:51:12 +0300, velocit...@gmail.com wrote: > +#include "mjpegdec.h" Subtle hint: Try configuring and compiling ffmpeg without support for mjpeg, but with support for tiff. I think you need to add a dependency in libavcodec/Makefile. Possibly also in configure (tiff_decoder_select). Perhaps the feature could be #ifdef'd MJPEG_DECODER, but that may create a bit of a mess. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] how to create sub project / git repo under FFMPEG
On Tue, Jul 23, 2019 at 13:49:30 +, Guo, Yejun wrote: > > Actually, http://git.videolan.org/?p=ffmpeg.git;a=summary is the > > official repo (or rather its visualization). Github is the secondary > > repo, a mirror. > > thanks Moritz, do you mean that the official repo is not > https://git.ffmpeg.org/ffmpeg.git > that I mentioned, but http://git.videolan.org/?p=ffmpeg.git;a=summary? > > I got the git repo at https://ffmpeg.org/download.html#get-sources. Sorry, I mixed that up. I don't know where I got Github into the equation. In addition to what I wrote about Github vs. VideoLAN: source.ffmpeg.org is just an alias to git.videolan.org. That doesn't seem to be the case for git.ffmpeg.org. So I actually don't know what is "official", and what the reference. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] Patch for IPC SHM
On Tue, Jul 23, 2019 at 19:23:12 +, aran.clau...@wwu.edu wrote: Some style nits for a first time contributer: > +if(c->shmid != -1) { ^ Please stick to the style "if (" (whitespace). > -id = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777); > + > +id = shmget(IPC_PRIVATE, size, IPC_CREAT | 0666); Is this change required for your fix? And please don't introduce arbitrary new empty lines and such. > } > + > xcb_shm_attach(c->conn, c->segment, id, 0); Needless change, please remove. > } > > + > static int xcbgrab_frame_shm(AVFormatContext *s, AVPacket *pkt) Needless change, please remove. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v6 2/2] lavc/tiff: Decode embedded JPEGs in DNG images
On Thu, Jul 25, 2019 at 15:12:53 +0300, velocit...@gmail.com wrote: Nit: > tiff_decoder_suggest="zlib lzma" > tiff_encoder_suggest="zlib" > +tiff_decoder_select="mjpeg_decoder" > truehd_decoder_select="mlp_parser" You should pair the new decoder line with the other decoder line, not place it below the encoder. > +int is_jpeg; // 0 - Not JPEG, 1 - JPEG, 2 - New JPEG "is" makes this sound boolean, perhaps better "jpeg_type" or something like that. OTOH, I can't find the differentiation between 1 and 2 used anywhere. > +// Lookup table lookup > +if (lut) value = lut[value]; You probably need to break the line, according to ffmpeg coding rules. > +float scale_factor; > + > +scale_factor = 1.0 / (s->white_level - s->black_level); This is promoting the floating point operation to a double precision operation (significant for some platforms). Either use double variables in the first place - if the extra precision can be justified - or use the "f" suffix to the constant: "1.0f". > +ret = avcodec_receive_frame(s->avctx_mjpeg, s->jpgframe); > +if (ret < 0) { > +av_log(avctx, AV_LOG_ERROR, "JPEG decoding error (%d).\n", ret); I believe the return value can be decoded into a string, e.g. with av_err2str(). > +/* Copy the outputted tile's pixels from 'jpgframe' to to 'frame' (final > buffer */ Outputted is not a word. ;-) Don't worry about that, but there's a duplicate "to" in there, and the bracket is not closed. > +uint32_t lut_offset = value; > +uint32_t lut_size = count; > +uint32_t lut_wanted_size = 1 << s->bpp; > +if (lut_wanted_size != lut_size) > +av_log(s->avctx, AV_LOG_WARNING, "DNG contains LUT with invalid > size (%d), disabling LUT\n", lut_size); > +else if (lut_offset >= bytestream2_size(&s->gb)) > +av_log(s->avctx, AV_LOG_WARNING, "DNG contains LUT with invalid > offset (%d), disabling LUT\n", lut_offset); Nit: the proper format identifier for uint32_t is '"%" PRIu32'. ( > +} else { > +av_log(avctx, AV_LOG_ERROR, "DNG JPG-compressed > non-bayer-encoded images are not supported\n"); > +return AVERROR_PATCHWELCOME; Alternatively (to av_log()) use avpriv_report_missing_feature(). > +} > +} else if (s->is_tiled) { > +av_log(avctx, AV_LOG_ERROR, "DNG uncompressed tiled images are > not supported\n"); > +return AVERROR_PATCHWELCOME; Ditto. > +s->jpgframe = av_frame_alloc(); > +if (!s->jpgframe) > +return AVERROR(ENOMEM); > + > +/* Prepare everything needed for JPEG decoding */ > +codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG); > +if (!codec) > +return AVERROR_BUG; > +s->avctx_mjpeg = avcodec_alloc_context3(codec); > +if (!s->avctx_mjpeg) > +return AVERROR(ENOMEM); Don't you need to free s->jpgframe here? (And codec?) Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v6 1/2] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs
On Thu, Jul 25, 2019 at 15:12:52 +0300, velocit...@gmail.com wrote: > From: Nick Renieris Nit: > -if (s->nb_components != 3 && s->nb_components != 4) > +if (s->nb_components <= 0 || s->nb_components > 4) > return AVERROR_INVALIDDATA; > + > if (s->v_max != 1 || s->h_max != 1 || !s->lossless) > return AVERROR_INVALIDDATA; > > - > s->restart_count = s->restart_interval; Arbitrary addition and removal of newlines. > +if (mb_y * s->width % s->restart_interval == 0) { I personally would prefer an extra set of brackets to at least make it more obvious which operation takes precedence. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/adpcm: add support for 5.1 adpcm ms
On Thu, Jul 25, 2019 at 16:19:19 +0200, Paul B Mahol wrote: > patches attached. > if (block_predictor > 6) { > -av_log(avctx, AV_LOG_ERROR, "ERROR: block_predictor[1] = > %d\n", > +av_log(avctx, AV_LOG_ERROR, "ERROR: block_predictor[0] = > %d\n", > block_predictor); This is not a reindent. ;-) Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/adpcm: add support for 5.1 adpcm ms
> > This is not a reindent. ;-) > It is. Look more carefully. > You need brain to look too. Sorry, I see it now. The indent, I mean, not the brain, which is not there. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] Fix for closed connection with http_persistent
> +// read headers if not already loaded (this is needed to check if > connection is closing) > +if (!s->end_header) { > + int new_location; > + http_read_header(h, &new_location); > + > + if (s->willclose) { > +ret = ffurl_closep(&s->hd); > + > +if (ret < 0) > + return ret; > + } > +} > + Your indentation style doesn't correspond to ffmpeg's. > @@ -1637,6 +1647,7 @@ static int http_shutdown(URLContext *h, int flags) > s->hd->flags |= AVIO_FLAG_NONBLOCK; > read_ret = ffurl_read(s->hd, buf, sizeof(buf)); > s->hd->flags &= ~AVIO_FLAG_NONBLOCK; > + > if (read_ret < 0 && read_ret != AVERROR(EAGAIN)) { > av_log(h, AV_LOG_ERROR, "URL read error: %s\n", > av_err2str(read_ret)); > ret = read_ret; This change doesn't belong here. Furthermore, the explanation from your original e-mail can go into the commit message. Incl. the additional remark "Fixes #7975". The first line of the commit message needs to be prefixed with "avformat/http: ". Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Ticket #7124: Fixes compiler bug - replace vec_lvsl/vec_perm with vec_xl
Hi, On Thu, Aug 01, 2019 at 07:42:28 -0400, ckerchne wrote: Just a small hint: You patch was corrupted by newlines inserted by your email client. Try attaching the patch file, or using git send-email. > > --- a/libswscale/ppc/yuv2rgb_altivec.c > > +++ b/libswscale/ppc/yuv2rgb_altivec.c > > @@ -305,9 +305,6 @@ static int altivec_ ## name(SwsContext *c, const > > unsigned char **in, \ > > vector signed short R1, G1, B1; > >\ > > vector unsigned char R, G, B; > >\ > > > >\ > > -const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP; > >\ > > -vector unsigned char align_perm; > >\ > > - > >\ See also here how the formatting ended up: https://patchwork.ffmpeg.org/patch/14045/ Also please prefix the first line of the commit message with "swscale/ppc/yuv2rgb_altivec:". The "Fixes #" part can go lower into the commit message body (like to the last line, as a separate parapgraph, for example). Cheers, Moritz P.S.: I can't review this anyway. ;-) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] libavcodec: add timer bitstream filter [v2]
Hi Andreas, On Fri, Aug 02, 2019 at 13:03:03 +, Andreas Håkon wrote: While trying to figure out how to add features I'd like to see into this ;-), some remarks: > +Apply an offset to the PTS/DTS timestamps. > + > +@table @option > +@item offset > +The offset value to apply to the PTS/DTS timestamps. For the unknowing, it might be useful to point out what sort of increments this is (i.e. not an actual "time" stamp or seconds). > +// TODO: Control time wrapping [...] > +int offset; [...] > +{ "offset", NULL, OFFSET(offset), AV_OPT_TYPE_INT, { .i64 = 0 }, > INT_MIN, INT_MAX, FLAGS }, Considering PTS/DTS is int64, wouldn't it be useful for the offset also being int64 (and using limits INT64_MIN, INT64_MAX)? > +// TODO: Instead of using absolute timestamp offsets, use frame numbers Alternatively? Or perhaps also AV_OPT_TYPE_DURATION? TODO is for later, anyway... > +if (!s->first_debug_done) { > +av_log(ctx, AV_LOG_DEBUG, "Updated PTS/DTS (%"PRId64"/%"PRId64" : > %"PRId64"/%"PRId64") with offset:%d\n", > +pkt->pts, pkt->dts, opts, odts, s->offset ); > +} > +s->first_debug_done = 1; You should set the variable inside the if() block. otherwise it gets assigned on every packet. > +static const AVClass timer_class = { > +.class_name = "timer", In about half of the existing BSFs, this would be called "timer_bsf". I don't care, I just look at other existing code. ;-) Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] doc/developper: always use braces for statements
On Wed, Aug 07, 2019 at 00:14:06 +0200, Alexander Strasser wrote: > Nicolas, changes to the coding style should be discussed and not > be tunneled through documentation patches. Though I don't think > the latter was the intention of the OP. It was probably caused by different reviews: - "Please remove the brackets." - "Please add brackets." I don't feel strongly about style rules being changed (though I do prefer one of the two), but it should be consistent and documented. (Same e.g. about the loop counter declaration within for(;;).) Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 0/2] AltiVec/VSX fixes in swscale
On Tue, Aug 06, 2019 at 17:55:35 +0200, Daniel Kolesa wrote: > The first of these patches fixes the original report as described in > https://trac.ffmpeg.org/ticket/7861. The second of the patches fixes > the second report in the same ticket (by leigh123linux). If so, each of the commit messages should additionally say: "Fixes #7861" Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avcodec: Implement Acorn Replay IMA ADPCM decoder
On Thu, Aug 08, 2019 at 22:09:04 +0100, Cameron Cawley wrote: > Signed-off-by: Cameron Cawley > --- > doc/general.texi| 1 + > libavcodec/Makefile | 1 + > libavcodec/adpcm.c | 14 ++ > libavcodec/allcodecs.c | 1 + > libavcodec/avcodec.h| 1 + > libavcodec/codec_desc.c | 7 +++ > libavcodec/utils.c | 1 + > 7 files changed, 26 insertions(+) You should also bump the micro version when adding a new decoder. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avformat/hashenc: add an option to create a hash per stream
This patchset adds an option to the non-frame based hash muxers to create a hash per stream. (The frame based muxers already do that.) The first patch prepares by replacing the hash variable by an array of hashes (using only the first item). The second one rearranges tho options, which were a bit incorrect anyway. The third one adds the actual functionality, the fourth one reindents. Probably okay to squash, whatever the maintainers feel most appropriate. Moritz Barsnick (4): avformat/hashenc: use an array of hashes avformat/hashenc: rearrange options definition avformat/hashenc: add option to create hash per stream avformat/hashenc: reindent after previous commit doc/muxers.texi | 5 ++ libavformat/hashenc.c | 122 +- 2 files changed, 91 insertions(+), 36 deletions(-) -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/4] avformat/hashenc: rearrange options definition
Only the frame* muxers support the format_version option. Signed-off-by: Moritz Barsnick --- libavformat/hashenc.c | 35 +++ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index 7f83df5cca..96e00f580c 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -36,18 +36,37 @@ struct HashContext { #define OFFSET(x) offsetof(struct HashContext, x) #define ENC AV_OPT_FLAG_ENCODING_PARAM -#if CONFIG_HASH_MUXER || CONFIG_FRAMEHASH_MUXER +#define HASH_OPT(defaulttype) \ +{ "hash", "set hash to use", OFFSET(hash_name), AV_OPT_TYPE_STRING, {.str = defaulttype}, 0, 0, ENC } +#define FORMAT_VERSION_OPT \ +{ "format_version", "file format version", OFFSET(format_version), AV_OPT_TYPE_INT, {.i64 = 2}, 1, 2, ENC } + +#if CONFIG_HASH_MUXER static const AVOption hash_options[] = { -{ "hash", "set hash to use", OFFSET(hash_name), AV_OPT_TYPE_STRING, {.str = "sha256"}, 0, 0, ENC }, -{ "format_version", "file format version", OFFSET(format_version), AV_OPT_TYPE_INT, {.i64 = 2}, 1, 2, ENC }, +HASH_OPT("sha256"), +{ NULL }, +}; +#endif + +#if CONFIG_FRAMEHASH_MUXER +static const AVOption framehash_options[] = { +HASH_OPT("sha256"), +FORMAT_VERSION_OPT, { NULL }, }; #endif -#if CONFIG_MD5_MUXER || CONFIG_FRAMEMD5_MUXER +#if CONFIG_MD5_MUXER static const AVOption md5_options[] = { -{ "hash", "set hash to use", OFFSET(hash_name), AV_OPT_TYPE_STRING, {.str = "md5"}, 0, 0, ENC }, -{ "format_version", "file format version", OFFSET(format_version), AV_OPT_TYPE_INT, {.i64 = 2}, 1, 2, ENC }, +HASH_OPT("md5"), +{ NULL }, +}; +#endif + +#if CONFIG_FRAMEMD5_MUXER +static const AVOption framemd5_options[] = { +HASH_OPT("md5"), +FORMAT_VERSION_OPT, { NULL }, }; #endif @@ -233,7 +252,7 @@ static int framehash_write_trailer(struct AVFormatContext *s) static const AVClass framehash_class = { .class_name = "frame hash muxer", .item_name = av_default_item_name, -.option = hash_options, +.option = framehash_options, .version= LIBAVUTIL_VERSION_INT, }; @@ -256,7 +275,7 @@ AVOutputFormat ff_framehash_muxer = { static const AVClass framemd5_class = { .class_name = "frame MD5 muxer", .item_name = av_default_item_name, -.option = md5_options, +.option = framemd5_options, .version= LIBAVUTIL_VERSION_INT, }; -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/4] avformat/hashenc: use an array of hashes
Only the first one used currently. Signed-off-by: Moritz Barsnick --- libavformat/hashenc.c | 58 +++ 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index 06fc085d18..7f83df5cca 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -29,7 +29,7 @@ struct HashContext { const AVClass *avclass; -struct AVHashContext *hash; +struct AVHashContext **hashes; char *hash_name; int format_version; }; @@ -55,18 +55,24 @@ static const AVOption md5_options[] = { #if CONFIG_HASH_MUXER || CONFIG_MD5_MUXER static int hash_write_header(struct AVFormatContext *s) { +int res; struct HashContext *c = s->priv_data; -int res = av_hash_alloc(&c->hash, c->hash_name); -if (res < 0) +c->hashes = av_malloc_array(1, sizeof(c->hashes)); +if (!c->hashes) +return AVERROR(ENOMEM); +res = av_hash_alloc(&c->hashes[0], c->hash_name); +if (res < 0) { +av_freep(&c->hashes); return res; -av_hash_init(c->hash); +} +av_hash_init(c->hashes[0]); return 0; } static int hash_write_packet(struct AVFormatContext *s, AVPacket *pkt) { struct HashContext *c = s->priv_data; -av_hash_update(c->hash, pkt->data, pkt->size); +av_hash_update(c->hashes[0], pkt->data, pkt->size); return 0; } @@ -74,14 +80,15 @@ static int hash_write_trailer(struct AVFormatContext *s) { struct HashContext *c = s->priv_data; char buf[AV_HASH_MAX_SIZE*2+128]; -snprintf(buf, sizeof(buf) - 200, "%s=", av_hash_get_name(c->hash)); +snprintf(buf, sizeof(buf) - 200, "%s=", av_hash_get_name(c->hashes[0])); -av_hash_final_hex(c->hash, buf + strlen(buf), sizeof(buf) - strlen(buf)); +av_hash_final_hex(c->hashes[0], buf + strlen(buf), sizeof(buf) - strlen(buf)); av_strlcatf(buf, sizeof(buf), "\n"); avio_write(s->pb, buf, strlen(buf)); avio_flush(s->pb); -av_hash_freep(&c->hash); +av_hash_freep(&c->hashes[0]); +av_freep(&c->hashes); return 0; } #endif @@ -145,9 +152,9 @@ static void framehash_print_extradata(struct AVFormatContext *s) char buf[AV_HASH_MAX_SIZE*2+1]; avio_printf(s->pb, "#extradata %d, %31d, ", i, par->extradata_size); -av_hash_init(c->hash); -av_hash_update(c->hash, par->extradata, par->extradata_size); -av_hash_final_hex(c->hash, buf, sizeof(buf)); +av_hash_init(c->hashes[0]); +av_hash_update(c->hashes[0], par->extradata, par->extradata_size); +av_hash_final_hex(c->hashes[0], buf, sizeof(buf)); avio_write(s->pb, buf, strlen(buf)); avio_printf(s->pb, "\n"); } @@ -156,13 +163,19 @@ static void framehash_print_extradata(struct AVFormatContext *s) static int framehash_write_header(struct AVFormatContext *s) { +int res; struct HashContext *c = s->priv_data; -int res = av_hash_alloc(&c->hash, c->hash_name); -if (res < 0) +c->hashes = av_malloc_array(1, sizeof(c->hashes)); +if (!c->hashes) +return AVERROR(ENOMEM); +res = av_hash_alloc(&c->hashes[0], c->hash_name); +if (res < 0) { +av_freep(&c->hashes); return res; +} avio_printf(s->pb, "#format: frame checksums\n"); avio_printf(s->pb, "#version: %d\n", c->format_version); -avio_printf(s->pb, "#hash: %s\n", av_hash_get_name(c->hash)); +avio_printf(s->pb, "#hash: %s\n", av_hash_get_name(c->hashes[0])); framehash_print_extradata(s); ff_framehash_write_header(s); avio_printf(s->pb, "#stream#, dts,pts, duration, size, hash\n"); @@ -174,30 +187,30 @@ static int framehash_write_packet(struct AVFormatContext *s, AVPacket *pkt) struct HashContext *c = s->priv_data; char buf[AV_HASH_MAX_SIZE*2+128]; int len; -av_hash_init(c->hash); -av_hash_update(c->hash, pkt->data, pkt->size); +av_hash_init(c->hashes[0]); +av_hash_update(c->hashes[0], pkt->data, pkt->size); snprintf(buf, sizeof(buf) - (AV_HASH_MAX_SIZE * 2 + 1), "%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, ", pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size); len = strlen(buf); -av_hash_final_hex(c->hash, buf + len, sizeof(buf) - len); +av_hash_final_hex(c->hashes[0], buf + len, sizeof(buf) - len); avio_write(s->pb, buf, strlen(buf)); if (c->format_version > 1 && pkt->side_data_elems) { int i, j
[FFmpeg-devel] [PATCH 3/4] avformat/hashenc: add option to create hash per stream
Non-frame based muxers only, the frame based ones are already per stream. Signed-off-by: Moritz Barsnick --- doc/muxers.texi | 5 + libavformat/hashenc.c | 41 + 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index bc38cf6029..34ca7f07cb 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -511,6 +511,11 @@ Supported values include @code{MD5}, @code{murmur3}, @code{RIPEMD128}, @code{SHA224}, @code{SHA256} (default), @code{SHA512/224}, @code{SHA512/256}, @code{SHA384}, @code{SHA512}, @code{CRC32} and @code{adler32}. +@item per_stream @var{bool} +Whether to calculate a hash per stream, instead of combined over all +packets' payload. Each stream's hash is prefixed with its stream index. +Default is @code{false}. + @end table @subsection Examples diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index 96e00f580c..394b8a0fce 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -31,6 +31,7 @@ struct HashContext { const AVClass *avclass; struct AVHashContext **hashes; char *hash_name; +int per_stream; int format_version; }; @@ -40,10 +41,13 @@ struct HashContext { { "hash", "set hash to use", OFFSET(hash_name), AV_OPT_TYPE_STRING, {.str = defaulttype}, 0, 0, ENC } #define FORMAT_VERSION_OPT \ { "format_version", "file format version", OFFSET(format_version), AV_OPT_TYPE_INT, {.i64 = 2}, 1, 2, ENC } +#define PER_STREAM_OPT \ +{ "per_stream", "whether to calculate a hash per stream", OFFSET(per_stream), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC } #if CONFIG_HASH_MUXER static const AVOption hash_options[] = { HASH_OPT("sha256"), +PER_STREAM_OPT, { NULL }, }; #endif @@ -59,6 +63,7 @@ static const AVOption framehash_options[] = { #if CONFIG_MD5_MUXER static const AVOption md5_options[] = { HASH_OPT("md5"), +PER_STREAM_OPT, { NULL }, }; #endif @@ -74,39 +79,51 @@ static const AVOption framemd5_options[] = { #if CONFIG_HASH_MUXER || CONFIG_MD5_MUXER static int hash_write_header(struct AVFormatContext *s) { -int res; +int i, res; struct HashContext *c = s->priv_data; -c->hashes = av_malloc_array(1, sizeof(c->hashes)); +int num_hashes = c->per_stream ? s->nb_streams : 1; +c->hashes = av_malloc_array(num_hashes, sizeof(c->hashes)); if (!c->hashes) return AVERROR(ENOMEM); -res = av_hash_alloc(&c->hashes[0], c->hash_name); -if (res < 0) { -av_freep(&c->hashes); -return res; +for (i = 0; i < num_hashes; i++) { +res = av_hash_alloc(&c->hashes[i], c->hash_name); +if (res < 0) +goto err; +av_hash_init(c->hashes[i]); } -av_hash_init(c->hashes[0]); return 0; +err: +for (int j = 0; j < i; j++) +av_hash_freep(&c->hashes[j]); +av_freep(&c->hashes); +return res; } static int hash_write_packet(struct AVFormatContext *s, AVPacket *pkt) { struct HashContext *c = s->priv_data; -av_hash_update(c->hashes[0], pkt->data, pkt->size); +av_hash_update(c->hashes[c->per_stream ? pkt->stream_index : 0], pkt->data, pkt->size); return 0; } static int hash_write_trailer(struct AVFormatContext *s) { struct HashContext *c = s->priv_data; +int num_hashes = c->per_stream ? s->nb_streams : 1; +for (int i = 0; i < num_hashes; i++) { char buf[AV_HASH_MAX_SIZE*2+128]; -snprintf(buf, sizeof(buf) - 200, "%s=", av_hash_get_name(c->hashes[0])); - -av_hash_final_hex(c->hashes[0], buf + strlen(buf), sizeof(buf) - strlen(buf)); +if (c->per_stream) { +snprintf(buf, sizeof(buf) - 200, "%d,%s=", i, av_hash_get_name(c->hashes[i])); +} else { +snprintf(buf, sizeof(buf) - 200, "%s=", av_hash_get_name(c->hashes[i])); +} +av_hash_final_hex(c->hashes[i], buf + strlen(buf), sizeof(buf) - strlen(buf)); av_strlcatf(buf, sizeof(buf), "\n"); avio_write(s->pb, buf, strlen(buf)); avio_flush(s->pb); -av_hash_freep(&c->hashes[0]); +av_hash_freep(&c->hashes[i]); +} av_freep(&c->hashes); return 0; } -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 4/4] avformat/hashenc: reindent after previous commit
Signed-off-by: Moritz Barsnick --- libavformat/hashenc.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index 394b8a0fce..070d4001b1 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -86,10 +86,10 @@ static int hash_write_header(struct AVFormatContext *s) if (!c->hashes) return AVERROR(ENOMEM); for (i = 0; i < num_hashes; i++) { -res = av_hash_alloc(&c->hashes[i], c->hash_name); -if (res < 0) -goto err; -av_hash_init(c->hashes[i]); +res = av_hash_alloc(&c->hashes[i], c->hash_name); +if (res < 0) +goto err; +av_hash_init(c->hashes[i]); } return 0; err: @@ -111,18 +111,18 @@ static int hash_write_trailer(struct AVFormatContext *s) struct HashContext *c = s->priv_data; int num_hashes = c->per_stream ? s->nb_streams : 1; for (int i = 0; i < num_hashes; i++) { -char buf[AV_HASH_MAX_SIZE*2+128]; -if (c->per_stream) { -snprintf(buf, sizeof(buf) - 200, "%d,%s=", i, av_hash_get_name(c->hashes[i])); -} else { -snprintf(buf, sizeof(buf) - 200, "%s=", av_hash_get_name(c->hashes[i])); -} -av_hash_final_hex(c->hashes[i], buf + strlen(buf), sizeof(buf) - strlen(buf)); -av_strlcatf(buf, sizeof(buf), "\n"); -avio_write(s->pb, buf, strlen(buf)); -avio_flush(s->pb); +char buf[AV_HASH_MAX_SIZE*2+128]; +if (c->per_stream) { +snprintf(buf, sizeof(buf) - 200, "%d,%s=", i, av_hash_get_name(c->hashes[i])); +} else { +snprintf(buf, sizeof(buf) - 200, "%s=", av_hash_get_name(c->hashes[i])); +} +av_hash_final_hex(c->hashes[i], buf + strlen(buf), sizeof(buf) - strlen(buf)); +av_strlcatf(buf, sizeof(buf), "\n"); +avio_write(s->pb, buf, strlen(buf)); +avio_flush(s->pb); -av_hash_freep(&c->hashes[i]); +av_hash_freep(&c->hashes[i]); } av_freep(&c->hashes); return 0; -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/hashenc: add an option to create a hash per stream
On Sun, Aug 11, 2019 at 14:47:52 +0200, Moritz Barsnick wrote: > This patchset adds an option to the non-frame based hash muxers to create a > hash per stream. (The frame based muxers already do that.) I forgot to bump micro in the patch which adds the functionality. Please do when pushing, or I will try to remember in V2. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/4] avformat/hashenc: use an array of hashes
On Sun, Aug 11, 2019 at 15:57:46 +0200, Nicolas George wrote: > > +c->hashes = av_malloc_array(1, sizeof(c->hashes)); > > +if (!c->hashes) > > +return AVERROR(ENOMEM); > > +res = av_hash_alloc(&c->hashes[0], c->hash_name); > > +if (res < 0) { > > +av_freep(&c->hashes); > > Maybe move all the freing code in a deinit() function? Sure, I'll have a look how the other muxers do it. The code is later allocating hashes av_hash_alloc() in a loop over nb_streams. If this fails (i.e. out of memory) along the way, do I need to remember how many succeeded before? (See patch 4/4.) Or can I just av_hash_freep() each one in the array, regardsless? Grateful for any other reviews, thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v1 1/2] avfilter/vsrc_mptestsrc: add option to set the max number frames generated for each tests
On Mon, Aug 12, 2019 at 19:21:45 +0800, lance.lmw...@gmail.com wrote: > +Set the max number frames generated for each tests: Grammar nit: Set the maximum number of frames generated for each test (Note: - use the complete word maximum - "test", "not tests", when using "for each" singular - *of* frames. > +{ "max_frames", "Set the max number frames generated for each tests", > OFFSET(max_frames), AV_OPT_TYPE_INT, {.i64 = 30}, 1, INT64_MAX, FLAGS }, > +{ "m", " Set the max number frames generated for each tests", > OFFSET(max_frames), AV_OPT_TYPE_INT, {.i64 = 30}, 1, INT64_MAX, FLAGS }, Same here. Also note that you introduced an additional space in the second string which doesn't belong there. > +if (tt == TEST_ALL && frame%test->max_frames) /* draw a black frame at > the beginning of each test */ > +tt = (frame/test->max_frames)%(TEST_NB-1); [...] > +case TEST_DC_LUMA: dc_test(picref->data[0], picref->linesize[0], > 256, 256, frame%test->max_frames); break; > +case TEST_DC_CHROMA: dc_test(picref->data[1], picref->linesize[1], > 256, 256, frame%test->max_frames); break; > +case TEST_FREQ_LUMA: freq_test(picref->data[0], picref->linesize[0], > frame%test->max_frames); break; [...] frame%test->max_frames could probably be assigned to a variable, that might avoid a lot of code, unless compilers know how to optimize this. (Might not belong into this functional patch though.) Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v1] fftoos/ffmpeg_opt: avoid to display the hwaccels name twice
On Tue, Aug 13, 2019 at 21:38:41 +0800, lance.lmw...@gmail.com wrote: > From: Limin Wang > fftoos/ffmpeg_opt: avoid to display the hwaccels name twice ^ Nit: fftools/ffmpeg_opt Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v6] avfilter/avf_aphasemeter: Add out-of-phase and mono detection
On Tue, Aug 13, 2019 at 18:01:29 +0200, Romane Lafon wrote: > +{ "duration", "set minimum mono or out-of-phase duration in seconds", > OFFSET(duration), AV_OPT_TYPE_DOUBLE, {.dbl=2.}, 0, 24*60*60, FLAGS }, ffmpeg also provides a AV_OPT_TYPE_DURATION. (This may have been discussed before - sorry if so.) > +static inline float get_index(AVFilterLink *inlink, AVFrame *in) > +{ > +char *index_str = av_ts2timestr(in->pts, &inlink->time_base); > +return atof(index_str); > +} Just wondering: Are you sure this works? The av_ts2timestr() macro is specifically documented as such: [...] the return value should be used only directly in function arguments but never stand-alone Likely because it defines a buffer locally which goes out of scope. Cheers, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] MJPEG FPS
On Wed, Aug 14, 2019 at 11:23:09 +0200, Daniel Kučera wrote: > I'm trying to lower the latency when playing mjpeg multipart http > stream and I came to this line: > https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mpjpegdec.c#L157 > > Does it mean each mjpeg stream is decoded as 25FPS? Yes. > Is this desired feature? Probably. I believe every demuxer needs to provide an fps (does it?). mpjpeg can't determine an fps, and needs to guess. Actually, it doesn't even get timestamps from the source. So either you provide the correct fps for a stream which originates as CFR, or you use "-use_wallclock_as_timestamps 1" when capturing from HTTP (and possibly "-vsync vfr") to cover unknown or VFR rates. (My mpjpeg sources are true VFR, they switch between e.g. 1 and 5 fps, plus the incoming jitter via HTTP.) Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] libavformat/rtspdec: Don't send teardown if rtsp_hd_out is null
On Mon, Aug 05, 2019 at 08:18:32 +0100, Ross Nicholson wrote: > Example stream that does not work: > rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov > > Extending the condition allows the stream to be processed correctly. Can you give a bit more detail? Decoding this stream works for me (at last the first 20 seconds or so). > On Mon, 5 Aug 2019 at 08:17, Ross Nicholson wrote: > > From: phunkyfish Do you want your real name or this pseudonym registered in the repo? It can't be changed afterwards. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".