Re: [FFmpeg-devel] [PATCH] lavfi: add drawgraph filter
Dana 26. 6. 2015. 21:26 osoba Dave Rice d...@dericed.com napisala je: Hi, On Jun 26, 2015, at 11:27 AM, Paul B Mahol one...@gmail.com wrote: Signed-off-by: Paul B Mahol one...@gmail.com --- Waiting for comments and flames. Here are some comments and flames: I noticed that when I set min to a value greater than max. I get a crash with Bus error: 10. Good catch, I forgot about checking this. There may be an issue with negative values for min/max. When I run: ffplay -f lavfi -i color=gray -vf signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255 I see a line scroll across the center of the window. When I change min to -255 I see a line at ~3/4 down the frame, where I would expect -128 to be. Does the min and max expect non-negative numbers. It is, but it doesn't draw what you expect. It should start from middle and either go up or down. It could be helpful to include equations within foreground, such as: ffplay -i movie.mkv -vf signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255:foreground=if(gt(lavfi.signalstats.YAVG\,128)\,green\,red) or actually I could probably subsequently use geq to accomplish that. Will do, filter does not redraw whole frame it just updates columns so different colors for bars/dots make sense in special scenarios. I planned to do multiple graphs for multiple metadata but perhaps it is better to call filter multiple times and then blend frames together... Can you alias 's' for 'size' as many of the other filters do. Will do. This is very helpful, thanks! Do you have some other interesting idea worth implementing in filter I'm listening. Dave ___ 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] Fixes the bug of comparing zero bytes. Also new check for linesize is added.
On Sat, Jun 27, 2015 at 02:01:15AM +0300, Ludmila Glinskih wrote: --- libavcodec/api-flac-test.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libavcodec/api-flac-test.c b/libavcodec/api-flac-test.c index 402d4df..4cd0db7 100644 --- a/libavcodec/api-flac-test.c +++ b/libavcodec/api-flac-test.c @@ -112,10 +112,10 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, AVFrame *in_frame, *out_frame; uint8_t *raw_in = NULL, *raw_out = NULL; int in_offset = 0, out_offset = 0; -int frame_data_size = 0; int result = 0; int got_output = 0; int i = 0; +int in_frame_bytes, out_frame_bytes; in_frame = av_frame_alloc(); if (!in_frame) { @@ -156,8 +156,13 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, generate_raw_frame((uint16_t*)(in_frame-data[0]), i, enc_ctx-sample_rate, enc_ctx-channels, enc_ctx-frame_size); -memcpy(raw_in + in_offset, in_frame-data[0], in_frame-linesize[0]); -in_offset += in_frame-linesize[0]; +in_frame_bytes = in_frame-nb_samples * in_frame-channels * sizeof(uint16_t); +if (in_frame_bytes != in_frame-linesize[0]) { +av_log(NULL, AV_LOG_ERROR, Incorrect value of input frame linesize\n); +return 1; +} The linesize is not guranteed to match the active area i think you can just ignore the linesize completely or if you like check that it is = in_frame_bytes +memcpy(raw_in + in_offset, in_frame-data[0], in_frame_bytes); +in_offset += in_frame_bytes; result = avcodec_encode_audio2(enc_ctx, enc_pkt, in_frame, got_output); if (result 0) { av_log(NULL, AV_LOG_ERROR, Error encoding audio frame\n); @@ -192,14 +197,19 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, av_log(NULL, AV_LOG_ERROR, Error frames before and after decoding has different sample format\n); return AVERROR_UNKNOWN; } -memcpy(raw_out + out_offset, out_frame-data[0], out_frame-linesize[0]); -out_offset += out_frame-linesize[0]; +out_frame_bytes = out_frame-nb_samples * out_frame-channels * sizeof(uint16_t); AVFrame.channels should e accessed through av_frame_get_channels() libavutil/frame.h lists which AVFrame fields can be accessed directly from outide avutil [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi: add drawgraph filter
On Jun 27, 2015, at 3:47 AM, Paul B Mahol one...@gmail.com wrote: Dana 26. 6. 2015. 21:26 osoba Dave Rice d...@dericed.com napisala je: Hi, On Jun 26, 2015, at 11:27 AM, Paul B Mahol one...@gmail.com wrote: Signed-off-by: Paul B Mahol one...@gmail.com --- Waiting for comments and flames. Here are some comments and flames: I noticed that when I set min to a value greater than max. I get a crash with Bus error: 10. Good catch, I forgot about checking this. There may be an issue with negative values for min/max. When I run: ffplay -f lavfi -i color=gray -vf signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255 I see a line scroll across the center of the window. When I change min to -255 I see a line at ~3/4 down the frame, where I would expect -128 to be. Does the min and max expect non-negative numbers. It is, but it doesn't draw what you expect. It should start from middle and either go up or down. Not sure I understand ‘start from the middle’ vs min/max. Can you clarify in the documentation. It could be helpful to include equations within foreground, such as: ffplay -i movie.mkv -vf signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255:foreground=if(gt(lavfi.signalstats.YAVG\,128)\,green\,red) or actually I could probably subsequently use geq to accomplish that. Will do, filter does not redraw whole frame it just updates columns so different colors for bars/dots make sense in special scenarios. Updating columns (as opposed to whole frame redraw) was what I was imagining. This would be helpful for showing when a value crosses a particular threshold. I planned to do multiple graphs for multiple metadata but perhaps it is better to call filter multiple times and then blend frames together… Yes, I was thinking of asking for that in a comment earlier but also thought calling it multiple times would be better. In many cases one may need different min/max values and it’s likely one would be different foreground values per value, so I think multiple calls would be fine. Can you alias 's' for 'size' as many of the other filters do. Will do. This is very helpful, thanks! Do you have some other interesting idea worth implementing in filter I'm listening. This drawgraph filter seems like a good way to incorporate features I normal pull from QCTools (http://bavc.org/qctools, http://github.com/bavc/qctools) into a player. In particular I’d like to use drawgraph when running video digitization processes from tape. Currently when going tape-to-file I use a filterchain like this https://github.com/amiaopensource/vrecord/blob/master/vrecord#L219-L256 to show the video with a waveform and vectorscope. I think a flaw in this type of monitoring during digitization is that the user can only observe the current frame. So if something is seen in the corner of the eye (like a tape glitch, SDI spike, quick head clog) the user doesn’t have a chance to review that until the capture is done. With drawgraph incorporated in this the last X seconds of video could be summarized through signalstats data. Thanks! Dave Dave ___ 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 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] library.mak: add rpath to shared libraries
On Sat, Jun 27, 2015 at 2:22 AM, Hendrik Leppkes h.lepp...@gmail.com wrote: On Sat, Jun 27, 2015 at 3:09 AM, Ganesh Ajjanagadde gajjanaga...@gmail.com wrote: Fixes Ticket4673 Signed-off-by: Ganesh Ajjanagadde gajjanaga...@gmail.com --- library.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.mak b/library.mak index 29460b8..401da7c 100644 --- a/library.mak +++ b/library.mak @@ -58,7 +58,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver $(SLIB_CREATE_DEF_CMD) - $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) + $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(SLIB_EXTRA_CMD) LDEXEFLAGS is clearly not the appropriate way to go about this. These flags are for executables, not for shared libraries. - Hendrik Ok, so is it fine if this gets added to LDFLAGS instead? Or should a separate e.g LDLIBFLAGS be used? ___ 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 3/4] lavf/brstm: if the file lies about the last block's size, correct it
On Tue, Jun 23, 2015 at 12:35:35PM -0500, Rodger Combs wrote: --- libavformat/brstm.c | 9 + 1 file changed, 9 insertions(+) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- 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 01/12] libavcodec: Implementation of AAC_fixed_decoder (LC-module) [1/4]
On Sat, Jun 27, 2015 at 02:43:31AM +0200, Michael Niedermayer wrote: On Fri, Jun 12, 2015 at 08:15:51AM +, Nedeljko Babic wrote: On Thu, Jun 11, 2015 at 4:08 PM, Nedeljko Babic nedeljko.ba...@imgtec.com wrote: From: Jovan Zelincevic jovan.zelince...@imgtec.com Move existing code to the new template files Please setup your Git to track renames (add -M parameter), this is really hard to review in this form. This patch is just moving parts of the code that can be used in both float and in fixed aac in appropriate template files. It does not do renames (or anything else for that matter). For example, the parts of code are moved from aacdec.c to new aacdec_template.c, but original file is still present with what was left of the code. Adding -M will not change anything in the patch. I tried from -M20% to -M75% just to be sure. this needs -C like in git format-patch -1 -C -C -C #P it seems a single -C is enough, i thought yesterday it required multiple -C [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Awnsering whenever a program halts or runs forever is On a turing machine, in general impossible (turings halting problem). On any real computer, always possible as a real computer has a finite number of states N, and will either halt in less than N cycles or never halt. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Fix the bug of comparing zero bytes
Add check for linesize. --- tests/api/api-flac-test.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c index a6180bc..07030d6 100644 --- a/tests/api/api-flac-test.c +++ b/tests/api/api-flac-test.c @@ -112,10 +112,10 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, AVFrame *in_frame, *out_frame; uint8_t *raw_in = NULL, *raw_out = NULL; int in_offset = 0, out_offset = 0; -int frame_data_size = 0; int result = 0; int got_output = 0; int i = 0; +int in_frame_bytes, out_frame_bytes; in_frame = av_frame_alloc(); if (!in_frame) { @@ -156,8 +156,13 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, generate_raw_frame((uint16_t*)(in_frame-data[0]), i, enc_ctx-sample_rate, enc_ctx-channels, enc_ctx-frame_size); -memcpy(raw_in + in_offset, in_frame-data[0], in_frame-linesize[0]); -in_offset += in_frame-linesize[0]; +in_frame_bytes = in_frame-nb_samples * av_frame_get_channels(in_frame) * sizeof(uint16_t); +if (in_frame_bytes in_frame-linesize[0]) { +av_log(NULL, AV_LOG_ERROR, Incorrect value of input frame linesize\n); +return 1; +} +memcpy(raw_in + in_offset, in_frame-data[0], in_frame_bytes); +in_offset += in_frame_bytes; result = avcodec_encode_audio2(enc_ctx, enc_pkt, in_frame, got_output); if (result 0) { av_log(NULL, AV_LOG_ERROR, Error encoding audio frame\n); @@ -192,14 +197,19 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, av_log(NULL, AV_LOG_ERROR, Error frames before and after decoding has different sample format\n); return AVERROR_UNKNOWN; } -memcpy(raw_out + out_offset, out_frame-data[0], out_frame-linesize[0]); -out_offset += out_frame-linesize[0]; +out_frame_bytes = out_frame-nb_samples * av_frame_get_channels(out_frame) * sizeof(uint16_t); +if (out_frame_bytes out_frame-linesize[0]) { +av_log(NULL, AV_LOG_ERROR, Incorrect value of output frame linesize\n); +return 1; +} +memcpy(raw_out + out_offset, out_frame-data[0], out_frame_bytes); +out_offset += out_frame_bytes; } } av_free_packet(enc_pkt); } -if (memcmp(raw_in, raw_out, frame_data_size * NUMBER_OF_FRAMES) != 0) { +if (memcmp(raw_in, raw_out, out_frame_bytes * NUMBER_OF_FRAMES) != 0) { av_log(NULL, AV_LOG_ERROR, Output differs\n); return 1; } -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] nutdec: check maxpos in read_sm_data before reading count
On 27.06.2015 18:02, Michael Niedermayer wrote: On Sat, Jun 27, 2015 at 05:53:26PM +0200, Andreas Cadhalpun wrote: nutdec.c |3 +++ 1 file changed, 3 insertions(+) 4e07b069348ca9b9d65b7850291448201c4d81f6 0001-nutdec-check-maxpos-in-read_sm_data-before-returning.patch From 4e10305531d162fff2a7daac49cc046c771909a9 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com Date: Sat, 27 Jun 2015 17:50:56 +0200 Subject: [PATCH] nutdec: check maxpos in read_sm_data before returning success LGTM Pushed. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] huffyuvdec: validate image size
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavcodec/huffyuvdec.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 98c6128..71fb9e3 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -291,6 +291,12 @@ static av_cold int decode_init(AVCodecContext *avctx) HYuvContext *s = avctx-priv_data; int ret; +if (avctx-width = 0 || avctx-height = 0) { +av_log(avctx, AV_LOG_ERROR, invalid image size %dx%d\n, + avctx-width, avctx-height); +return AVERROR_INVALIDDATA; +} + ff_huffyuvdsp_init(s-hdsp); memset(s-vlc, 0, 4 * sizeof(VLC)); -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] nutdec: check maxpos in read_sm_data before reading count
On 27.06.2015 02:31, Michael Niedermayer wrote: On Fri, Jun 26, 2015 at 07:28:36PM +0200, Andreas Cadhalpun wrote: On 26.06.2015 01:36, Michael Niedermayer wrote: On Thu, Jun 25, 2015 at 11:46:41PM +0200, Andreas Cadhalpun wrote: Otherwise sm_size can be larger than size, which results in a negative packet size. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavformat/nutdec.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 13fb399..43bd27b 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -888,7 +888,7 @@ fail: static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta, int64_t maxpos) { -int count = ffio_read_varlen(bc); +int count; int skip_start = 0; int skip_end = 0; int channels = 0; @@ -898,6 +898,11 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int int height = 0; int i, ret; +if (avio_tell(bc) = maxpos) +return AVERROR_INVALIDDATA; + +count = ffio_read_varlen(bc); ffio_read_varlen() could move the position beyond maxpos yet return 0 so the loop with teh checks inside is skiped That is exactly the problem, because then sm_size can be larger than size. An alternative would be to directly check for that, like in attached patch. wouldnt checking after the loop im read_sm_data() before returning success be more robust ? It would exit sooner if the problem occurs in the first call and avoid potential integer overflows OK, new patch attached. but iam fine with any solution that works Me too. Best regards, Andreas From 4e10305531d162fff2a7daac49cc046c771909a9 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com Date: Sat, 27 Jun 2015 17:50:56 +0200 Subject: [PATCH] nutdec: check maxpos in read_sm_data before returning success Otherwise sm_size can be larger than size, which results in a negative packet size. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavformat/nutdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 13fb399..606deaa 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -1005,6 +1005,9 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int AV_WL32(dst+4, skip_end); } +if (avio_tell(bc) = maxpos) +return AVERROR_INVALIDDATA; + return 0; } -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avutil/intmath: use bzhi gcc builtin in av_mod_uintp2()
On 26/06/15 8:14 PM, James Almer wrote: Signed-off-by: James Almer jamr...@gmail.com --- Now making sure it's not used with ICC. Pushed the original. Oked by Cehoyos who confirmed ICC never reaches this code to begin with. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] nutdec: check maxpos in read_sm_data before reading count
On Sat, Jun 27, 2015 at 05:53:26PM +0200, Andreas Cadhalpun wrote: On 27.06.2015 02:31, Michael Niedermayer wrote: On Fri, Jun 26, 2015 at 07:28:36PM +0200, Andreas Cadhalpun wrote: On 26.06.2015 01:36, Michael Niedermayer wrote: On Thu, Jun 25, 2015 at 11:46:41PM +0200, Andreas Cadhalpun wrote: Otherwise sm_size can be larger than size, which results in a negative packet size. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavformat/nutdec.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 13fb399..43bd27b 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -888,7 +888,7 @@ fail: static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta, int64_t maxpos) { -int count = ffio_read_varlen(bc); +int count; int skip_start = 0; int skip_end = 0; int channels = 0; @@ -898,6 +898,11 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int int height = 0; int i, ret; +if (avio_tell(bc) = maxpos) +return AVERROR_INVALIDDATA; + +count = ffio_read_varlen(bc); ffio_read_varlen() could move the position beyond maxpos yet return 0 so the loop with teh checks inside is skiped That is exactly the problem, because then sm_size can be larger than size. An alternative would be to directly check for that, like in attached patch. wouldnt checking after the loop im read_sm_data() before returning success be more robust ? It would exit sooner if the problem occurs in the first call and avoid potential integer overflows OK, new patch attached. but iam fine with any solution that works Me too. Best regards, Andreas nutdec.c |3 +++ 1 file changed, 3 insertions(+) 4e07b069348ca9b9d65b7850291448201c4d81f6 0001-nutdec-check-maxpos-in-read_sm_data-before-returning.patch From 4e10305531d162fff2a7daac49cc046c771909a9 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com Date: Sat, 27 Jun 2015 17:50:56 +0200 Subject: [PATCH] nutdec: check maxpos in read_sm_data before returning success LGTM thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] wavpack: use get_bits_long to read up to 32 bits
get_bits should not be used for more than 25 bits. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavcodec/wavpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index b51a21c..d91b66c 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -155,7 +155,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, if (t = 2) { if (get_bits_left(gb) t - 1) goto error; -t = get_bits(gb, t - 1) | (1 (t - 1)); +t = get_bits_long(gb, t - 1) | (1 (t - 1)); } else { if (get_bits_left(gb) 0) goto error; @@ -186,7 +186,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, } else { if (get_bits_left(gb) t2 - 1) goto error; -t += get_bits(gb, t2 - 1) | (1 (t2 - 1)); +t += get_bits_long(gb, t2 - 1) | (1 (t2 - 1)); } } -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] wmavoice: limit wmavoice_decode_packet return value to packet size
Claiming to have decoded more bytes than the packet size is wrong. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavcodec/wmavoice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index ae88d4e..6cd407a 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1982,7 +1982,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, *got_frame_ptr) { cnt += s-spillover_nbits; s-skip_bits_next = cnt 7; -return cnt 3; +return FFMIN(cnt 3, avpkt-size); } else skip_bits_long (gb, s-spillover_nbits - cnt + get_bits_count(gb)); // resync @@ -2001,7 +2001,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, } else if (*got_frame_ptr) { int cnt = get_bits_count(gb); s-skip_bits_next = cnt 7; -return cnt 3; +return FFMIN(cnt 3, avpkt-size); } else if ((s-sframe_cache_size = pos) 0) { /* rewind bit reader to start of last (incomplete) superframe... */ init_get_bits(gb, avpkt-data, size 3); -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec: Add support for Closed Caption export in h264
--- libavcodec/h264.c | 10 ++ libavcodec/h264.h | 2 ++ libavcodec/h264_sei.c | 32 +++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1cbd4cb..d971c7b 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -609,6 +609,8 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) h-prev_frame_num= -1; h-sei_fpa.frame_packing_arrangement_cancel_flag = -1; h-has_afd = 0; +h-a53_caption_size = 0; +h-a53_caption = NULL; h-next_outputed_poc = INT_MIN; for (i = 0; i MAX_DELAYED_PIC_COUNT; i++) @@ -879,6 +881,14 @@ static void decode_postinit(H264Context *h, int setup_finished) } } +if (h-a53_caption) { +AVFrameSideData *sd = +av_frame_new_side_data(cur-f, AV_FRAME_DATA_A53_CC, h-a53_caption_size); +if (sd) +memcpy(sd-data, h-a53_caption, h-a53_caption_size); +av_freep(h-a53_caption); +} + cur-mmco_reset = h-mmco_reset; h-mmco_reset = 0; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7565e03..3aef49f 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -784,6 +784,8 @@ typedef struct H264Context { uint8_t afd; int has_afd; +int a53_caption_size; +uint8_t *a53_caption; // Timestamp stuff int sei_buffering_period_present; /// Buffering period SEI flag diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index b6ec5c7..5a61020 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -111,7 +111,7 @@ static int decode_picture_timing(H264Context *h) static int decode_user_data_itu_t_t35(H264Context *h, int size) { uint32_t user_identifier; -int dtg_active_format; +int dtg_active_format, cc_count, user_data_type_code; if (size 7) return -1; @@ -143,6 +143,36 @@ FF_ENABLE_DEPRECATION_WARNINGS skip_bits(h-gb, 6); } break; +case 0x47413934: // GA94 closed captions +if (size 3) +return -1; +user_data_type_code = get_bits(h-gb, 8); +#undef printf +if (user_data_type_code == 0x3) { +skip_bits(h-gb, 1); +if (get_bits(h-gb, 1)) { +skip_bits(h-gb, 1); +cc_count = get_bits(h-gb, 5); +skip_bits(h-gb, 8); +size -= 2; +if (cc_count size = cc_count*3) { +int i; +// Allow merging of the cc data from two fields +uint8_t *tmp = av_realloc(tmp, h-a53_caption_size + cc_count*3); +if (!tmp) +return -1; +h-a53_caption = tmp; +for (i = 0; i cc_count; i++) { +h-a53_caption[h-a53_caption_size++] = get_bits(h-gb, 8); +h-a53_caption[h-a53_caption_size++] = get_bits(h-gb, 8); +h-a53_caption[h-a53_caption_size++] = get_bits(h-gb, 8); +} + +skip_bits(h-gb, 8); +} +} +} +break; default: skip_bits(h-gb, size * 8); break; -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] lavfi/ebur128: fix indentation after last commit
On Sat, Jun 27, 2015 at 08:50:02PM +, Paul B Mahol wrote: On 11/16/14, Marton Balint c...@passwd.hu wrote: Signed-off-by: Marton Balint c...@passwd.hu --- libavfilter/f_ebur128.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index 8780062..63b4dad 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -316,8 +316,8 @@ static int config_video_output(AVFilterLink *outlink) ebur128-y_line_ref[y] = ((i % ebur128-line_step == 0) ? i : 0); y -= 4; // -4 to center vertically if (i % ebur128-line_step == 0) -drawtext(outpicref, x, y + ebur128-graph.y, FONT8, font_colors+3, - %c%d, i 0 ? '-' : i 0 ? '+' : ' ', FFABS(i)); +drawtext(outpicref, x, y + ebur128-graph.y, FONT8, font_colors+3, + %c%d, i 0 ? '-' : i 0 ? '+' : ' ', FFABS(i)); } /* draw graph */ -- 2.1.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel lgtm this depends on patch 1/2 whats the status of that ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- 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] wmavoice: limit wmavoice_decode_packet return value to packet size
On Sat, Jun 27, 2015 at 08:36:15PM +0200, Andreas Cadhalpun wrote: Claiming to have decoded more bytes than the packet size is wrong. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavcodec/wmavoice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index ae88d4e..6cd407a 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1982,7 +1982,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, *got_frame_ptr) { cnt += s-spillover_nbits; s-skip_bits_next = cnt 7; -return cnt 3; +return FFMIN(cnt 3, avpkt-size); } else skip_bits_long (gb, s-spillover_nbits - cnt + get_bits_count(gb)); // resync @@ -2001,7 +2001,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, } else if (*got_frame_ptr) { int cnt = get_bits_count(gb); s-skip_bits_next = cnt 7; -return cnt 3; +return FFMIN(cnt 3, avpkt-size); } else if ((s-sframe_cache_size = pos) 0) { /* rewind bit reader to start of last (incomplete) superframe... */ init_get_bits(gb, avpkt-data, size 3); am i assuming correct that gb was read beyond its end ? if so this maybe should be treated as an error instead of cliping [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- 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] wavpack: use get_bits_long to read up to 32 bits
On 6/27/15, Andreas Cadhalpun andreas.cadhal...@googlemail.com wrote: get_bits should not be used for more than 25 bits. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavcodec/wavpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index b51a21c..d91b66c 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -155,7 +155,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, if (t = 2) { if (get_bits_left(gb) t - 1) goto error; -t = get_bits(gb, t - 1) | (1 (t - 1)); +t = get_bits_long(gb, t - 1) | (1 (t - 1)); } else { if (get_bits_left(gb) 0) goto error; @@ -186,7 +186,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, } else { if (get_bits_left(gb) t2 - 1) goto error; -t += get_bits(gb, t2 - 1) | (1 (t2 - 1)); +t += get_bits_long(gb, t2 - 1) | (1 (t2 - 1)); } } -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel lgtm ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv2] avcodec: Add support for Closed Caption export in h264
On Sat, Jun 27, 2015 at 09:12:20PM +0100, Kieran Kunhya wrote: Fix missing line --- libavcodec/h264.c | 11 +++ libavcodec/h264.h | 2 ++ libavcodec/h264_sei.c | 32 +++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1cbd4cb..1569ec8 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -609,6 +609,8 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) h-prev_frame_num= -1; h-sei_fpa.frame_packing_arrangement_cancel_flag = -1; h-has_afd = 0; +h-a53_caption_size = 0; +h-a53_caption = NULL; h-next_outputed_poc = INT_MIN; for (i = 0; i MAX_DELAYED_PIC_COUNT; i++) @@ -879,6 +881,15 @@ static void decode_postinit(H264Context *h, int setup_finished) } } +if (h-a53_caption) { +AVFrameSideData *sd = +av_frame_new_side_data(cur-f, AV_FRAME_DATA_A53_CC, h-a53_caption_size); +if (sd) +memcpy(sd-data, h-a53_caption, h-a53_caption_size); +av_freep(h-a53_caption); +h-a53_caption_size = 0; +} + cur-mmco_reset = h-mmco_reset; h-mmco_reset = 0; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7565e03..3aef49f 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -784,6 +784,8 @@ typedef struct H264Context { uint8_t afd; int has_afd; +int a53_caption_size; +uint8_t *a53_caption; // Timestamp stuff int sei_buffering_period_present; /// Buffering period SEI flag diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index b6ec5c7..5a61020 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -111,7 +111,7 @@ static int decode_picture_timing(H264Context *h) static int decode_user_data_itu_t_t35(H264Context *h, int size) { uint32_t user_identifier; -int dtg_active_format; +int dtg_active_format, cc_count, user_data_type_code; if (size 7) return -1; @@ -143,6 +143,36 @@ FF_ENABLE_DEPRECATION_WARNINGS skip_bits(h-gb, 6); } break; +case 0x47413934: // GA94 closed captions +if (size 3) +return -1; a more specific error code would be better +user_data_type_code = get_bits(h-gb, 8); +#undef printf this looks unintended +if (user_data_type_code == 0x3) { +skip_bits(h-gb, 1); +if (get_bits(h-gb, 1)) { +skip_bits(h-gb, 1); +cc_count = get_bits(h-gb, 5); +skip_bits(h-gb, 8); +size -= 2; +if (cc_count size = cc_count*3) { +int i; +// Allow merging of the cc data from two fields +uint8_t *tmp = av_realloc(tmp, h-a53_caption_size + cc_count*3); ^^^ i would assume this was intended to be h-a53_caption also the addition in h-a53_caption_size + cc_count*3 needs a overflow check, a crafted file can probably trigger a overflow there +if (!tmp) +return -1; AVERROR(ENOMEM) [...] -- 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 ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] lavfi/ebur128: fix indentation after last commit
On 11/16/14, Marton Balint c...@passwd.hu wrote: Signed-off-by: Marton Balint c...@passwd.hu --- libavfilter/f_ebur128.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index 8780062..63b4dad 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -316,8 +316,8 @@ static int config_video_output(AVFilterLink *outlink) ebur128-y_line_ref[y] = ((i % ebur128-line_step == 0) ? i : 0); y -= 4; // -4 to center vertically if (i % ebur128-line_step == 0) -drawtext(outpicref, x, y + ebur128-graph.y, FONT8, font_colors+3, - %c%d, i 0 ? '-' : i 0 ? '+' : ' ', FFABS(i)); +drawtext(outpicref, x, y + ebur128-graph.y, FONT8, font_colors+3, + %c%d, i 0 ? '-' : i 0 ? '+' : ' ', FFABS(i)); } /* draw graph */ -- 2.1.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel lgtm ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavfi: add drawgraph filter
Signed-off-by: Paul B Mahol one...@gmail.com --- doc/filters.texi | 76 libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_drawgraph.c | 297 + 4 files changed, 375 insertions(+) create mode 100644 libavfilter/vf_drawgraph.c diff --git a/doc/filters.texi b/doc/filters.texi index d9f913f..a1f8805 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3965,6 +3965,81 @@ drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red @end example @end itemize +@section drawgraph + +Draw a graph using input video metadata. + +It accepts the following parameters: + +@table @option +@item metadata +Set frame metadata key from which metadata values will be used to draw a graph. + +@item min +Set minimal value of metadata value. + +@item max +Set maximal value of metadata value. + +@item background +Set graph background color. Default is white. + +@item foreground +Set foreground color expression. + +The expressions can use the following variables: + +@table @option +@item MIN +Minimal value of metadata value. + +@item MAX +Maximal value of metadata value. + +@item VAL +Current metadata key value. +@end table + +@item mode +Set graph mode. + +Available values for mode is: +@table @samp +@item bar +@item dot +@item line +@end table + +Default is @code{bar}. + +@item slide +Set slide mode. + +Available values for slide is: +@table @samp +@item frame +Draw new frame when right border is reached. + +@item replace +Replace old columns with new ones. + +@item scroll +Scroll from right to left. +@end table + +Default is @code{frame}. + +@item size +Set size of graph video. For the syntax of this option, check the +@ref{video size syntax,,Video size section in the ffmpeg-utils manual,ffmpeg-utils}. +The default value is @code{400x400}. +@end table + +Example using metadata from @ref{signalstats} filter: +@example +signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255 +@end example + @section drawgrid Draw a grid on the input image. @@ -8604,6 +8679,7 @@ Swap the second and third planes of the input: ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT @end example +@anchor{signalstats} @section signalstats Evaluate various visual metrics that assist in determining issues associated with the digitization of analog video media. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 55cd055..54a8bbb 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -117,6 +117,7 @@ OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o +OBJS-$(CONFIG_DRAWGRAPH_FILTER) += vf_drawgraph.o OBJS-$(CONFIG_DRAWGRID_FILTER) += vf_drawbox.o OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o OBJS-$(CONFIG_ELBG_FILTER) += vf_elbg.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 3898498..b9508f5 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -133,6 +133,7 @@ void avfilter_register_all(void) REGISTER_FILTER(DESHAKE,deshake,vf); REGISTER_FILTER(DETELECINE, detelecine, vf); REGISTER_FILTER(DRAWBOX,drawbox,vf); +REGISTER_FILTER(DRAWGRAPH, drawgraph, vf); REGISTER_FILTER(DRAWGRID, drawgrid, vf); REGISTER_FILTER(DRAWTEXT, drawtext, vf); REGISTER_FILTER(EDGEDETECT, edgedetect, vf); diff --git a/libavfilter/vf_drawgraph.c b/libavfilter/vf_drawgraph.c new file mode 100644 index 000..642453a --- /dev/null +++ b/libavfilter/vf_drawgraph.c @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2015 Paul B Mahol + * + * 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 float.h + +#include libavutil/eval.h +#include libavutil/intreadwrite.h +#include libavutil/opt.h +#include avfilter.h +#include formats.h +#include internal.h +#include video.h + +typedef struct DrawGraphContext { +const AVClass *class; + +char *key; +float min; +float max; +char
Re: [FFmpeg-devel] [PATCH 02/11] aaccoder: remove previous PNS implementation from twoloop
On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov atomnu...@gmail.com wrote: This commit essentially undoes commit c5d4f87e8427c0952278ec247fa8ab1e6e52 and removes PNS band marking from the twoloop coder. LGTM, but I wouldn't apply it before #09 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 03/11] aaccoder: add intensity stereo coding support for the trellis quantizer
On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov atomnu...@gmail.com wrote: +/* Energy spread threshold value below which no PNS is used, this corresponds to + * typically around 17Khz, after which PNS usage decays ending at 19Khz */ +#define NOISE_SPREAD_THRESHOLD 152234544.0f + +/* Above ~1.26*threshold all normally-zeroed values are PNS'd. Lambda divides + * the defined value below as to try to get a ~1.26 multiplier so that there is + * a balance between noise and zero bands leaving more bits for actual signal */ +#define NOISE_LAMBDA_NUMERATOR 252.1f This should go to #09 shouldn't it? + +/** Frequency in Hz for lower limit of intensity stereo **/ +#define INT_STEREO_LOW_LIMIT 6000 And that to #10. Or wherever it's used first, I'd say. Other than that, it looks good. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] api-h264-test: build with another api test
Location of api-h264-test changed to special directory for api tests. --- libavformat/Makefile| 1 - libavformat/api-h264-test.c | 183 tests/api/Makefile | 1 + tests/api/api-h264-test.c | 183 tests/fate/api.mak | 9 ++- tests/fate/libavformat.mak | 4 - 6 files changed, 192 insertions(+), 189 deletions(-) delete mode 100644 libavformat/api-h264-test.c create mode 100644 tests/api/api-h264-test.c diff --git a/libavformat/Makefile b/libavformat/Makefile index 5380a2a..993ec09 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -547,7 +547,6 @@ TESTPROGS = seek \ url \ TESTPROGS-$(CONFIG_NETWORK) += noproxy -TESTPROGS-yes+= api-h264 TESTPROGS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh TOOLS = aviocat \ diff --git a/libavformat/api-h264-test.c b/libavformat/api-h264-test.c deleted file mode 100644 index 4d2a5b0..000 --- a/libavformat/api-h264-test.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2015 Ludmila Glinskih - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the Software), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * H264 codec test. - */ - -#include libavutil/adler32.h -#include libavcodec/avcodec.h -#include libavformat/avformat.h -#include libavutil/imgutils.h - -static int video_decode_example(const char *input_filename) -{ -AVCodec *codec = NULL; -AVCodecContext *origin_ctx = NULL, *ctx= NULL; -AVFrame *fr = NULL; -uint8_t *byte_buffer = NULL; -AVPacket pkt; -AVFormatContext *fmt_ctx = NULL; -int number_of_written_bytes; -int video_stream; -int get_frame = 0; -int byte_buffer_size; -int i = 0; -int result; - -result = avformat_open_input(fmt_ctx, input_filename, NULL, NULL); -if (result 0) { -av_log(NULL, AV_LOG_ERROR, Can't open file\n); -return result; -} - -result = avformat_find_stream_info(fmt_ctx, NULL); -if (result 0) { -av_log(NULL, AV_LOG_ERROR, Can't get stream info\n); -return result; -} - -video_stream = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0); -if (video_stream 0) { - av_log(NULL, AV_LOG_ERROR, Can't find video stream in input file\n); - return -1; -} - -origin_ctx = fmt_ctx-streams[video_stream]-codec; - -codec = avcodec_find_decoder(origin_ctx-codec_id); -if (!codec) { -av_log(NULL, AV_LOG_ERROR, Can't find decoder\n); -return -1; -} - -ctx = avcodec_alloc_context3(codec); -if (!ctx) { -av_log(NULL, AV_LOG_ERROR, Can't allocate decoder context\n); -return AVERROR(ENOMEM); -} - -result = avcodec_copy_context(ctx, origin_ctx); -if (result) { -av_log(NULL, AV_LOG_ERROR, Can't copy decoder context\n); -return result; -} - -result = avcodec_open2(ctx, codec, NULL); -if (result 0) { -av_log(ctx, AV_LOG_ERROR, Can't open decoder\n); -return result; -} - -fr = av_frame_alloc(); -if (!fr) { -av_log(NULL, AV_LOG_ERROR, Can't allocate frame\n); -return AVERROR(ENOMEM); -} - -byte_buffer_size = av_image_get_buffer_size(ctx-pix_fmt, ctx-width, ctx-height, 16); -byte_buffer = av_malloc(byte_buffer_size); -if (!byte_buffer) { -av_log(NULL, AV_LOG_ERROR, Can't allocate buffer\n); -return AVERROR(ENOMEM); -} - -printf(#tb %d: %d/%d\n, video_stream, fmt_ctx-streams[video_stream]-time_base.num, fmt_ctx-streams[video_stream]-time_base.den); -i = 0; -av_init_packet(pkt); -while (av_read_frame(fmt_ctx, pkt) = 0) { -if (pkt.stream_index == video_stream) { -get_frame = 0; -
Re: [FFmpeg-devel] [PATCH 01/11] aac: add additional fields needed by the encoder for intensity stereo
On Fri, Jun 26, 2015 at 09:16:30PM +0100, Rostislav Pehlivanov wrote: This commit adds additional fields which are used by the native encoder to add intensity stereo support. It also adds some clarifying statements to the comments for the codebooks. --- libavcodec/aac.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Fix the bug of comparing zero bytes
On Sat, Jun 27, 2015 at 05:31:08PM +0300, Ludmila Glinskih wrote: Add check for linesize. --- tests/api/api-flac-test.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] library.mak: add rpath to shared libraries
On Sat, Jun 27, 2015 at 9:49 AM, Ganesh Ajjanagadde gajja...@mit.edu wrote: On Sat, Jun 27, 2015 at 2:22 AM, Hendrik Leppkes h.lepp...@gmail.com wrote: On Sat, Jun 27, 2015 at 3:09 AM, Ganesh Ajjanagadde gajjanaga...@gmail.com wrote: Fixes Ticket4673 Signed-off-by: Ganesh Ajjanagadde gajjanaga...@gmail.com --- library.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.mak b/library.mak index 29460b8..401da7c 100644 --- a/library.mak +++ b/library.mak @@ -58,7 +58,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver $(SLIB_CREATE_DEF_CMD) - $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) + $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(SLIB_EXTRA_CMD) LDEXEFLAGS is clearly not the appropriate way to go about this. These flags are for executables, not for shared libraries. - Hendrik Ok, so is it fine if this gets added to LDFLAGS instead? Or should a separate e.g LDLIBFLAGS be used? Attached is new patch that creates a LDLIBFLAGS. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 284017181c3a6f313c34d503f9e220c5f81fe192 Mon Sep 17 00:00:00 2001 From: Ganesh Ajjanagadde gajjanaga...@gmail.com Date: Sat, 27 Jun 2015 12:27:59 -0400 Subject: [PATCH] build: add LDLIBFLAGS Fixes Ticket4673 Signed-off-by: Ganesh Ajjanagadde gajjanaga...@gmail.com --- configure | 10 ++ library.mak | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 27522fe..28522bf 100755 --- a/configure +++ b/configure @@ -322,6 +322,7 @@ Toolchain options: --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS] --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS] --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS] + --extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [$LDLIBFLAGS] --extra-libs=ELIBS add ELIBS [$ELIBS] --extra-version=STRING version string suffix [] --optflags=OPTFLAGS override optimization-related compiler flags @@ -792,6 +793,10 @@ add_ldexeflags(){ append LDEXEFLAGS $($ldflags_filter $@) } +add_ldlibflags(){ +append LDLIBFLAGS $($ldflags_filter $@) +} + add_stripflags(){ append ASMSTRIPFLAGS $@ } @@ -3007,6 +3012,9 @@ for opt do --extra-ldexeflags=*) add_ldexeflags $optval ;; +--extra-ldlibflags=*) +add_ldlibflags $optval +;; --extra-libs=*) add_extralibs $optval ;; @@ -5429,6 +5437,7 @@ check_disable_warning -Wno-pointer-sign check_ldflags -Wl,--warn-common check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample enabled rpath add_ldexeflags -Wl,-rpath,$libdir +enabled rpath add_ldlibflags -Wl,-rpath,$libdir test_ldflags -Wl,-Bsymbolic append SHFLAGS -Wl,-Bsymbolic # add some strip flags @@ -5897,6 +5906,7 @@ DEPWINDRES=$dep_cc DOXYGEN=$doxygen LDFLAGS=$LDFLAGS LDEXEFLAGS=$LDEXEFLAGS +LDLIBFLAGS=$LDLIBFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) ASMSTRIPFLAGS=$ASMSTRIPFLAGS YASMFLAGS=$YASMFLAGS diff --git a/library.mak b/library.mak index 29460b8..6f95f63 100644 --- a/library.mak +++ b/library.mak @@ -58,7 +58,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver $(SLIB_CREATE_DEF_CMD) - $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) + $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDLIBFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(SLIB_EXTRA_CMD) ifdef SUBDIR -- 2.4.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 06/11] aacpsy: Add energy spread for each band
LGTM On Fri, Jun 26, 2015 at 5:16 PM, Rostislav Pehlivanov atomnu...@gmail.com wrote: -float distortion; -float perceptual_weight; Those are in fact in disuse. Thought I'd clarify. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] huffyuvdec: validate image size
On Sat, Jun 27, 2015 at 07:42:48PM +0200, Andreas Cadhalpun wrote: Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavcodec/huffyuvdec.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 98c6128..71fb9e3 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -291,6 +291,12 @@ static av_cold int decode_init(AVCodecContext *avctx) HYuvContext *s = avctx-priv_data; int ret; +if (avctx-width = 0 || avctx-height = 0) { LGTM alternatively av_image_check_size() could be used but this should be equally fine [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCHv2] avcodec: Add support for Closed Caption export in h264
Fix missing line --- libavcodec/h264.c | 11 +++ libavcodec/h264.h | 2 ++ libavcodec/h264_sei.c | 32 +++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1cbd4cb..1569ec8 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -609,6 +609,8 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) h-prev_frame_num= -1; h-sei_fpa.frame_packing_arrangement_cancel_flag = -1; h-has_afd = 0; +h-a53_caption_size = 0; +h-a53_caption = NULL; h-next_outputed_poc = INT_MIN; for (i = 0; i MAX_DELAYED_PIC_COUNT; i++) @@ -879,6 +881,15 @@ static void decode_postinit(H264Context *h, int setup_finished) } } +if (h-a53_caption) { +AVFrameSideData *sd = +av_frame_new_side_data(cur-f, AV_FRAME_DATA_A53_CC, h-a53_caption_size); +if (sd) +memcpy(sd-data, h-a53_caption, h-a53_caption_size); +av_freep(h-a53_caption); +h-a53_caption_size = 0; +} + cur-mmco_reset = h-mmco_reset; h-mmco_reset = 0; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7565e03..3aef49f 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -784,6 +784,8 @@ typedef struct H264Context { uint8_t afd; int has_afd; +int a53_caption_size; +uint8_t *a53_caption; // Timestamp stuff int sei_buffering_period_present; /// Buffering period SEI flag diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index b6ec5c7..5a61020 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -111,7 +111,7 @@ static int decode_picture_timing(H264Context *h) static int decode_user_data_itu_t_t35(H264Context *h, int size) { uint32_t user_identifier; -int dtg_active_format; +int dtg_active_format, cc_count, user_data_type_code; if (size 7) return -1; @@ -143,6 +143,36 @@ FF_ENABLE_DEPRECATION_WARNINGS skip_bits(h-gb, 6); } break; +case 0x47413934: // GA94 closed captions +if (size 3) +return -1; +user_data_type_code = get_bits(h-gb, 8); +#undef printf +if (user_data_type_code == 0x3) { +skip_bits(h-gb, 1); +if (get_bits(h-gb, 1)) { +skip_bits(h-gb, 1); +cc_count = get_bits(h-gb, 5); +skip_bits(h-gb, 8); +size -= 2; +if (cc_count size = cc_count*3) { +int i; +// Allow merging of the cc data from two fields +uint8_t *tmp = av_realloc(tmp, h-a53_caption_size + cc_count*3); +if (!tmp) +return -1; +h-a53_caption = tmp; +for (i = 0; i cc_count; i++) { +h-a53_caption[h-a53_caption_size++] = get_bits(h-gb, 8); +h-a53_caption[h-a53_caption_size++] = get_bits(h-gb, 8); +h-a53_caption[h-a53_caption_size++] = get_bits(h-gb, 8); +} + +skip_bits(h-gb, 8); +} +} +} +break; default: skip_bits(h-gb, size * 8); break; -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Intel QSV encoder
You basically build it normally but build this as a library first: https://github.com/mjb2000/mfx_dispatch.git and configure with --enable-libmfx (NB that this mfx_dispatch thinger isn't compatible with windows XP so I don't use it personally): https://github.com/rdp/ffmpeg-windows-build-helpers/commit/c48af053657e174e270249e4b28a83c35897e320 GL! -r On 6/26/15, Cary Tetrick ctetri...@gmail.com wrote: Sorry, sent with wrong subject. Are there any patches supporting Intel QSV encoding that will work with recent versions of ffmpeg on Windows? Thanks. ___ 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] GSoC update
Hi, attached patches are the current state of work. It's probably still a bit rough around the edges, but I think I made some progress. The sample code in doc/examples does not write any data as of yet, but the HTTP handshake works. From b43aeaa27f6ca7df476aa194b2f78aa1b49516d0 Mon Sep 17 00:00:00 2001 From: Stephan Holljes klaxa1...@googlemail.com Date: Sun, 28 Jun 2015 06:06:16 +0200 Subject: [PATCH 01/10] lavf/network: split ff_listen_bind into ff_listen and ff_accept Signed-off-by: Stephan Holljes klaxa1...@googlemail.com --- libavformat/network.c | 27 +-- libavformat/network.h | 4 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/libavformat/network.c b/libavformat/network.c index 47ade8c..8d61746 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -187,12 +187,11 @@ int ff_socket(int af, int type, int proto) return fd; } -int ff_listen_bind(int fd, const struct sockaddr *addr, - socklen_t addrlen, int timeout, URLContext *h) +int ff_listen(int fd, const struct sockaddr *addr, + socklen_t addrlen) { int ret; int reuse = 1; -struct pollfd lp = { fd, POLLIN, 0 }; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reuse, sizeof(reuse))) { av_log(NULL, AV_LOG_WARNING, setsockopt(SO_REUSEADDR) failed\n); } @@ -203,6 +202,13 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, ret = listen(fd, 1); if (ret) return ff_neterrno(); +return ret; +} + +int ff_accept(int fd, int timeout, URLContext *h) +{ +int ret; +struct pollfd lp = { fd, POLLIN, 0 }; ret = ff_poll_interrupt(lp, 1, timeout, h-interrupt_callback); if (ret 0) @@ -211,15 +217,24 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, ret = accept(fd, NULL, NULL); if (ret 0) return ff_neterrno(); - -closesocket(fd); - if (ff_socket_nonblock(ret, 1) 0) av_log(NULL, AV_LOG_DEBUG, ff_socket_nonblock failed\n); return ret; } +int ff_listen_bind(int fd, const struct sockaddr *addr, + socklen_t addrlen, int timeout, URLContext *h) +{ +int ret; +if ((ret = ff_listen(fd, addr, addrlen)) 0) +return ret; +ret = ff_accept(fd, timeout, h); +closesocket(fd); +return ret; + +} + int ff_listen_connect(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h, int will_try_next) diff --git a/libavformat/network.h b/libavformat/network.h index 86fb656..44e109c 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -254,6 +254,10 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h); +int ff_listen(int fd, const struct sockaddr *addr, socklen_t addrlen); + +int ff_accept(int fd, int timeout, URLContext *h); + /** * Connect to a file descriptor and poll for result. * -- 2.1.0 From 39faa1ea315bb51452446e291fd5d93d7eb3a988 Mon Sep 17 00:00:00 2001 From: Stephan Holljes klaxa1...@googlemail.com Date: Sun, 28 Jun 2015 06:12:37 +0200 Subject: [PATCH 02/10] lavf/avio: add ffurl_accept and ffurl_handshake Signed-off-by: Stephan Holljes klaxa1...@googlemail.com --- libavformat/avio.c | 15 +++ libavformat/url.h | 12 2 files changed, 27 insertions(+) diff --git a/libavformat/avio.c b/libavformat/avio.c index aff8d10..cb8126d 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -211,6 +211,21 @@ int ffurl_connect(URLContext *uc, AVDictionary **options) return 0; } +int ffurl_accept(URLContext *s, URLContext *c) +{ +int ret; +if ((ret = s-prot-url_accept(s, c)) 0) +return ret; +c-is_connected = 1; +return ret; + +} + +int ffurl_handshake(URLContext *s, URLContext *c) +{ +return s-prot-url_handshake(s, c); +} + #define URL_SCHEME_CHARS\ abcdefghijklmnopqrstuvwxyz\ ABCDEFGHIJKLMNOPQRSTUVWXYZ\ diff --git a/libavformat/url.h b/libavformat/url.h index 99a3201..78613c5 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -58,6 +58,8 @@ typedef struct URLProtocol { * for those nested protocols. */ int (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options); +int (*url_accept)(URLContext *s, URLContext *c); +int (*url_handshake)(URLContext *s, URLContext *c); /** * Read data from the protocol. @@ -140,6 +142,16 @@ int ffurl_open(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options); /** + * Accept an URLContext c on an URLContext s + * @param s server context + * @param c client context + * @return the accepted filedescriptor on success, ff_neterrno() on failure. + */ +int ffurl_accept(URLContext *s, URLContext *c); + +int