Re: [FFmpeg-devel] [PATCH]configure: Enable pie for toolchain=hardened.
2016-10-05 15:14 GMT+02:00 Carl Eugen Hoyos : > Patch sent that fixes this issue. I'll apply both patches if there are no objections. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxfenc: Do not print a useless error message
2016-10-08 11:28 GMT+02:00 Carl Eugen Hoyos : > Attached patch removes a warning that is always shown if the > default mxf muxer is used. Patch applied. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavc/pnmdec: Do not fail by default for truncated pbm files
2016-09-05 11:12 GMT+02:00 Carl Eugen Hoyos : > 2016-09-05 10:26 GMT+02:00 Paul B Mahol : >> On 9/5/16, Carl Eugen Hoyos wrote: > >>> New patch attached. >> >> It seems this patch disables check for all cases when experimental is >> enabled, >> but check for overflow in only one case. > > I am not sure I understand: > Do you mean I missed a case where an overflow is now (after the patch) > possible (but wasn't before) or do you mean there are formats after the > patch that allow truncation and formats that do not allow it? Ping. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/riffenc: Always write unexpected channel_mask
2016-09-26 12:39 GMT+02:00 Carl Eugen Hoyos : > Attached patch allows to write arbitrary (mono) channel_masks > even for 16bit 48kHz pcm audio. I'll push this if there are no objections. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] d3d11va: use the proper slice index
On Mon, Oct 10, 2016 at 11:34 PM, compn wrote: > On Mon, 10 Oct 2016 17:07:06 +0200 > Hendrik Leppkes wrote: > >> On Mon, Oct 10, 2016 at 4:01 PM, Michael Niedermayer >> > >> > maybe our dxva2 maintainer wants a co maintainer? >> > if so would someone be interrested to help ? >> > >> >> Unfortunately I have no way of testing the D3D11 stuff in there (and I > > do you want a windows box with a d3d11 card? there are many companies > now using ffmpeg and they want to get boxes into developer hands for > testing. > I have all the hardware, but I have no software that actually uses d3d11, and ffmpeg itself also does not use it. Hence no testing options. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi/pan: allow negative gain parameters also for other inputs than the first named
On Mon, Oct 10, 2016 at 19:09:34 +0200, Nicolas George wrote: > Maybe I am missing something, but I do not see where sign is reset to 1 > before the next run of the loop. You are correct. Too stupid me, I must pay more attention. And improve my testing. ;-) New patch coming. Thanks for checking, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC/PATCH]lavc/vp8: Read a frame to set pix_fmt
Hi! Sorry for the delay! 2016-08-28 14:25 GMT+02:00 Ronald S. Bultje : > On Sun, Aug 28, 2016 at 7:24 AM, Carl Eugen Hoyos wrote: >> Currently, FFmpeg reports "1920x1080" for >> fate-suite/vp8/frame_size_change.webm although the first >> frame is 160x90. >> This is different for "--enable-libvpx --disable-decoder=vp8" >> and would be different if the sample used vp9 or h264 or hevc. >> I believe this will be different once the native vp8 decoder >> supports transparency. >> So I think attached patch is not unreasonable. >> Strong objections? >> >> The sample from #5803 is broken and should not be used in the >> reasoning. > This is (IMO) mostly a terminology issue, no? > > From what I recall (you didn't mention), the issue in the size-change > sample is that the demuxer reads size (AVCodecContext->width/height) from > container (which is 1920x1080), and if decoders sets > (AVCodecContext->)pix_fmt, this satisfies avformat_find_stream_info to not > decode a frame before returning. With your change, AVCodecContext->pix_fmt > is missing and thus the size (along with pix_fmt) is read from the first > frame (160x90). This size is then used by ffmpeg.c to set (default) output > size. Which of these two situations is better? I don't know. It's a > terminology issue. I don't know if there is a correct answer. I agree, I am just arguing that vp8 now acts differently from very similar codecs (vp9) and from vp8 in the future and I think it is ok to change this now (since a user requested it). > Answer me this question (without caring for what libvpx or h264 or vp8 does > right now): if a container says size=AxB for a C-frame sample with first > frame size=DxE and unknown size for any subsequent frame, and A-E are all > integers > 0 (and C > 1, and A!=D||B!=E), what should the (default) output > size be? Why? I don't think there is a general answer. Although arguing that the container resolution should be preferred for displaying makes sense but not applying this patch does not fix the issue that FFmpeg currently does not use container resolution independently from codec resolution. > (The patch itself is probably fine.) New patch attached, the original one was broken after too much testing and changing. Carl Eugen From 7e9ffdb9e4385bc8c33e063266d282dc9125a6e7 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Tue, 11 Oct 2016 10:27:51 +0200 Subject: [PATCH] lavc/vp8: Read a frame to set pix_fmt. This is what libvpx does and what is done for other codecs with similar use-cases and what will have to be done for VP8A. --- libavcodec/vp8.c |3 +- libavcodec/webp.c |1 + tests/ref/fate/vp8-size-change | 62 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index c1c3eb7..5683493 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2585,6 +2585,8 @@ int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ret = AVERROR_INVALIDDATA; goto err; } +if (avctx->pix_fmt != AV_PIX_FMT_YUVA420P) +avctx->pix_fmt = AV_PIX_FMT_YUV420P; curframe->tf.f->key_frame = s->keyframe; curframe->tf.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I @@ -2728,7 +2730,6 @@ int vp78_decode_init(AVCodecContext *avctx, int is_vp7) s->avctx = avctx; s->vp7 = avctx->codec->id == AV_CODEC_ID_VP7; -avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->internal->allocate_progress = 1; ff_videodsp_init(&s->vdsp, 8); diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 45abfdc..723bfb7 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -1326,6 +1326,7 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p, if (!s->initialized) { ff_vp8_decode_init(avctx); +avctx->pix_fmt = AV_PIX_FMT_YUV420P; s->initialized = 1; if (s->has_alpha) avctx->pix_fmt = AV_PIX_FMT_YUVA420P; diff --git a/tests/ref/fate/vp8-size-change b/tests/ref/fate/vp8-size-change index 741b6d6..5105bc6 100644 --- a/tests/ref/fate/vp8-size-change +++ b/tests/ref/fate/vp8-size-change @@ -4,36 +4,36 @@ #tb 0: 1/30 #media_type 0: video #codec_id 0: rawvideo -#dimensions 0: 1920x1080 +#dimensions 0: 160x90 #sar 0: 1/1 #stream#, dts,pts, duration, size, hash -0, 0, 0,1, 3110400, 7dde8cd136ab4b04a95d9856b941697e -0, 1, 1,1, 3110400, aa885f78cb6374b5bfcc66a4fc57026f -0, 2, 2,1, 3110400, b69b7b56f549a3f9b0a603940bac85ed -0, 3, 3,1, 3110400, 20e2e0f0c89c58828b6a3b10d9e175e5 -0, 4, 4,1, 3110400, 483997936e7d6bb849e64d50426ec689 -0, 5, 5,1, 3110400, c85ef97a853ff594e2bfdf0a0a581dcc -0, 6, 6,1, 3110400, c5e7b9ff4c25391793446da788cb83a9 -0, 7, 7,1, 3110400, 63f93e89d24162e2
Re: [FFmpeg-devel] [PATCH 2/3] lavc/mediacodecdec: rename dequeued_buffer_nb to output_buffer_count
On Thu, Oct 6, 2016 at 2:31 PM, Matthieu Bouron wrote: > From: Matthieu Bouron > > --- > libavcodec/mediacodecdec.c | 6 +++--- > libavcodec/mediacodecdec.h | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c > index 2ab173b..3d519ca 100644 > --- a/libavcodec/mediacodecdec.c > +++ b/libavcodec/mediacodecdec.c > @@ -427,7 +427,7 @@ static int mediacodec_dec_flush_codec(AVCodecContext > *avctx, MediaCodecDecContex > FFAMediaCodec *codec = s->codec; > int status; > > -s->dequeued_buffer_nb = 0; > +s->output_buffer_count = 0; > > s->draining = 0; > s->flushing = 0; > @@ -621,7 +621,7 @@ int ff_mediacodec_dec_decode(AVCodecContext *avctx, > MediaCodecDecContext *s, > /* If the codec is flushing or need to be flushed, block for a > fair > * amount of time to ensure we got a frame */ > output_dequeue_timeout_us = OUTPUT_DEQUEUE_BLOCK_TIMEOUT_US; > -} else if (s->dequeued_buffer_nb == 0) { > +} else if (s->output_buffer_count == 0) { > /* If the codec hasn't produced any frames, do not block so we > * can push data to it as fast as possible, and get the first > * frame */ > @@ -661,7 +661,7 @@ int ff_mediacodec_dec_decode(AVCodecContext *avctx, > MediaCodecDecContext *s, > } > > *got_frame = 1; > -s->dequeued_buffer_nb++; > +s->output_buffer_count++; > } else { > status = ff_AMediaCodec_releaseOutputBuffer(codec, index, 0); > if (status < 0) { > diff --git a/libavcodec/mediacodecdec.h b/libavcodec/mediacodecdec.h > index 52c8bf1..7b0b7bb 100644 > --- a/libavcodec/mediacodecdec.h > +++ b/libavcodec/mediacodecdec.h > @@ -59,7 +59,7 @@ typedef struct MediaCodecDecContext { > int crop_left; > int crop_right; > > -uint64_t dequeued_buffer_nb; > +uint64_t output_buffer_count; > > } MediaCodecDecContext; > > -- > 2.10.0 > > If there is no objection I will push both patches in a few hours. Matthieu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/mxfdec: Detect field_order based on video_line_map
Read video_line_map from MXF generic picture essence descriptor and use it to derive the coded field order. Use field_dominance to derive the display field order from coded field order. If field_dominance is not available the default value "1" is used as defined in SMPTE S377-1. Fixes field_order detection for a bunch of DV/DVCPRO files. The heuristic for deriving coded field order from video_line_map is inspired by MediaInfo. Signed-off-by: Tobias Rapp --- libavformat/mxfdec.c | 75 +--- 1 file changed, 60 insertions(+), 15 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 1939761..8332362 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -173,8 +173,10 @@ typedef struct MXFDescriptor { int width; int height; /* Field height, not frame height */ int frame_layout; /* See MXFFrameLayout enum */ -#define MXF_TFF 1 -#define MXF_BFF 2 +int video_line_map[2]; +#define MXF_FIELD_DOMINANCE_DEFAULT 0 +#define MXF_FIELD_DOMINANCE_FF 1 /* coded first, displayed first */ +#define MXF_FIELD_DOMINANCE_FL 2 /* coded first, displayed last */ int field_dominance; int channels; int bits_per_sample; @@ -968,6 +970,8 @@ static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor) static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFDescriptor *descriptor = arg; +int entry_count, entry_size; + switch(tag) { case 0x3F01: return mxf_read_strong_ref_array(pb, &descriptor->sub_descriptors_refs, @@ -996,6 +1000,21 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int case 0x320C: descriptor->frame_layout = avio_r8(pb); break; +case 0x320D: +entry_count = avio_rb32(pb); +entry_size = avio_rb32(pb); +if (entry_size == 4) { +if (entry_count > 0) +descriptor->video_line_map[0] = avio_rb32(pb); +else +descriptor->video_line_map[0] = 0; +if (entry_count > 1) +descriptor->video_line_map[1] = avio_rb32(pb); +else +descriptor->video_line_map[1] = 0; +} else +av_log(NULL, AV_LOG_WARNING, "VideoLineMap element size %d currently not supported\n", entry_size); +break; case 0x320E: descriptor->aspect_ratio.num = avio_rb32(pb); descriptor->aspect_ratio.den = avio_rb32(pb); @@ -2044,19 +2063,45 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) case SegmentedFrame: st->codecpar->field_order = AV_FIELD_PROGRESSIVE; case SeparateFields: -switch (descriptor->field_dominance) { -case MXF_TFF: -st->codecpar->field_order = AV_FIELD_TT; -break; -case MXF_BFF: -st->codecpar->field_order = AV_FIELD_BB; -break; -default: -avpriv_request_sample(mxf->fc, - "Field dominance %d support", - descriptor->field_dominance); -case 0: // we already have many samples with field_dominance == unknown -break; +av_log(mxf->fc, AV_LOG_DEBUG, "video_line_map: (%d, %d), field_dominance: %d\n", + descriptor->video_line_map[0], descriptor->video_line_map[1], + descriptor->field_dominance); +if ((descriptor->video_line_map[0] > 0) && (descriptor->video_line_map[1] > 0)) { +/* Detect coded field order from VideoLineMap: + * (even, even) => bottom field coded first + * (even, odd) => top field coded first + * (odd, even) => top field coded first + * (odd, odd) => bottom field coded first + */ +if ((descriptor->video_line_map[0] + descriptor->video_line_map[1]) % 2) { +switch (descriptor->field_dominance) { +case MXF_FIELD_DOMINANCE_DEFAULT: +case MXF_FIELD_DOMINANCE_FF: +st->codecpar->field_order = AV_FIELD_TT; +break; +case MXF_FIELD_DOMINANCE_FL: +st->codecpar->field_order = AV_FIELD_TB; +break; +default: +avpriv_request_sample(mxf->fc, + "Field dominanc
Re: [FFmpeg-devel] [PATCH]lavc/pnmdec: Do not fail by default for truncated pbm files
On Tue, Oct 11, 2016 at 10:06:54AM +0200, Carl Eugen Hoyos wrote: > 2016-09-05 11:12 GMT+02:00 Carl Eugen Hoyos : > > 2016-09-05 10:26 GMT+02:00 Paul B Mahol : > >> On 9/5/16, Carl Eugen Hoyos wrote: > > > >>> New patch attached. > >> > >> It seems this patch disables check for all cases when experimental is > >> enabled, > >> but check for overflow in only one case. > > > > I am not sure I understand: > > Do you mean I missed a case where an overflow is now (after the patch) > > possible (but wasn't before) or do you mean there are formats after the > > patch that allow truncation and formats that do not allow it? > > Ping. i didnt look at the code but from the diff it seems what was meant was that bytestream + n could point outside the array that is indeed (suprising to many) undefined, you dont need to do bytestream[n] [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavfi/pan: allow negative gain parameters also for other inputs than the first named
Expands the parser to also accept the separator '-' in addition to '+', and take the negative sign into consideration. Signed-off-by: Moritz Barsnick --- doc/filters.texi | 2 +- libavfilter/af_pan.c | 11 --- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 4b2f7bf..fb4756e 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3001,7 +3001,7 @@ output channel layout or number of channels @item outdef output channel specification, of the form: -"@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]" +"@var{out_name}=[@var{gain}*]@var{in_name}[(+-)[@var{gain}*]@var{in_name}...]" @item out_name output channel to define, either a channel name (FL, FR, etc.) or a channel diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index fbd79a5..161097a 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -102,7 +102,7 @@ static av_cold int init(AVFilterContext *ctx) { PanContext *const pan = ctx->priv; char *arg, *arg0, *tokenizer, *args = av_strdup(pan->args); -int out_ch_id, in_ch_id, len, named, ret; +int out_ch_id, in_ch_id, len, named, ret, sign = 1; int nb_in_channels[2] = { 0, 0 }; // number of unnamed and named input channels double gain; @@ -178,15 +178,20 @@ static av_cold int init(AVFilterContext *ctx) ret = AVERROR(EINVAL); goto fail; } -pan->gain[out_ch_id][in_ch_id] = gain; +pan->gain[out_ch_id][in_ch_id] = sign * gain; skip_spaces(&arg); if (!*arg) break; -if (*arg != '+') { +if (*arg == '-') { +sign = -1; +} else if (*arg != '+') { av_log(ctx, AV_LOG_ERROR, "Syntax error near \"%.8s\"\n", arg); ret = AVERROR(EINVAL); goto fail; } +else { +sign = 1; +} arg++; } } -- 2.7.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
Fixes ticket #5882. While it doesn't automatically set the timescale for the user as that would destroy data without prompt, it will tell the user how they could set the timescale (as this is mostly likely what they want). Signed-off-by: Josh de Kock --- libavformat/movenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index d7c7158..1f4f2b0 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5681,7 +5681,9 @@ static int mov_write_header(AVFormatContext *s) av_log(s, AV_LOG_WARNING, "WARNING codec timebase is very high. If duration is too long,\n" "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); + "or choose different container. You may find the -video_track_timescale\n" + "flag useful to forcibly set a specific timescale. Ex. 3/1001 FPS\n" + "would be -video_track_timescale 3.\n"); if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { -- 2.8.4 (Apple Git-73) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
On Tue, Oct 11, 2016 at 12:30:30 +0100, Josh de Kock wrote: > "WARNING codec timebase is very high. If duration is > too long,\n" > "file may not be playable by quicktime. Specify a > shorter timebase\n" > - "or choose different container.\n"); > + "or choose different container. You may find the > -video_track_timescale\n" > + "flag useful to forcibly set a specific timescale. > Ex. 3/1001 FPS\n" > + "would be -video_track_timescale 3.\n"); Would it be useful to print the max duration (do we know what it would be?), and possibly even the present timebase? Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
Also the patch needs to cover both MP4 and MOV containers. On Tue, Oct 11, 2016 at 1:49 PM, Moritz Barsnick wrote: > On Tue, Oct 11, 2016 at 12:30:30 +0100, Josh de Kock wrote: >> "WARNING codec timebase is very high. If duration is >> too long,\n" >> "file may not be playable by quicktime. Specify a >> shorter timebase\n" >> - "or choose different container.\n"); >> + "or choose different container. You may find the >> -video_track_timescale\n" >> + "flag useful to forcibly set a specific timescale. >> Ex. 3/1001 FPS\n" >> + "would be -video_track_timescale 3.\n"); > > Would it be useful to print the max duration (do we know what it would > be?), and possibly even the present timebase? > > Moritz > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- -Alexey Eromenko "Technologov" ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
Josh, thanks for your efforts. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
I have written a different patch, which should auto-fix the problem, but I can't compile and test it now (due to build system issues): movenc.c affects both MP4 and MOV containers, right ? --- ./movenc.c.orig 2016-10-11 06:24:44.328730759 -0400 +++ ./ffmpeg-3.1.3/ffmpeg-3.1.3/libavformat/movenc.c2016-10-11 08:12:50.626150035 -0400 @@ -5533,22 +5533,26 @@ track->timescale = mov->video_track_timescale; } else { track->timescale = st->time_base.den; while(track->timescale < 1) track->timescale *= 2; } +if (track->timescale > 10) { +int timescale_new = ((st->time_base.den) * (0x1)) / +(st->time_base.num)*1000; +av_log(s, AV_LOG_WARNING, + "WARNING codec timebase is very high. If duration is too long,\n" + "file may not be playable by Apple Quicktime. Auto-setting\n" + "a shorter timebase %d instead of %d.\n", timescale_new, track->timescale); +track->timescale = timescale_new; +} if (st->codecpar->width > 65535 || st->codecpar->height > 65535) { av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", st->codecpar->width, st->codecpar->height); ret = AVERROR(EINVAL); goto error; } -if (track->mode == MODE_MOV && track->timescale > 10) -av_log(s, AV_LOG_WARNING, - "WARNING codec timebase is very high. If duration is too long,\n" - "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { enum AVPixelFormat pix_fmt = track->par->format; if (pix_fmt == AV_PIX_FMT_NONE && track->par->bits_per_coded_sample == 1) pix_fmt = AV_PIX_FMT_MONOWHITE; ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
On Tue, Oct 11, 2016 at 02:40:57PM +0200, Alexey Eromenko wrote: > I have written a different patch, which should auto-fix the problem, > but I can't compile and test it now (due to build system issues): > movenc.c affects both MP4 and MOV containers, right ? > > > > --- ./movenc.c.orig 2016-10-11 06:24:44.328730759 -0400 > +++ ./ffmpeg-3.1.3/ffmpeg-3.1.3/libavformat/movenc.c2016-10-11 > 08:12:50.626150035 -0400 > @@ -5533,22 +5533,26 @@ > track->timescale = mov->video_track_timescale; > } else { > track->timescale = st->time_base.den; > while(track->timescale < 1) > track->timescale *= 2; > } > +if (track->timescale > 10) { > +int timescale_new = ((st->time_base.den) * (0x1)) / > +(st->time_base.num)*1000; > +av_log(s, AV_LOG_WARNING, > + "WARNING codec timebase is very high. If > duration is too long,\n" this patch is corrupted by newlines, check your word wrap settings also patches must be git patches against git master, this is against 3.1 and not a git format-patch (lacking commit message and author) about the code itself, theres a integer overflow in your code [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts
Hi, I have some transport streams with only one pid, containing MJPEG 2000 video. Since the PMT/PAT is missing ffmpeg is unable to decode it. The attached patch makes ffmpeg able to guess that it does contain a stream of jpeg 2000, but I am not sure if this is the correct approach. Also, should LIBAVFORMAT_VERSION_MICRO and the Changelog be updated? -- Ståle Kristoffersen >From 0d5594d4dfd1a9608ef55e90fb6a770b0f54cdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Kristoffersen?= Date: Tue, 11 Oct 2016 15:36:40 +0200 Subject: [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it possible to decode motion jpeg 2000 encoded in a transport stream without a correct PMT/PAT. Signed-off-by: Ståle Kristoffersen --- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/mj2kdec.c| 62 libavformat/utils.c | 1 + 4 files changed, 65 insertions(+) create mode 100644 libavformat/mj2kdec.c diff --git a/libavformat/Makefile b/libavformat/Makefile index 5d827d31..4020b8d 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -273,6 +273,7 @@ OBJS-$(CONFIG_MD5_MUXER) += hashenc.o OBJS-$(CONFIG_MGSTS_DEMUXER) += mgsts.o OBJS-$(CONFIG_MICRODVD_DEMUXER) += microdvddec.o subtitles.o OBJS-$(CONFIG_MICRODVD_MUXER)+= microdvdenc.o +OBJS-$(CONFIG_MJPEG_2000_DEMUXER)+= rawdec.o mj2kdec.o OBJS-$(CONFIG_MJPEG_DEMUXER) += rawdec.o OBJS-$(CONFIG_MJPEG_MUXER) += rawenc.o OBJS-$(CONFIG_MLP_DEMUXER) += rawdec.o mlpdec.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 6a216ef..7db6c52 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -183,6 +183,7 @@ void av_register_all(void) REGISTER_DEMUXER (MGSTS,mgsts); REGISTER_MUXDEMUX(MICRODVD, microdvd); REGISTER_MUXDEMUX(MJPEG,mjpeg); +REGISTER_DEMUXER (MJPEG_2000, mjpeg_2000); REGISTER_MUXDEMUX(MLP, mlp); REGISTER_DEMUXER (MLV, mlv); REGISTER_DEMUXER (MM, mm); diff --git a/libavformat/mj2kdec.c b/libavformat/mj2kdec.c new file mode 100644 index 000..cf9e575 --- /dev/null +++ b/libavformat/mj2kdec.c @@ -0,0 +1,62 @@ +/* + * VC-1 demuxer + * Copyright (c) 2016 Ståle Kristoffersen + * + * 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/intreadwrite.h" +#include "avformat.h" +#include "rawdec.h" +#include "libavcodec/jpeg2000.h" + + +#if CONFIG_MJPEG_2000_DEMUXER +static int mjpeg2000_probe(AVProbeData *p) +{ +int i; +int invalid = 0; +int frames = 0; +uint16_t soc, marker, marker_size; +uint8_t marker_marker; + +for (i=0; ibuf_size-5; i++) { +soc = AV_RB16(p->buf + i); +if (soc == JPEG2000_SOC ) { +marker = AV_RB16(p->buf + i + 2); +marker_size = AV_RB16(p->buf + i + 4); +if (marker == JPEG2000_SIZ) { +i += marker_size + 2; +marker_marker = AV_RB8(p->buf + i + 2); +if (marker_marker == 0xFF) { +frames++; +} else { +invalid++; +} +} +} +} + +if (invalid*4 + 1 < frames) { +return 1; +} + +return 0; +} +FF_DEF_RAWVIDEO_DEMUXER2(mjpeg_2000, "raw MJPEG 2000 video", mjpeg2000_probe, "j2k", AV_CODEC_ID_JPEG2000, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS) +#endif + diff --git a/libavformat/utils.c b/libavformat/utils.c index 8a51aea..9e9a052 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -328,6 +328,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, { "hevc", AV_CODEC_ID_HEVC, AVMEDIA_TYPE_VIDEO }, { "loas", AV_CODEC_ID_AAC_LATM, AVMEDIA_TYPE_AUDIO }, { "m4v", AV_CODEC_ID_MPEG4, AVMEDIA_TYPE_VIDEO }, +{ "mjpeg_2000",AV_CODEC_ID_JPEG2000, AVMEDIA_TYPE_VIDEO }, { "mp3", AV_CODEC_ID_MP3,AVMEDIA_TYPE_AUDIO }, { "mpegvideo", AV_CODEC_ID_MPEG2VIDE
Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts
On Tue, Oct 11, 2016 at 15:52:33 +0200, Ståle kristoffersen wrote: > + * VC-1 demuxer > + * Copyright (c) 2016 Ståle Kristoffersen I don't think it's a VC-1 demuxer. ;-) Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts
On Tue, Oct 11, 2016 at 03:52:33PM +0200, Ståle kristoffersen wrote: > Hi, > I have some transport streams with only one pid, containing MJPEG 2000 > video. Since the PMT/PAT is missing ffmpeg is unable to decode it. > > The attached patch makes ffmpeg able to guess that it does contain a > stream of jpeg 2000, but I am not sure if this is the correct approach. > > Also, should LIBAVFORMAT_VERSION_MICRO and the Changelog be updated? if a new demuxer needs to be added then, yes > > -- > Ståle Kristoffersen > Makefile |1 > allformats.c |1 > mj2kdec.c| 62 > +++ > utils.c |1 > 4 files changed, 65 insertions(+) > 26d9e6512a4c62e17df622cb4cb0dac7eadfa790 > 0001-libavf-Auto-detect-mjpeg-2000-in-mpeg-ts.patch > From 0d5594d4dfd1a9608ef55e90fb6a770b0f54cdaa Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?St=C3=A5le=20Kristoffersen?= > Date: Tue, 11 Oct 2016 15:36:40 +0200 > Subject: [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > This makes it possible to decode motion jpeg 2000 > encoded in a transport stream without a correct PMT/PAT. > > Signed-off-by: Ståle Kristoffersen > --- > libavformat/Makefile | 1 + > libavformat/allformats.c | 1 + > libavformat/mj2kdec.c| 62 > > libavformat/utils.c | 1 + > 4 files changed, 65 insertions(+) > create mode 100644 libavformat/mj2kdec.c > > diff --git a/libavformat/Makefile b/libavformat/Makefile > index 5d827d31..4020b8d 100644 > --- a/libavformat/Makefile > +++ b/libavformat/Makefile > @@ -273,6 +273,7 @@ OBJS-$(CONFIG_MD5_MUXER) += hashenc.o > OBJS-$(CONFIG_MGSTS_DEMUXER) += mgsts.o > OBJS-$(CONFIG_MICRODVD_DEMUXER) += microdvddec.o subtitles.o > OBJS-$(CONFIG_MICRODVD_MUXER)+= microdvdenc.o > +OBJS-$(CONFIG_MJPEG_2000_DEMUXER)+= rawdec.o mj2kdec.o > OBJS-$(CONFIG_MJPEG_DEMUXER) += rawdec.o > OBJS-$(CONFIG_MJPEG_MUXER) += rawenc.o > OBJS-$(CONFIG_MLP_DEMUXER) += rawdec.o mlpdec.o > diff --git a/libavformat/allformats.c b/libavformat/allformats.c > index 6a216ef..7db6c52 100644 > --- a/libavformat/allformats.c > +++ b/libavformat/allformats.c > @@ -183,6 +183,7 @@ void av_register_all(void) > REGISTER_DEMUXER (MGSTS,mgsts); > REGISTER_MUXDEMUX(MICRODVD, microdvd); > REGISTER_MUXDEMUX(MJPEG,mjpeg); > +REGISTER_DEMUXER (MJPEG_2000, mjpeg_2000); > REGISTER_MUXDEMUX(MLP, mlp); > REGISTER_DEMUXER (MLV, mlv); > REGISTER_DEMUXER (MM, mm); > diff --git a/libavformat/mj2kdec.c b/libavformat/mj2kdec.c > new file mode 100644 > index 000..cf9e575 > --- /dev/null > +++ b/libavformat/mj2kdec.c > @@ -0,0 +1,62 @@ > +/* > + * VC-1 demuxer > + * Copyright (c) 2016 Ståle Kristoffersen > + * > + * 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/intreadwrite.h" > +#include "avformat.h" > +#include "rawdec.h" > +#include "libavcodec/jpeg2000.h" > + > + > +#if CONFIG_MJPEG_2000_DEMUXER > +static int mjpeg2000_probe(AVProbeData *p) > +{ > +int i; > +int invalid = 0; > +int frames = 0; > +uint16_t soc, marker, marker_size; > +uint8_t marker_marker; > + > +for (i=0; ibuf_size-5; i++) { > +soc = AV_RB16(p->buf + i); > +if (soc == JPEG2000_SOC ) { > +marker = AV_RB16(p->buf + i + 2); > +marker_size = AV_RB16(p->buf + i + 4); > +if (marker == JPEG2000_SIZ) { > +i += marker_size + 2; > +marker_marker = AV_RB8(p->buf + i + 2); missing overflow and out of array checks also the img2 demuxer for mjpeg2000 from img2dec.c does not work for this ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell signature.asc Description: Digital signature ___ ffmpeg-devel mailing list
Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option
ping 2016-10-10 10:50 GMT+08:00 Steven Liu : > > Signed-off-by: Steven Liu > --- > doc/protocols.texi|3 +++ > libavformat/udp.c | 19 ++- > libavformat/version.h |3 +++ > 3 files changed, 24 insertions(+), 1 deletions(-) > > diff --git a/doc/protocols.texi b/doc/protocols.texi > index 3abc5f3..85a3f56 100644 > --- a/doc/protocols.texi > +++ b/doc/protocols.texi > @@ -1304,6 +1304,9 @@ input has enough packets to sustain it. > When using @var{bitrate} this specifies the maximum number of bits in > packet bursts. > > +@item local_port=@var{port} > +This is a deprecated option, you can use localport instead it. > + > @item localport=@var{port} > Override the local UDP port to bind with. > > diff --git a/libavformat/udp.c b/libavformat/udp.c > index 3835f98..af06b89 100644 > --- a/libavformat/udp.c > +++ b/libavformat/udp.c > @@ -86,6 +86,9 @@ typedef struct UDPContext { > int pkt_size; > int is_multicast; > int is_broadcast; > +#if FF_API_UDP_LOCAL_PORT > +int local_port_deprecated; > +#endif > int local_port; > int reuse_socket; > int overrun_nonfatal; > @@ -123,7 +126,9 @@ static const AVOption options[] = { > { "bitrate","Bits to send per second", > OFFSET(bitrate),AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, > INT64_MAX, .flags = E }, > { "burst_bits", "Max length of bursts in bits (when using > bitrate)", OFFSET(burst_bits), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, > INT64_MAX, .flags = E }, > { "localport", "Local port", > OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, > INT_MAX, D|E }, > -{ "local_port", "Local port", > OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, > INT_MAX, .flags = D|E }, > +#if FF_API_UDP_LOCAL_PORT > +{ "local_port", "Local port", > OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 }, > -1, INT_MAX, .flags = D|E }, > +#endif > { "localaddr", "Local address", > OFFSET(localaddr), AV_OPT_TYPE_STRING, { .str = NULL }, > .flags = D|E }, > { "udplite_coverage", "choose UDPLite head size which should be > validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 = > 0}, 0, INT_MAX, D|E }, > { "pkt_size", "Maximum UDP packet size", > OFFSET(pkt_size), AV_OPT_TYPE_INT,{ .i64 = 1472 }, -1, INT_MAX, > .flags = D|E }, > @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct > sockaddr_storage *addr, > > if (((struct sockaddr *) &s->dest_addr)->sa_family) > family = ((struct sockaddr *) &s->dest_addr)->sa_family; > +#if FF_API_UDP_LOCAL_PORT > +if (s->local_port_deprecated >= 0) { > +av_log(s, AV_LOG_WARNING, "the local_port option will be > deprecated, please use localport option\n"); > +s->local_port = s->local_port_deprecated; > +} > +#endif > res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr : > NULL, > s->local_port, > SOCK_DGRAM, family, AI_PASSIVE); > @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char > *uri) > int ff_udp_get_local_port(URLContext *h) > { > UDPContext *s = h->priv_data; > +#if FF_API_UDP_LOCAL_PORT > +if (s->local_port_deprecated >= 0) { > +av_log(s, AV_LOG_WARNING, "the local_port option will be > deprecated, please use localport option\n"); > +s->local_port = s->local_port_deprecated; > +} > +#endif > return s->local_port; > } > > diff --git a/libavformat/version.h b/libavformat/version.h > index 92801b4..71c03ef 100644 > --- a/libavformat/version.h > +++ b/libavformat/version.h > @@ -85,6 +85,9 @@ > #ifndef FF_API_HTTP_USER_AGENT > #define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 58) > #endif > +#ifndef FF_API_UDP_LOCAL_PORT > +#define FF_API_UDP_LOCAL_PORT (LIBAVFORMAT_VERSION_MAJOR < 59) > +#endif > > #ifndef FF_API_R_FRAME_RATE > #define FF_API_R_FRAME_RATE1 > -- > 1.7.1 > > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc: fix various typos and grammar errors
On Sun, Oct 09, 2016 at 08:51:57PM +0200, Moritz Barsnick wrote: > Signed-off-by: Moritz Barsnick > --- > doc/codecs.texi | 2 +- > doc/demuxers.texi| 4 ++-- > doc/ffmpeg.texi | 2 +- > doc/fftools-common-opts.texi | 8 > doc/filters.texi | 42 +- > doc/formats.texi | 2 +- > doc/indevs.texi | 4 ++-- > doc/muxers.texi | 6 +++--- > doc/platform.texi| 2 +- > doc/protocols.texi | 2 +- > 10 files changed, 37 insertions(+), 37 deletions(-) applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts
On 2016-10-11 at 16:23, Moritz Barsnick wrote: > On Tue, Oct 11, 2016 at 15:52:33 +0200, Ståle kristoffersen wrote: > > + * VC-1 demuxer > > + * Copyright (c) 2016 Ståle Kristoffersen > > I don't think it's a VC-1 demuxer. ;-) I guess I took the line "Do not copy and paste it from a random place, use an existing file as template." from the developement policy a bit to litteraly. :) -- Ståle Kristoffersen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
GMail disallows me to paste unwrapped text, so I will use good-old pastebin plain text. http://pastebin.com/SPUF4NTS ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
On Tue, Oct 11, 2016 at 05:16:30PM +0200, Alexey Eromenko wrote: > GMail disallows me to paste unwrapped text, so I will use good-old > pastebin plain text. > > http://pastebin.com/SPUF4NTS No, please fix or learn how to use your mailer. BTW, what if I actually want/need a large timebase because I want a valid file and not a crumbled one to play on a broken player? -- Clément B. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
In which cases a large timebase would help ? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
So, in which cases a large timebase would help ? Okay, I have allowed to manually over-ride the auto-detect setting via -video_track_timescale parameter, if someone really knows what he's doing. But the default settings (after my patch) work fine, with Windows Media Player, Quicktime, iTunes and VLC, both for normal input and broken input videos, both in MP4 and MOV output containers. GMail keep wrapping text, but this is the closes I could get: ffmpeg-apple-fix-v3.patch diff -uNr -U 6 ffmpeg-git-orig/libavformat/movenc.c ffmpeg-git/libavformat/movenc.c --- ffmpeg-git-orig/libavformat/movenc.c 2016-10-11 10:42:02.599749985 -0400 +++ ffmpeg-git/libavformat/movenc.c 2016-10-11 11:10:22.793393487 -0400 @@ -5669,22 +5669,27 @@ track->timescale = mov->video_track_timescale; } else { track->timescale = st->time_base.den; while(track->timescale < 1) track->timescale *= 2; } +if (track->timescale > 10 && (!mov->video_track_timescale)) { +unsigned int timescale_new = (unsigned int)((double)(st->time_base.den) +* 1000 / (double)(st->time_base.num)); +av_log(s, AV_LOG_WARNING, + "WARNING codec timebase is very high. If duration is too long,\n" + "file may not be playable by Apple Quicktime. Auto-setting\n" + "a shorter timebase %u instead of %d.\n", timescale_new, track->timescale); +track->timescale = timescale_new; +} if (st->codecpar->width > 65535 || st->codecpar->height > 65535) { -av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", st->codecpar->width, st->codecpar->height); +av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", +st->codecpar->width, st->codecpar->height); ret = AVERROR(EINVAL); goto error; } -if (track->mode == MODE_MOV && track->timescale > 10) -av_log(s, AV_LOG_WARNING, - "WARNING codec timebase is very high. If duration is too long,\n" - "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { enum AVPixelFormat pix_fmt = track->par->format; if (pix_fmt == AV_PIX_FMT_NONE && track->par->bits_per_coded_sample == 1) pix_fmt = AV_PIX_FMT_MONOWHITE; -- -Alexey Eromenko "Technologov" ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
On 11/10/2016 16:47, Alexey Eromenko wrote: So, in which cases a large timebase would help ? Okay, I have allowed to manually over-ride the auto-detect setting via -video_track_timescale parameter, if someone really knows what he's doing. But the default settings (after my patch) work fine, with Windows Media Player, Quicktime, iTunes and VLC, both for normal input and broken input videos, both in MP4 and MOV output containers. GMail keep wrapping text, but this is the closes I could get: ffmpeg-apple-fix-v3.patch diff -uNr -U 6 ffmpeg-git-orig/libavformat/movenc.c ffmpeg-git/libavformat/movenc.c --- ffmpeg-git-orig/libavformat/movenc.c 2016-10-11 10:42:02.599749985 -0400 +++ ffmpeg-git/libavformat/movenc.c 2016-10-11 11:10:22.793393487 -0400 @@ -5669,22 +5669,27 @@ track->timescale = mov->video_track_timescale; } else { track->timescale = st->time_base.den; while(track->timescale < 1) track->timescale *= 2; } +if (track->timescale > 10 && (!mov->video_track_timescale)) { +unsigned int timescale_new = (unsigned int)((double)(st->time_base.den) +* 1000 / (double)(st->time_base.num)); +av_log(s, AV_LOG_WARNING, + "WARNING codec timebase is very high. If duration is too long,\n" This is still wrapping. See https://www.ffmpeg.org/developer.html#Submitting-patches-1 + "file may not be playable by Apple Quicktime. Auto-setting\n" + "a shorter timebase %u instead of %d.\n", timescale_new, track->timescale); +track->timescale = timescale_new; +} if (st->codecpar->width > 65535 || st->codecpar->height > 65535) { -av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", st->codecpar->width, st->codecpar->height); +av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", +st->codecpar->width, st->codecpar->height); ret = AVERROR(EINVAL); goto error; } -if (track->mode == MODE_MOV && track->timescale > 10) -av_log(s, AV_LOG_WARNING, - "WARNING codec timebase is very high. If duration is too long,\n" - "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { enum AVPixelFormat pix_fmt = track->par->format; if (pix_fmt == AV_PIX_FMT_NONE && track->par->bits_per_coded_sample == 1) pix_fmt = AV_PIX_FMT_MONOWHITE; I don't think it's good to have the default behaviour destroy the original timestamps. -- Josh ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libopenjpeg: do not define OPJ_STATIC for shared builds
Setting OPJ_STATIC when building shared libraries with openjpeg 2 causes the openjpeg symbols to have visibility hidden and the final linker step to fail due to undefined references. Signed-off-by: Andreas Cadhalpun --- libavcodec/libopenjpegdec.c | 3 +++ libavcodec/libopenjpegenc.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 65167e6..1f8dadf 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -24,7 +24,10 @@ * JPEG 2000 decoder using libopenjpeg */ +#include "config.h" +#if !CONFIG_SHARED #define OPJ_STATIC +#endif #include "libavutil/common.h" #include "libavutil/imgutils.h" diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 1443551..023fdf4 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -24,7 +24,10 @@ * JPEG 2000 encoder using libopenjpeg */ +#include "config.h" +#if !CONFIG_SHARED #define OPJ_STATIC +#endif #include "libavutil/avassert.h" #include "libavutil/common.h" -- 2.9.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [OPW] OPW Project Proposal
>> added the entry with the sugested addition >> also you didnt list "Expected results" so i added some Thank you. Is the preferred language C for this kind of filter? C++ ? I don't see a qualification task on the wiki. Let me know so that that I can start with it and with writing the application. Regards, Pallavi -atana On Tue, Oct 11, 2016 at 6:01 AM, Michael Niedermayer wrote: > On Mon, Oct 10, 2016 at 10:48:19PM +0530, Pallavi Kumari wrote: > > Hi Nicholas, > > > > The use cases proposed by you is certainly very useful. You are welcome > to > > add it with the wiki content. Thanks again for your input :) > > added the entry with the sugested addition > > also you didnt list "Expected results" so i added some > > thx > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Those who are best at talking, realize last or never when they are wrong. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi/metadata: fix metadata deletion if comparison returns false
On Sat, 8 Oct 2016, Paul B Mahol wrote: On 10/6/16, Marton Balint wrote: Signed-off-by: Marton Balint --- libavfilter/f_metadata.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) lgtm Thanks, applied. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts
On 2016-10-11 at 16:27, Michael Niedermayer wrote: > > +for (i=0; ibuf_size-5; i++) { > > +soc = AV_RB16(p->buf + i); > > +if (soc == JPEG2000_SOC ) { > > +marker = AV_RB16(p->buf + i + 2); > > +marker_size = AV_RB16(p->buf + i + 4); > > +if (marker == JPEG2000_SIZ) { > > +i += marker_size + 2; > > +marker_marker = AV_RB8(p->buf + i + 2); > > missing overflow and out of array checks Ah, when I cleaned up the patch I removed the code, my bad. > also the img2 demuxer for mjpeg2000 from img2dec.c does not work > for this ? It does work if I: 1) modify j2k_probe to not only check the first 4 bytes 2) hange the score return to be less than that of mpegts. 3) Add j2k_pipe to fmt_id_type[] in libavf/utils.c I'm a bit worried about number 2. Increasing the score of mpegts might be a better idea, but I am very afraid of touching any of that. Is there a better way? -- Ståle Kristoffersen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] aacenc: use the decoder's lcg PRNG
LGTM. However, On Sat, Oct 8, 2016 at 12:20 PM, Rostislav Pehlivanov wrote: > +/** > + * linear congruential pseudorandom number generator > + * > + * @param previous_valpointer to the current state of the generator > + * > + * @return Returns a 32-bit pseudorandom integer > + */ > +static av_always_inline int lcg_random(unsigned previous_val) > +{ > +union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 > }; > +return v.s; > +} This could use a comment on where the parameters come from. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libopenjpegenc: recreate image data buffer after encoding frame
openjpeg 2 sets the data pointers of the image components to NULL, causing segfaults if the image is reused. Signed-off-by: Andreas Cadhalpun --- The relevant openjpeg2 code is: https://sources.debian.net/src/openjpeg2/2.1.2-1/src/lib/openjp2/j2k.c/?hl=10253#L10247 --- libavcodec/libopenjpegenc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 023fdf4..2f0ab20 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -776,6 +776,16 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, goto done; } +// openjpeg 2 sets the data pointers of the image components to NULL. +// Thus the image can't be reused. +opj_image_destroy(ctx->image); +ctx->image = mj2_create_image(avctx, &ctx->enc_params); +if (!ctx->image) { +av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n"); +ret = AVERROR(EINVAL); +goto done; +} + av_shrink_packet(pkt, writer.pos); #endif // OPENJPEG_MAJOR_VERSION == 1 -- 2.9.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] webvtt in dash
Hi everyone, I would like to convert dvb_subtitle to TTML and wrap in m4s to be muxed in dash. Example streams: http://vm2.dashif.org/dash/vod/testpic_2s/img_subs.mpd http://vm2.dashif.org/livesim/testpic_2s/multi_subs.mpd Can we played by: http://dashif.org/reference/players/javascript/v2.3.0/samples/dash-if-reference-player/index.html What exactly would I need to do? thanx for any pointers -- -- Haris Zukanovic ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libopenjpeg: do not define OPJ_STATIC for shared builds
On Tue, Oct 11, 2016 at 5:50 PM, Andreas Cadhalpun wrote: > Setting OPJ_STATIC when building shared libraries with openjpeg 2 causes > the openjpeg symbols to have visibility hidden and the final linker step > to fail due to undefined references. Aren't these type of macros typically related to the way the library (ie. openjpeg) is being linked into avcodec (or ffmpeg), and not what kind of library we're building? > > Signed-off-by: Andreas Cadhalpun > --- > libavcodec/libopenjpegdec.c | 3 +++ > libavcodec/libopenjpegenc.c | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c > index 65167e6..1f8dadf 100644 > --- a/libavcodec/libopenjpegdec.c > +++ b/libavcodec/libopenjpegdec.c > @@ -24,7 +24,10 @@ > * JPEG 2000 decoder using libopenjpeg > */ > > +#include "config.h" > +#if !CONFIG_SHARED > #define OPJ_STATIC > +#endif > > #include "libavutil/common.h" > #include "libavutil/imgutils.h" > diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c > index 1443551..023fdf4 100644 > --- a/libavcodec/libopenjpegenc.c > +++ b/libavcodec/libopenjpegenc.c > @@ -24,7 +24,10 @@ > * JPEG 2000 encoder using libopenjpeg > */ > > +#include "config.h" > +#if !CONFIG_SHARED > #define OPJ_STATIC > +#endif > > #include "libavutil/avassert.h" > #include "libavutil/common.h" > -- > 2.9.3 > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale
>I don't think it's good to have the default behaviour destroy the original >timestamps. Okay, I don't modify this timebase on correctly encoded videos (99.5% of my collection, and probably 100% of YouTube collection). Only on the few videos with problematic timebase I modify it, and there is a way to manually enforce some other value via a parameter. Patch submitted. Thanks for your cooperation, -Alexey Eromenko "Technologov" ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Apple Quicktime fix
--- libavformat/movenc.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8b4aa5f..0e2fc55 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5666,16 +5666,20 @@ static int mov_write_header(AVFormatContext *s) while(track->timescale < 1) track->timescale *= 2; } +if (track->timescale > 10 && (!mov->video_track_timescale)) { +unsigned int timescale_new = (unsigned int)((double)(st->time_base.den) +* 1000 / (double)(st->time_base.num)); +av_log(s, AV_LOG_WARNING, + "WARNING codec timebase is very high. If duration is too long,\n" + "file may not be playable by Apple Quicktime. Auto-setting\n" + "a shorter timebase %u instead of %d.\n", timescale_new, track->timescale); +track->timescale = timescale_new; +} if (st->codecpar->width > 65535 || st->codecpar->height > 65535) { av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", st->codecpar->width, st->codecpar->height); ret = AVERROR(EINVAL); goto error; } -if (track->mode == MODE_MOV && track->timescale > 10) -av_log(s, AV_LOG_WARNING, - "WARNING codec timebase is very high. If duration is too long,\n" - "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { -- 2.9.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Apple Quicktime fix / MP4 and MOV Timebase
*** BLURB HERE *** Alexey Eromenko (1): Apple Quicktime fix libavformat/movenc.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.9.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libopenjpeg: do not define OPJ_STATIC for shared builds
On 11.10.2016 19:13, Hendrik Leppkes wrote: > On Tue, Oct 11, 2016 at 5:50 PM, Andreas Cadhalpun > wrote: >> Setting OPJ_STATIC when building shared libraries with openjpeg 2 causes >> the openjpeg symbols to have visibility hidden and the final linker step >> to fail due to undefined references. > > Aren't these type of macros typically related to the way the library > (ie. openjpeg) is being linked into avcodec (or ffmpeg), and not what > kind of library we're building? Indeed, you're right. Building a static ffmpeg fails, as well. However, configure doesn't detect this, because it checks the header and the function separately. Also it adds -DOPJ_STATIC to EXTRALIBS, where it is rather useless, instead of to CFLAGS, where it would affect the code. This explains the explicit '#define OPJ_STATIC', which shouldn't be needed at all. And it just assumes that libopenjpeg is built statically... I'll send a patch fixing configure. Consider this patch dropped. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix
On 11/10/2016 18:24, Alexey Eromenko wrote: --- libavformat/movenc.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8b4aa5f..0e2fc55 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5666,16 +5666,20 @@ static int mov_write_header(AVFormatContext *s) while(track->timescale < 1) track->timescale *= 2; } +if (track->timescale > 10 && (!mov->video_track_timescale)) { As I said before, having this as 'default' behaviour would interfere with large, but correct timescales. This should only be a suggestion to the user. +unsigned int timescale_new = (unsigned int)((double)(st->time_base.den) +* 1000 / (double)(st->time_base.num)); You surely don't need all these casts. +av_log(s, AV_LOG_WARNING, + "WARNING codec timebase is very high. If duration is too long,\n" + "file may not be playable by Apple Quicktime. Auto-setting\n" + "a shorter timebase %u instead of %d.\n", timescale_new, track->timescale); +track->timescale = timescale_new; +} if (st->codecpar->width > 65535 || st->codecpar->height > 65535) { av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", st->codecpar->width, st->codecpar->height); ret = AVERROR(EINVAL); goto error; } -if (track->mode == MODE_MOV && track->timescale > 10) -av_log(s, AV_LOG_WARNING, - "WARNING codec timebase is very high. If duration is too long,\n" - "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); Keep the logic in the same place please. if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { -- Josh ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix / MP4 and MOV Timebase
On 11/10/2016 18:24, Alexey Eromenko wrote: *** BLURB HERE *** Alexey Eromenko (1): Apple Quicktime fix libavformat/movenc.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) This commit message isn't very useful, it doesn't describe the change at all. See: https://www.ffmpeg.org/developer.html#Patches_002fCommitting -- Josh ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option
On 10/10/2016 03:50, Steven Liu wrote: Signed-off-by: Steven Liu --- doc/protocols.texi|3 +++ libavformat/udp.c | 19 ++- libavformat/version.h |3 +++ 3 files changed, 24 insertions(+), 1 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index 3abc5f3..85a3f56 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1304,6 +1304,9 @@ input has enough packets to sustain it. When using @var{bitrate} this specifies the maximum number of bits in packet bursts. +@item local_port=@var{port} +This is a deprecated option, you can use localport instead it. + @item localport=@var{port} Override the local UDP port to bind with. diff --git a/libavformat/udp.c b/libavformat/udp.c index 3835f98..af06b89 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -86,6 +86,9 @@ typedef struct UDPContext { int pkt_size; int is_multicast; int is_broadcast; +#if FF_API_UDP_LOCAL_PORT +int local_port_deprecated; +#endif int local_port; int reuse_socket; int overrun_nonfatal; @@ -123,7 +126,9 @@ static const AVOption options[] = { { "bitrate","Bits to send per second", OFFSET(bitrate),AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, .flags = E }, { "burst_bits", "Max length of bursts in bits (when using bitrate)", OFFSET(burst_bits), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, .flags = E }, { "localport", "Local port", OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, D|E }, -{ "local_port", "Local port", OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, .flags = D|E }, +#if FF_API_UDP_LOCAL_PORT +{ "local_port", "Local port", OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, .flags = D|E }, +#endif { "localaddr", "Local address", OFFSET(localaddr), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = D|E }, { "udplite_coverage", "choose UDPLite head size which should be validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E }, { "pkt_size", "Maximum UDP packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT,{ .i64 = 1472 }, -1, INT_MAX, .flags = D|E }, @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct sockaddr_storage *addr, if (((struct sockaddr *) &s->dest_addr)->sa_family) family = ((struct sockaddr *) &s->dest_addr)->sa_family; +#if FF_API_UDP_LOCAL_PORT +if (s->local_port_deprecated >= 0) { +av_log(s, AV_LOG_WARNING, "the local_port option will be deprecated, please use localport option\n"); is deprecated +s->local_port = s->local_port_deprecated; +} +#endif res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr : NULL, s->local_port, SOCK_DGRAM, family, AI_PASSIVE); @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri) int ff_udp_get_local_port(URLContext *h) { UDPContext *s = h->priv_data; +#if FF_API_UDP_LOCAL_PORT +if (s->local_port_deprecated >= 0) { +av_log(s, AV_LOG_WARNING, "the local_port option will be deprecated, please use localport option\n"); again +s->local_port = s->local_port_deprecated; +} +#endif return s->local_port; } diff --git a/libavformat/version.h b/libavformat/version.h index 92801b4..71c03ef 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -85,6 +85,9 @@ #ifndef FF_API_HTTP_USER_AGENT #define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 58) #endif +#ifndef FF_API_UDP_LOCAL_PORT +#define FF_API_UDP_LOCAL_PORT (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif #ifndef FF_API_R_FRAME_RATE #define FF_API_R_FRAME_RATE1 Other than that LGTM, no need for two options which do the same thing. -- Josh ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] configure: fix detection of libopenjpeg
Use check_lib2 to test the header together with the function. This is necessary, because '-DOPJ_STATIC' changes what the included header does. Also add '-DOPJ_STATIC' to CFLAGS, so that it isn't necessary to hardcode this in libavcodec/libopenjpeg{dec,enc}.c. Finally, check for non-static libopenjpeg, too. Signed-off-by: Andreas Cadhalpun --- configure | 9 ++--- libavcodec/libopenjpegdec.c | 2 -- libavcodec/libopenjpegenc.c | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 8fc71fb..ff743cb 100755 --- a/configure +++ b/configure @@ -5710,9 +5710,12 @@ enabled libopencv && { check_header opencv2/core/core_c.h && require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; } enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion -enabled libopenjpeg && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC || - check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC || - check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || +enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || + check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 || + { check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || + check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 || + { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || + check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg || check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || die "ERROR: libopenjpeg not found"; } enabled libopenmpt&& require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 65167e6..b4ce834 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -24,8 +24,6 @@ * JPEG 2000 decoder using libopenjpeg */ -#define OPJ_STATIC - #include "libavutil/common.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 1443551..5042507 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -24,8 +24,6 @@ * JPEG 2000 encoder using libopenjpeg */ -#define OPJ_STATIC - #include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/imgutils.h" -- 2.9.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix
On Tue, Oct 11, 2016 at 8:29 PM, Josh de Kock wrote: > On 11/10/2016 18:24, Alexey Eromenko wrote: >> >> --- >> libavformat/movenc.c | 14 +- >> 1 file changed, 9 insertions(+), 5 deletions(-) >> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c >> index 8b4aa5f..0e2fc55 100644 >> --- a/libavformat/movenc.c >> +++ b/libavformat/movenc.c >> @@ -5666,16 +5666,20 @@ static int mov_write_header(AVFormatContext *s) >> while(track->timescale < 1) >> track->timescale *= 2; >> } >> +if (track->timescale > 10 && >> (!mov->video_track_timescale)) { > > As I said before, having this as 'default' behaviour would interfere with > large, but correct timescales. This should only be a suggestion to the user. > This happens only for very high timescale from source video, and it seems to work on Apple QuickTime/iTunes, WMP and VLC. For the vast majority videos (99%+), I _do not_ touch the timebase. And when I do touch, I give a WARNING to the user. Plus I offer to override this decision via a parameter. It should be stable and regression-free for most of our users. Is there any downside for this approach ? >> +unsigned int timescale_new = (unsigned >> int)((double)(st->time_base.den) >> +* 1000 / (double)(st->time_base.num)); > > You surely don't need all these casts. Unless I'm guaranteed to get int64 on ALL platforms, I don't see how-to write this code without casts to double-float. Int32 will over-flow, even unsigned. I can do the multiply after the division, but afraid of losing precision. And since this is not a real-time code anyway, I consider this an "okay" trade-off. Feel free to replace it with a better alternative. >> +av_log(s, AV_LOG_WARNING, >> + "WARNING codec timebase is very high. If duration >> is too long,\n" >> + "file may not be playable by Apple Quicktime. >> Auto-setting\n" >> + "a shorter timebase %u instead of %d.\n", >> timescale_new, track->timescale); >> +track->timescale = timescale_new; >> +} >> if (st->codecpar->width > 65535 || st->codecpar->height > >> 65535) { >> av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for >> mov/mp4\n", st->codecpar->width, st->codecpar->height); >> ret = AVERROR(EINVAL); >> goto error; >> } >> -if (track->mode == MODE_MOV && track->timescale > 10) >> -av_log(s, AV_LOG_WARNING, >> - "WARNING codec timebase is very high. If duration >> is too long,\n" >> - "file may not be playable by quicktime. Specify a >> shorter timebase\n" >> - "or choose different container.\n"); > > Keep the logic in the same place please. Logically timescale part 1 and timescale part 2 belong together, so I grouped them together. if (mov->video_track_timescale) { track->timescale = mov->video_track_timescale; } else { and if (track->timescale > 10) { unsigned int timescale_new = (unsigned int)((double)(st->time_base.den) Feel free to modify my code and commit, after we reach some rough consensus on the matters. -- -Alexey Eromenko "Technologov" ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi/sidedata: add filter for manipulating frame side data
On Thu, 6 Oct 2016, Marton Balint wrote: This is a similar filter to f_metadata, only it works on side data. Since adding side data from a user provided arbitrary binary string is unsafe, because current code assumes that a side data of a certain kind has the proper size, this filter only implements selection and deletion. Also, no value matching support is implemented yet, because there is no uniform way to specify a side data textually. Signed-off-by: Marton Balint --- Changelog| 1 + doc/filters.texi | 30 libavfilter/Makefile | 2 + libavfilter/allfilters.c | 2 + libavfilter/f_sidedata.c | 181 +++ libavfilter/version.h| 2 +- 6 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 libavfilter/f_sidedata.c I will apply this in a day or two. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix
>>> +unsigned int timescale_new = (unsigned >>> int)((double)(st->time_base.den) >>> +* 1000 / (double)(st->time_base.num)); >> >> You surely don't need all these casts. > > Unless I'm guaranteed to get int64 on ALL platforms, I don't see > how-to write this code without casts to double-float. Int32 will > over-flow, even unsigned. > I can do the multiply after the division, but afraid of losing precision. > And since this is not a real-time code anyway, I consider this an > "okay" trade-off. > Feel free to replace it with a better alternative. > Do you suggest moving the multiplication after the division ? -Alexey ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale
Fixes ticket #5882. While it doesn't automatically set the timescale for the user as that would destroy data without prompt, it will tell the user how they could set the timescale (as this is mostly likely what they want). Signed-off-by: Josh de Kock --- >Would it be useful to print the max duration? I'm not entirely sure, open to suggestions though. libavformat/movenc.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index d7c7158..6bada25 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s) ret = AVERROR(EINVAL); goto error; } -if (track->mode == MODE_MOV && track->timescale > 10) +if (track->mode == MODE_MOV && track->timescale > 10) { +/* NOTE: forcing setting the suggested timescale manually means ffmpeg won't destroy + * timestamps without explicit instruction. */ +unsigned int suggested = (unsigned int)av_rescale(st->time_base.den, 1000, st->time_base.num); av_log(s, AV_LOG_WARNING, "WARNING codec timebase is very high. If duration is too long,\n" "file may not be playable by quicktime. Specify a shorter timebase\n" - "or choose different container.\n"); + "or choose different container. Using -video_track_timescale %d\n" + "may fix this issue.\n", suggested); +} if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->tag == MKTAG('r','a','w',' ')) { -- 2.8.4 (Apple Git-73) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix
Hi! > Am 11.10.2016 um 19:24 schrieb Alexey Eromenko : > -if (track->mode == MODE_MOV This change is not acceptable: The problem only affects mov, not isom. Mentioning the option name in the existing warning message is of course a good idea. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix
On Tuesday, 11 October 2016, Carl Eugen Hoyos wrote: > Hi! > > > Am 11.10.2016 um 19:24 schrieb Alexey Eromenko >: > > > > -if (track->mode == MODE_MOV > > This change is not acceptable: > The problem only affects mov, not isom. > Mentioning the option name in the existing warning message is of course a > good idea. The problem affects both MOV and MP4 on Apple decoders. My goal is to create a video file that is cross platform, works everywhere. The only way to achieve that goal is to use a subset of MP4 specification. As long as my patch doesn't break video for other people, and fixes this use case, I recommend to apply it. -- -Alexey Eromenko "Technologov" ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc/developer: Mention mime type and patchwork in "Submitting patches"
On Tue, Oct 11, 2016 at 09:16:14AM +0800, Steven Liu wrote: > 2016-10-11 9:05 GMT+08:00 Michael Niedermayer : > > > Suggested-by: ronald > > Signed-off-by: Michael Niedermayer > > --- > > doc/developer.texi | 6 +- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/doc/developer.texi b/doc/developer.texi > > index cf809b9..dbe1f54 100644 > > --- a/doc/developer.texi > > +++ b/doc/developer.texi > > @@ -464,7 +464,11 @@ Patches should be posted to the > > mailing list. Use @code{git send-email} when possible since it will > > properly > > send patches without requiring extra care. If you cannot, then send > > patches > > as base64-encoded attachments, so your patch is not trashed during > > -transmission. > > +transmission. Also ensure the correct mime type is used > > +(text/x-diff or text/x-patch or at least text/plain) and that only one > > +patch is inline or attached per mail. > > +You can check @url{https://patchwork.ffmpeg.org}, if your patch does not > > show up, its mime type > > +likely was wrong. > > > > Your patch will be reviewed on the mailing list. You will likely be asked > > to make some changes and are expected to send in an improved version that > > -- > > 2.10.1 > > > > ___ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > LGTM applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/matroskaenc: don't write a FlagInterlaced element if it would write the default value
The spec says: "Mandatory elements with a default value may be left out of the file. In the absence of a mandatory element, the element's default value is used." Signed-off-by: James Almer --- libavformat/matroskaenc.c | 2 -- tests/fate/matroska.mak | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 5293a9b..a48f5bb 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -876,8 +876,6 @@ static void mkv_write_field_order(AVIOContext *pb, int mode, { switch (field_order) { case AV_FIELD_UNKNOWN: -put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED, - MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED); break; case AV_FIELD_PROGRESSIVE: put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED, diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak index 7de9a59..63a4252 100644 --- a/tests/fate/matroska.mak +++ b/tests/fate/matroska.mak @@ -4,6 +4,6 @@ FATE_MATROSKA-$(call DEMMUX, MATROSKA, MATROSKA) += fate-matroska-remux fate-matroska-remux: CMD = md5 -i $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -color_trc 4 -c:v copy -fflags +bitexact -strict -2 -f matroska fate-matroska-remux: CMP = oneline -fate-matroska-remux: REF = d1a5fc15908ba10ca3efa282059ca79f +fate-matroska-remux: REF = 84e950f59677e306f944fca484888c5d FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes) -- 2.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix / MP4 and MOV Timebase
On Tue, Oct 11, 2016 at 19:32:14 +0100, Josh de Kock wrote: > On 11/10/2016 18:24, Alexey Eromenko wrote: > > *** BLURB HERE *** > > This commit message isn't very useful, it doesn't describe the change at > all. See: > https://www.ffmpeg.org/developer.html#Patches_002fCommitting That's the cover letter "git format-patch --cover-letter" creates for you, but you need to/should edit it before sending. The proper patch has the commit message from your local repo. (I too have quite a hassle with creating the intermediate files, reformatting the subjects when sending and so on. Perhaps I just haven't gotten the flow of git well enough.) Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [OPW] OPW Project Proposal
On Tue, Oct 11, 2016 at 09:52:08PM +0530, Pallavi Kumari wrote: > >> added the entry with the sugested addition > > >> also you didnt list "Expected results" so i added some > > Thank you. > > Is the preferred language C for this kind of filter? C++ ? C (optional assembly optimizations are welcome too for speed critical parts) > > I don't see a qualification task on the wiki. Let me know so that that I > can start with it and with writing the application. added something also submit your code early! there likely will be some comments and suggestions to change this and that. early submission means less work changing things thanks > > > Regards, > Pallavi > -atana > > > On Tue, Oct 11, 2016 at 6:01 AM, Michael Niedermayer > wrote: > > > On Mon, Oct 10, 2016 at 10:48:19PM +0530, Pallavi Kumari wrote: > > > Hi Nicholas, > > > > > > The use cases proposed by you is certainly very useful. You are welcome > > to > > > add it with the wiki content. Thanks again for your input :) > > > > added the entry with the sugested addition > > > > also you didnt list "Expected results" so i added some > > > > thx > > > > [...] > > -- > > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > > > Those who are best at talking, realize last or never when they are wrong. > > > > ___ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Never trust a computer, one day, it may think you are the virus. -- Compn signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: don't write a FlagInterlaced element if it would write the default value
On Tue, Oct 11, 2016 at 11:33 PM, James Almer wrote: > The spec says: > "Mandatory elements with a default value may be left out of the file. In the > absence > of a mandatory element, the element's default value is used." > > Signed-off-by: James Almer > --- > libavformat/matroskaenc.c | 2 -- > tests/fate/matroska.mak | 2 +- > 2 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c > index 5293a9b..a48f5bb 100644 > --- a/libavformat/matroskaenc.c > +++ b/libavformat/matroskaenc.c > @@ -876,8 +876,6 @@ static void mkv_write_field_order(AVIOContext *pb, int > mode, > { > switch (field_order) { > case AV_FIELD_UNKNOWN: > -put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED, > - MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED); > break; > case AV_FIELD_PROGRESSIVE: > put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED, > diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak > index 7de9a59..63a4252 100644 > --- a/tests/fate/matroska.mak > +++ b/tests/fate/matroska.mak > @@ -4,6 +4,6 @@ > FATE_MATROSKA-$(call DEMMUX, MATROSKA, MATROSKA) += fate-matroska-remux > fate-matroska-remux: CMD = md5 -i > $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -color_trc 4 -c:v > copy -fflags +bitexact -strict -2 -f matroska > fate-matroska-remux: CMP = oneline > -fate-matroska-remux: REF = d1a5fc15908ba10ca3efa282059ca79f > +fate-matroska-remux: REF = 84e950f59677e306f944fca484888c5d > > FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes) > -- > 2.9.1 > LGTM, writing unknown has no benefits either way. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: don't write a FlagInterlaced element if it would write the default value
On 10/11/2016 6:51 PM, Hendrik Leppkes wrote: > On Tue, Oct 11, 2016 at 11:33 PM, James Almer wrote: >> The spec says: >> "Mandatory elements with a default value may be left out of the file. In the >> absence >> of a mandatory element, the element's default value is used." >> >> Signed-off-by: James Almer >> --- >> libavformat/matroskaenc.c | 2 -- >> tests/fate/matroska.mak | 2 +- >> 2 files changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c >> index 5293a9b..a48f5bb 100644 >> --- a/libavformat/matroskaenc.c >> +++ b/libavformat/matroskaenc.c >> @@ -876,8 +876,6 @@ static void mkv_write_field_order(AVIOContext *pb, int >> mode, >> { >> switch (field_order) { >> case AV_FIELD_UNKNOWN: >> -put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED, >> - MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED); >> break; >> case AV_FIELD_PROGRESSIVE: >> put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED, >> diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak >> index 7de9a59..63a4252 100644 >> --- a/tests/fate/matroska.mak >> +++ b/tests/fate/matroska.mak >> @@ -4,6 +4,6 @@ >> FATE_MATROSKA-$(call DEMMUX, MATROSKA, MATROSKA) += fate-matroska-remux >> fate-matroska-remux: CMD = md5 -i >> $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -color_trc 4 -c:v >> copy -fflags +bitexact -strict -2 -f matroska >> fate-matroska-remux: CMP = oneline >> -fate-matroska-remux: REF = d1a5fc15908ba10ca3efa282059ca79f >> +fate-matroska-remux: REF = 84e950f59677e306f944fca484888c5d >> >> FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes) >> -- >> 2.9.1 >> > > LGTM, writing unknown has no benefits either way. > > - Hendrik Pushed, thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale
On Tue, Oct 11, 2016 at 08:06:39PM +0100, Josh de Kock wrote: > Fixes ticket #5882. While it doesn't automatically set the timescale > for the user as that would destroy data without prompt, it will tell > the user how they could set the timescale (as this is mostly likely > what they want). > > Signed-off-by: Josh de Kock > --- > > >Would it be useful to print the max duration? > I'm not entirely sure, open to suggestions though. > > libavformat/movenc.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/libavformat/movenc.c b/libavformat/movenc.c > index d7c7158..6bada25 100644 > --- a/libavformat/movenc.c > +++ b/libavformat/movenc.c > @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s) > ret = AVERROR(EINVAL); > goto error; > } > -if (track->mode == MODE_MOV && track->timescale > 10) > +if (track->mode == MODE_MOV && track->timescale > 10) { > +/* NOTE: forcing setting the suggested timescale manually > means ffmpeg won't destroy > + * timestamps without explicit instruction. */ > +unsigned int suggested = (unsigned > int)av_rescale(st->time_base.den, 1000, st->time_base.num); > av_log(s, AV_LOG_WARNING, > "WARNING codec timebase is very high. If duration is > too long,\n" > "file may not be playable by quicktime. Specify a > shorter timebase\n" > - "or choose different container.\n"); > + "or choose different container. Using > -video_track_timescale %d\n" > + "may fix this issue.\n", suggested); maybe a -max_timescale parameter would be usefull users could with that limit teh value without having to do something per file [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [OPW] OPW Project Proposal
On Tue, Oct 11, 2016 at 11:54:04PM +0200, Michael Niedermayer wrote: > On Tue, Oct 11, 2016 at 09:52:08PM +0530, Pallavi Kumari wrote: > > >> added the entry with the sugested addition > > > > >> also you didnt list "Expected results" so i added some > > > > Thank you. > > > > Is the preferred language C for this kind of filter? C++ ? > > C (optional assembly optimizations are welcome too for speed critical > parts) > > > > > > I don't see a qualification task on the wiki. Let me know so that that I > > can start with it and with writing the application. > > added something > > also submit your code early! there likely will be some comments and > suggestions to change this and that. early submission means less work > changing things also when you start working on a qualification task please add yourself to https://trac.ffmpeg.org/wiki/SponsoringPrograms/Outreachy/2016-12-Qualis [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: fix detection of libopenjpeg
Oh man, I literally just wrote a patch for this today. You beat me by 6 hours. Anyway, thanks for the patch! On Tue, Oct 11, 2016 at 11:37 AM, Andreas Cadhalpun < andreas.cadhal...@googlemail.com> wrote: > Use check_lib2 to test the header together with the function. This is > necessary, because '-DOPJ_STATIC' changes what the included header does. > > Also add '-DOPJ_STATIC' to CFLAGS, so that it isn't necessary to > hardcode this in libavcodec/libopenjpeg{dec,enc}.c. > > Finally, check for non-static libopenjpeg, too. > > Signed-off-by: Andreas Cadhalpun > --- > configure | 9 ++--- > libavcodec/libopenjpegdec.c | 2 -- > libavcodec/libopenjpegenc.c | 2 -- > 3 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/configure b/configure > index 8fc71fb..ff743cb 100755 > --- a/configure > +++ b/configure > @@ -5710,9 +5710,12 @@ enabled libopencv && { check_header > opencv2/core/core_c.h && > require opencv opencv2/core/core_c.h > cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || > require_pkg_config opencv opencv/cxcore.h > cvCreateImageHeader; } > enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h > WelsGetCodecVersion > -enabled libopenjpeg && { check_lib openjpeg-2.1/openjpeg.h > opj_version -lopenjp2 -DOPJ_STATIC || > - check_lib openjpeg-2.0/openjpeg.h > opj_version -lopenjp2 -DOPJ_STATIC || > - check_lib openjpeg-1.5/openjpeg.h > opj_version -lopenjpeg -DOPJ_STATIC || > +enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h > opj_version -lopenjp2 -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || > Use add_cppflags instead of add_cflags. The macro isn't needed for linking. > + check_lib2 openjpeg-2.1/openjpeg.h > opj_version -lopenjp2 || > + { check_lib openjpeg-2.0/openjpeg.h > opj_version -lopenjp2 -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || > You can drop the changes for v2.0 and below. Only v2.1 needs the check. The new OPJ_STATIC behavior was introduced in OpenJPEG v2.1.1. > + check_lib2 openjpeg-2.0/openjpeg.h > opj_version -lopenjp2 || > + { check_lib openjpeg-1.5/openjpeg.h > opj_version -lopenjpeg -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || > + check_lib2 openjpeg-1.5/openjpeg.h > opj_version -lopenjpeg || > check_lib openjpeg.h opj_version > -lopenjpeg -DOPJ_STATIC || > die "ERROR: libopenjpeg not found"; } > enabled libopenmpt&& require_pkg_config "libopenmpt >= 0.2.6557" > libopenmpt/libopenmpt.h openmpt_module_create > diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c > index 65167e6..b4ce834 100644 > --- a/libavcodec/libopenjpegdec.c > +++ b/libavcodec/libopenjpegdec.c > @@ -24,8 +24,6 @@ > * JPEG 2000 decoder using libopenjpeg > */ > > -#define OPJ_STATIC > - > #include "libavutil/common.h" > #include "libavutil/imgutils.h" > #include "libavutil/intreadwrite.h" > diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c > index 1443551..5042507 100644 > --- a/libavcodec/libopenjpegenc.c > +++ b/libavcodec/libopenjpegenc.c > @@ -24,8 +24,6 @@ > * JPEG 2000 encoder using libopenjpeg > */ > > -#define OPJ_STATIC > - > #include "libavutil/avassert.h" > #include "libavutil/common.h" > #include "libavutil/imgutils.h" > -- > 2.9.3 > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libopenjpegenc: recreate image data buffer after encoding frame
On Tue, Oct 11, 2016 at 9:57 AM, Andreas Cadhalpun < andreas.cadhal...@googlemail.com> wrote: > openjpeg 2 sets the data pointers of the image components to NULL, > causing segfaults if the image is reused. > I've never seen this issue. Is there a particular version of OpenJPEG or reproduction steps available? Where are the data pointers being set to NULL here? Signed-off-by: Andreas Cadhalpun > --- > > The relevant openjpeg2 code is: > https://sources.debian.net/src/openjpeg2/2.1.2-1/src/lib/ > openjp2/j2k.c/?hl=10253#L10247 > > --- > libavcodec/libopenjpegenc.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c > index 023fdf4..2f0ab20 100644 > --- a/libavcodec/libopenjpegenc.c > +++ b/libavcodec/libopenjpegenc.c > @@ -776,6 +776,16 @@ static int libopenjpeg_encode_frame(AVCodecContext > *avctx, AVPacket *pkt, > goto done; > } > > +// openjpeg 2 sets the data pointers of the image components to NULL. > +// Thus the image can't be reused. > +opj_image_destroy(ctx->image); > +ctx->image = mj2_create_image(avctx, &ctx->enc_params); > +if (!ctx->image) { > +av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n"); > +ret = AVERROR(EINVAL); > +goto done; > +} > + > av_shrink_packet(pkt, writer.pos); > #endif // OPENJPEG_MAJOR_VERSION == 1 > > -- > 2.9.3 > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: fix detection of libopenjpeg
On Tue, Oct 11, 2016 at 6:35 PM, Michael Bradshaw wrote: > > On Tue, Oct 11, 2016 at 11:37 AM, Andreas Cadhalpun < > andreas.cadhal...@googlemail.com> wrote: >> >> + check_lib2 openjpeg-2.1/openjpeg.h >> opj_version -lopenjp2 || >> + { check_lib openjpeg-2.0/openjpeg.h >> opj_version -lopenjp2 -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || >> > > You can drop the changes for v2.0 and below. Only v2.1 needs the check. > The new OPJ_STATIC behavior was introduced in OpenJPEG v2.1.1. > Gah, this comment wasn't very clear. I mean that all the checks for v2.0 and below should have -DOPJ_STATIC && add_cppflags -DOPJ_STATIC. Only v2.1 needs to worry about possibly not using OPJ_STATIC. > + check_lib2 openjpeg-2.0/openjpeg.h >> opj_version -lopenjp2 || >> + { check_lib openjpeg-1.5/openjpeg.h >> opj_version -lopenjpeg -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } || >> + check_lib2 openjpeg-1.5/openjpeg.h >> opj_version -lopenjpeg || > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] add hds demuxer
init add hds demuxer Based-on: patch by CORY MCCARTHY Based-on: patch by Gorilla Maguila Signed-off-by: Steven Liu --- configure |5 + libavformat/Makefile |1 + libavformat/allformats.c |2 +- libavformat/amfmetadata.c | 219 + libavformat/amfmetadata.h | 39 +++ libavformat/f4fbox.c | 381 +++ libavformat/f4fbox.h | 95 ++ libavformat/f4mmanifest.c | 325 +++ libavformat/f4mmanifest.h | 59 libavformat/flvtag.c | 371 ++ libavformat/flvtag.h | 32 ++ libavformat/hdsdec.c | 759 + 12 files changed, 2287 insertions(+), 1 deletions(-) create mode 100644 libavformat/amfmetadata.c create mode 100644 libavformat/amfmetadata.h create mode 100644 libavformat/f4fbox.c create mode 100644 libavformat/f4fbox.h create mode 100644 libavformat/f4mmanifest.c create mode 100644 libavformat/f4mmanifest.h create mode 100644 libavformat/flvtag.c create mode 100644 libavformat/flvtag.h create mode 100644 libavformat/hdsdec.c diff --git a/configure b/configure index e014615..48337a6 100755 --- a/configure +++ b/configure @@ -295,6 +295,7 @@ External library support: on OSX if openssl and gnutls are not used [autodetect] --enable-x11grab enable X11 grabbing (legacy) [no] --disable-xlib disable xlib [autodetect] + --disable-xml2 disable XML parsing using the C library libxml2 [autodetect] --disable-zlib disable zlib [autodetect] The following libraries provide various hardware acceleration features: @@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST=" videotoolbox x11grab xlib +xml2 zlib " @@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser" f4v_muxer_select="mov_muxer" fifo_muxer_deps="threads" flac_demuxer_select="flac_parser" +hds_demuxer_select="xml2" hds_muxer_select="flv_muxer" hls_muxer_select="mpegts_muxer" image2_alias_pix_demuxer_select="image2_demuxer" @@ -5624,6 +5627,8 @@ disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma +disabled xml2 || require_pkg_config libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion || disable xml2 + check_lib math.h sin -lm && LIBM="-lm" disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd diff --git a/libavformat/Makefile b/libavformat/Makefile index 5d827d3..e2b4dd4 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER) += h264dec.o rawdec.o OBJS-$(CONFIG_H264_MUXER)+= rawenc.o OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o +OBJS-$(CONFIG_HDS_DEMUXER) += hdsdec.o amfmetadata.o f4mmanifest.o f4fbox.o flvtag.o OBJS-$(CONFIG_HEVC_DEMUXER) += hevcdec.o rawdec.o OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o OBJS-$(CONFIG_HLS_DEMUXER) += hls.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 6a216ef..39505c3 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -146,9 +146,9 @@ void av_register_all(void) REGISTER_MUXDEMUX(H263, h263); REGISTER_MUXDEMUX(H264, h264); REGISTER_MUXER (HASH, hash); -REGISTER_MUXER (HDS, hds); REGISTER_MUXDEMUX(HEVC, hevc); REGISTER_MUXDEMUX(HLS, hls); +REGISTER_MUXDEMUX(HDS, hds); REGISTER_DEMUXER (HNM, hnm); REGISTER_MUXDEMUX(ICO, ico); REGISTER_DEMUXER (IDCIN,idcin); diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c new file mode 100644 index 000..72e67cd --- /dev/null +++ b/libavformat/amfmetadata.c @@ -0,0 +1,219 @@ +/* + * Adobe Action Message Format Parser + * Copyright (c) 2013 Cory McCarthy + * + * 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 + */ + +
[FFmpeg-devel] [PATCH] add init hds demuxer
TODO: docs, version bump, TODO: option passing support (as seperate commit/patch) TODO: refine AMF parser TODO: refine Metadata Steven Liu (1): add hds demuxer configure |5 + libavformat/Makefile |1 + libavformat/allformats.c |2 +- libavformat/amfmetadata.c | 219 + libavformat/amfmetadata.h | 39 +++ libavformat/f4fbox.c | 381 +++ libavformat/f4fbox.h | 95 ++ libavformat/f4mmanifest.c | 325 +++ libavformat/f4mmanifest.h | 59 libavformat/flvtag.c | 371 ++ libavformat/flvtag.h | 32 ++ libavformat/hdsdec.c | 759 + 12 files changed, 2287 insertions(+), 1 deletions(-) create mode 100644 libavformat/amfmetadata.c create mode 100644 libavformat/amfmetadata.h create mode 100644 libavformat/f4fbox.c create mode 100644 libavformat/f4fbox.h create mode 100644 libavformat/f4mmanifest.c create mode 100644 libavformat/f4mmanifest.h create mode 100644 libavformat/flvtag.c create mode 100644 libavformat/flvtag.h create mode 100644 libavformat/hdsdec.c ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option
Signed-off-by: Steven Liu --- doc/protocols.texi|3 +++ libavformat/udp.c | 19 ++- libavformat/version.h |3 +++ 3 files changed, 24 insertions(+), 1 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index 3abc5f3..85a3f56 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1304,6 +1304,9 @@ input has enough packets to sustain it. When using @var{bitrate} this specifies the maximum number of bits in packet bursts. +@item local_port=@var{port} +This is a deprecated option, you can use localport instead it. + @item localport=@var{port} Override the local UDP port to bind with. diff --git a/libavformat/udp.c b/libavformat/udp.c index 3835f98..af06b89 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -86,6 +86,9 @@ typedef struct UDPContext { int pkt_size; int is_multicast; int is_broadcast; +#if FF_API_UDP_LOCAL_PORT +int local_port_deprecated; +#endif int local_port; int reuse_socket; int overrun_nonfatal; @@ -123,7 +126,9 @@ static const AVOption options[] = { { "bitrate","Bits to send per second", OFFSET(bitrate),AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, .flags = E }, { "burst_bits", "Max length of bursts in bits (when using bitrate)", OFFSET(burst_bits), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, .flags = E }, { "localport", "Local port", OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, D|E }, -{ "local_port", "Local port", OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, .flags = D|E }, +#if FF_API_UDP_LOCAL_PORT +{ "local_port", "Local port", OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, .flags = D|E }, +#endif { "localaddr", "Local address", OFFSET(localaddr), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = D|E }, { "udplite_coverage", "choose UDPLite head size which should be validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E }, { "pkt_size", "Maximum UDP packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT,{ .i64 = 1472 }, -1, INT_MAX, .flags = D|E }, @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct sockaddr_storage *addr, if (((struct sockaddr *) &s->dest_addr)->sa_family) family = ((struct sockaddr *) &s->dest_addr)->sa_family; +#if FF_API_UDP_LOCAL_PORT +if (s->local_port_deprecated >= 0) { +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated, please use localport option\n"); +s->local_port = s->local_port_deprecated; +} +#endif res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr : NULL, s->local_port, SOCK_DGRAM, family, AI_PASSIVE); @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri) int ff_udp_get_local_port(URLContext *h) { UDPContext *s = h->priv_data; +#if FF_API_UDP_LOCAL_PORT +if (s->local_port_deprecated >= 0) { +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated, please use localport option\n"); +s->local_port = s->local_port_deprecated; +} +#endif return s->local_port; } diff --git a/libavformat/version.h b/libavformat/version.h index 92801b4..71c03ef 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -85,6 +85,9 @@ #ifndef FF_API_HTTP_USER_AGENT #define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 58) #endif +#ifndef FF_API_UDP_LOCAL_PORT +#define FF_API_UDP_LOCAL_PORT (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif #ifndef FF_API_R_FRAME_RATE #define FF_API_R_FRAME_RATE1 -- 1.7.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/3] Selftest coverage for libavutil/fifo.c
code coverage for av_fifo_grow(...), av_fifo_generic_peek(...) Modified the folling files to get the selftest program to compile with: "make fate-fifo2" --- libavutil/Makefile | 1 + libavutil/tests/fifo2.c | 3 ++- tests/fate/libavutil.mak | 4 tests/ref/fate/fifo2 | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/ref/fate/fifo2 diff --git a/libavutil/Makefile b/libavutil/Makefile index 0fa90fe..a34171e 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -195,6 +195,7 @@ TESTPROGS = adler32 \ eval\ file\ fifo\ +fifo2 \ float_dsp \ hash\ hmac\ diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c index 923feee..e40b8cd 100644 --- a/libavutil/tests/fifo2.c +++ b/libavutil/tests/fifo2.c @@ -35,7 +35,8 @@ int main(void) /*fill fifo buffer*/ -if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != sizeof(elem)) { +if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != +sizeof(elem)) { fprintf(stderr, "written incorrect number of bytes\n"); return 1; diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak index 6fbad64..fdf9086 100644 --- a/tests/fate/libavutil.mak +++ b/tests/fate/libavutil.mak @@ -69,6 +69,10 @@ FATE_LIBAVUTIL += fate-fifo fate-fifo: libavutil/tests/fifo$(EXESUF) fate-fifo: CMD = run libavutil/tests/fifo +FATE_LIBAVUTIL += fate-fifo2 +fate-fifo2: libavutil/tests/fifo2$(EXESUF) +fate-fifo2: CMD = run libavutil/tests/fifo2 + FATE_LIBAVUTIL += fate-float-dsp fate-float-dsp: libavutil/tests/float_dsp$(EXESUF) fate-float-dsp: CMD = run libavutil/tests/float_dsp $(CPUFLAGS:%=-c%) diff --git a/tests/ref/fate/fifo2 b/tests/ref/fate/fifo2 new file mode 100644 index 000..8df9243 --- /dev/null +++ b/tests/ref/fate/fifo2 @@ -0,0 +1,3 @@ +fifo->buffer: 0, 2, 4, 6, 8, 10, 12, +space before av_fifo_grow :0 +space after av_fifo_grow :28 -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/3] Selftest coverage for libavutil/fifo.c
Fixed trailing whitespace in fifo2.c selftest and fifo2 reference file that prevented the patch from being applied cleanly to git master --- libavutil/tests/fifo2.c | 17 + tests/ref/fate/fifo2| 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c index e40b8cd..11050c6 100644 --- a/libavutil/tests/fifo2.c +++ b/libavutil/tests/fifo2.c @@ -30,12 +30,13 @@ int main(void) int32_t elem[] = {0, 2, 4, 6, 8, 10, 12}; AVFifoBuffer* fifo; -data_size = sizeof(elem[0]); -fifo = av_fifo_alloc(sizeof(elem)); - /*fill fifo buffer*/ -if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != +data_size = sizeof(elem[0]); +fifo = av_fifo_alloc(sizeof(elem)); +space_size = av_fifo_space(fifo); + +if (av_fifo_generic_write(fifo, (void*)elem, space_size, NULL) != sizeof(elem)) { fprintf(stderr, "written incorrect number of bytes\n"); @@ -50,13 +51,13 @@ int main(void) (void) av_fifo_generic_peek(fifo, data_arr, fifo_size, NULL); -printf("fifo->buffer: "); +printf("fifo->buffer\t\t\t:"); for(offset = 0; offset < fifo_size/data_size; ++offset){ -printf("%" PRId32 ", ", data_arr[offset]); +printf(" %" PRId32 ",", data_arr[offset]); } space_size = av_fifo_space(fifo); -printf("\nspace before av_fifo_grow\t:%" PRId16 "\n", space_size); +printf("\nspace before av_fifo_grow\t: %" PRId16 "\n", space_size); /* grow AVFifoBuffer */ @@ -66,7 +67,7 @@ int main(void) space_size = av_fifo_space(fifo); -printf("space after av_fifo_grow\t:%" PRId16 "\n", space_size); +printf("space after av_fifo_grow\t: %" PRId16 "\n", space_size); /* free AVFifoBuffer and data_arr */ diff --git a/tests/ref/fate/fifo2 b/tests/ref/fate/fifo2 index 8df9243..b697c03 100644 --- a/tests/ref/fate/fifo2 +++ b/tests/ref/fate/fifo2 @@ -1,3 +1,3 @@ -fifo->buffer: 0, 2, 4, 6, 8, 10, 12, -space before av_fifo_grow :0 -space after av_fifo_grow :28 +fifo->buffer: 0, 2, 4, 6, 8, 10, 12, +space before av_fifo_grow : 0 +space after av_fifo_grow : 28 -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/3] Improve selftest coverage for libavutil library
Code coverage for av_fifo_generic_peek(...) and av_fifo_grow(...) . --- libavutil/tests/fifo2.c | 77 + 1 file changed, 77 insertions(+) create mode 100644 libavutil/tests/fifo2.c diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c new file mode 100644 index 000..923feee --- /dev/null +++ b/libavutil/tests/fifo2.c @@ -0,0 +1,77 @@ +/* + * 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 +#include +#include "libavutil/fifo.h" + + + +int main(void) +{ + +int16_t offset, fifo_size, space_size, data_size; +int32_t data, *data_arr; +int32_t elem[] = {0, 2, 4, 6, 8, 10, 12}; +AVFifoBuffer* fifo; + +data_size = sizeof(elem[0]); +fifo = av_fifo_alloc(sizeof(elem)); + +/*fill fifo buffer*/ + +if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != sizeof(elem)) { + +fprintf(stderr, "written incorrect number of bytes\n"); +return 1; +} + + +/* generic peek at fifo */ + +fifo_size = av_fifo_size(fifo); +data_arr = (int32_t*)malloc(fifo_size); + +(void) av_fifo_generic_peek(fifo, data_arr, fifo_size, NULL); + +printf("fifo->buffer: "); +for(offset = 0; offset < fifo_size/data_size; ++offset){ +printf("%" PRId32 ", ", data_arr[offset]); +} + +space_size = av_fifo_space(fifo); +printf("\nspace before av_fifo_grow\t:%" PRId16 "\n", space_size); + +/* grow AVFifoBuffer */ + +data = av_fifo_grow(fifo, data_size); +if(data < 0) +printf("\n%s\n", "failure growing fifo\n"); + + +space_size = av_fifo_space(fifo); +printf("space after av_fifo_grow\t:%" PRId16 "\n", space_size); + + +/* free AVFifoBuffer and data_arr */ + +av_fifo_free(fifo); +free(data_arr); + +return 0; +} -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/rtmpproto: Fix RTMP control message handling error in listen mode.
Fix problem to fail by a RTMP Control Message except "Set Chunk Size (1)" after an RTMP handshake. When 'nginx-rtmp-module' relays an RTMP, it sends not only control message 'Set Chunk Size (1)' but also 'Window Acknowledgement Size (5)'. --- libavformat/rtmpproto.c | 47 ++- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 95d1c1d..b118b4e 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -156,6 +156,8 @@ static const uint8_t rtmp_server_key[] = { }; static int handle_chunk_size(URLContext *s, RTMPPacket *pkt); +static int handle_server_bw(URLContext *s, RTMPPacket *pkt); +static int handle_client_bw(URLContext *s, RTMPPacket *pkt); static int add_tracked_method(RTMPContext *rt, const char *name, int id) { @@ -399,6 +401,9 @@ static int gen_connect(URLContext *s, RTMPContext *rt) return rtmp_send_packet(rt, &pkt, 1); } + +#define RTMP_CTRL_ABORT_MESSAGE (2) + static int read_connect(URLContext *s, RTMPContext *rt) { RTMPPacket pkt = { 0 }; @@ -411,18 +416,42 @@ static int read_connect(URLContext *s, RTMPContext *rt) uint8_t tmpstr[256]; GetByteContext gbc; -if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size, - &rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0) -return ret; - -if (pkt.type == RTMP_PT_CHUNK_SIZE) { -if ((ret = handle_chunk_size(s, &pkt)) < 0) -return ret; - -ff_rtmp_packet_destroy(&pkt); +// handle RTMP Protocol Control Messages +for (;;) { if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size, &rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0) return ret; +#ifdef DEBUG +ff_rtmp_packet_dump(s, &pkt); +#endif +if (pkt.type == RTMP_PT_CHUNK_SIZE) { +if ((ret = handle_chunk_size(s, &pkt)) < 0) { +ff_rtmp_packet_destroy(&pkt); +return ret; +} +} else if (pkt.type == RTMP_CTRL_ABORT_MESSAGE) { +av_log(s, AV_LOG_ERROR, "received abort message\n"); +ff_rtmp_packet_destroy(&pkt); +return AVERROR_UNKNOWN; +} else if (pkt.type == RTMP_PT_BYTES_READ) { +av_log(s, AV_LOG_TRACE, "received acknowledgement\n"); +} else if (pkt.type == RTMP_PT_SERVER_BW) { +if ((ret = handle_server_bw(s, &pkt)) < 0) { +ff_rtmp_packet_destroy(&pkt); +return ret; +} +} else if (pkt.type == RTMP_PT_CLIENT_BW) { +if ((ret = handle_client_bw(s, &pkt)) < 0) { +ff_rtmp_packet_destroy(&pkt); +return ret; +} +} else if (pkt.type == RTMP_PT_INVOKE) { +// received RTMP Command Message +break; +} else { +av_log(s, AV_LOG_ERROR, "Unknown control message type (%d)\n", pkt.type); +} +ff_rtmp_packet_destroy(&pkt); } cp = pkt.data; -- 2.8.4 (Apple Git-73) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel