Re: [FFmpeg-devel] WinRT API support patch
On 20 November 2014 08:34:54 CET, Jesse Jiang jessejiang0...@outlook.com wrote: Add WinRT API supports At least 2 fairly major issues: 1) using rand() basically never is correct. Use the appropriate CryptographicBuffer function (yes, that means you need some C++ code unfortunately). 2) CreateThread is not compatible with _beginthreadex, there is a good reason why we use this. Using the other without additional changes will cause memleaks or worse. I am not even sure it is at all possible to use CreateThread correctly for us. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] please unsubscribe me from this mailing list
___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: Prevent icl being incorrectly detected as msvc.
Hi, - Mail original - Intel compiler xilink will also output the information from the underlying Microsoft linker. A result is that both the Intel info header and the Microsoft info header are output. This means that currently the Intel linker will get detected as the msvc linker incorrectly as configure checks for the presence of Microsoft first. This patch just changes the order of detection so that Intel is checked first. This allows intel to be detected correctly and also fixes an error with lto with icl. LGTM -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.
--- libavcodec/pngdec.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..e3d61f6 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -411,11 +411,6 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, unsigned buf_size; int ret; -zstream.zalloc = ff_png_zalloc; -zstream.zfree = ff_png_zfree; -zstream.opaque = NULL; -if (inflateInit(zstream) != Z_OK) -return AVERROR_EXTERNAL; zstream.next_in = (unsigned char *)data; zstream.avail_in = data_end - data; av_bprint_init(bp, 0, -1); @@ -437,12 +432,10 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, if (ret == Z_STREAM_END) break; } -inflateEnd(zstream); bp-str[bp-len] = 0; return 0; fail: -inflateEnd(zstream); av_bprint_finalize(bp, NULL); return ret; } @@ -924,16 +917,6 @@ static int decode_frame_png(AVCodecContext *avctx, s-y = s-state = 0; -/* init the zlib */ -s-zstream.zalloc = ff_png_zalloc; -s-zstream.zfree = ff_png_zfree; -s-zstream.opaque = NULL; -ret = inflateInit(s-zstream); -if (ret != Z_OK) { -av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); -return AVERROR_EXTERNAL; -} - if ((ret = decode_frame_common(avctx, s, p, avpkt)) 0) goto the_end; @@ -944,7 +927,6 @@ static int decode_frame_png(AVCodecContext *avctx, ret = bytestream2_tell(s-gb); the_end: -inflateEnd(s-zstream); s-crow_buf = NULL; return ret; } @@ -967,6 +949,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) static av_cold int png_dec_init(AVCodecContext *avctx) { PNGDecContext *s = avctx-priv_data; +int ret; s-avctx = avctx; s-last_picture.f = av_frame_alloc(); @@ -979,6 +962,16 @@ static av_cold int png_dec_init(AVCodecContext *avctx) ff_pngdsp_init(s-dsp); } +/* init the zlib */ +s-zstream.zalloc = ff_png_zalloc; +s-zstream.zfree = ff_png_zfree; +s-zstream.opaque = NULL; +ret = inflateInit(s-zstream); +if (ret != Z_OK) { +av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); +return AVERROR_EXTERNAL; +} + return 0; } @@ -996,6 +989,7 @@ static av_cold int png_dec_end(AVCodecContext *avctx) s-last_row_size = 0; av_freep(s-tmp_row); s-tmp_row_size = 0; +inflateEnd(s-zstream); return 0; } -- 2.2.0.rc1.23.gf570943 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.
Hi, - Mail original - --- libavcodec/pngdec.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..e3d61f6 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -411,11 +411,6 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, unsigned buf_size; int ret; -zstream.zalloc = ff_png_zalloc; -zstream.zfree = ff_png_zfree; -zstream.opaque = NULL; -if (inflateInit(zstream) != Z_OK) -return AVERROR_EXTERNAL; zstream.next_in = (unsigned char *)data; zstream.avail_in = data_end - data; av_bprint_init(bp, 0, -1); @@ -437,12 +432,10 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, if (ret == Z_STREAM_END) break; } -inflateEnd(zstream); bp-str[bp-len] = 0; return 0; fail: -inflateEnd(zstream); av_bprint_finalize(bp, NULL); return ret; } Actually, this one shouldn't be touched, will resend shortly... -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
Hi Reimar, Because of Windows RT cannot use CryptographicBuffer or _beginthreadex API, so I try to use rand() instead of it, or we need to write own function instead of it. If we use WinRT api to instead of these apis, it will cause more bugs. Best regards,Jesse From: reimar.doeffin...@gmx.de Date: Thu, 20 Nov 2014 09:18:30 +0100 To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On 20 November 2014 08:34:54 CET, Jesse Jiang jessejiang0...@outlook.com wrote: Add WinRT API supports At least 2 fairly major issues: 1) using rand() basically never is correct. Use the appropriate CryptographicBuffer function (yes, that means you need some C++ code unfortunately). 2) CreateThread is not compatible with _beginthreadex, there is a good reason why we use this. Using the other without additional changes will cause memleaks or worse. I am not even sure it is at all possible to use CreateThread correctly for us. ___ 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] avcodec/pngdec: init zlib on decoder init.
Le decadi 30 brumaire, an CCXXIII, Benoit Fouet a écrit : --- libavcodec/pngdec.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..e3d61f6 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -411,11 +411,6 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, unsigned buf_size; int ret; -zstream.zalloc = ff_png_zalloc; -zstream.zfree = ff_png_zfree; -zstream.opaque = NULL; -if (inflateInit(zstream) != Z_OK) -return AVERROR_EXTERNAL; What happens if one frame contains a damaged zTXt and the next one a valid one? With the current code, since the zstream is inited each time, the first one gives whatever it gives and the second one works normally. With the modified code, I am afraid that the unpredictable state at the end of the damaged frame will be kept for the good one. zstream.next_in = (unsigned char *)data; zstream.avail_in = data_end - data; av_bprint_init(bp, 0, -1); @@ -437,12 +432,10 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, if (ret == Z_STREAM_END) break; } -inflateEnd(zstream); bp-str[bp-len] = 0; return 0; fail: -inflateEnd(zstream); av_bprint_finalize(bp, NULL); return ret; } @@ -924,16 +917,6 @@ static int decode_frame_png(AVCodecContext *avctx, s-y = s-state = 0; -/* init the zlib */ -s-zstream.zalloc = ff_png_zalloc; -s-zstream.zfree = ff_png_zfree; -s-zstream.opaque = NULL; -ret = inflateInit(s-zstream); -if (ret != Z_OK) { -av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); -return AVERROR_EXTERNAL; -} - if ((ret = decode_frame_common(avctx, s, p, avpkt)) 0) goto the_end; @@ -944,7 +927,6 @@ static int decode_frame_png(AVCodecContext *avctx, ret = bytestream2_tell(s-gb); the_end: -inflateEnd(s-zstream); s-crow_buf = NULL; return ret; } @@ -967,6 +949,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) static av_cold int png_dec_init(AVCodecContext *avctx) { PNGDecContext *s = avctx-priv_data; +int ret; s-avctx = avctx; s-last_picture.f = av_frame_alloc(); @@ -979,6 +962,16 @@ static av_cold int png_dec_init(AVCodecContext *avctx) ff_pngdsp_init(s-dsp); } +/* init the zlib */ +s-zstream.zalloc = ff_png_zalloc; +s-zstream.zfree = ff_png_zfree; +s-zstream.opaque = NULL; +ret = inflateInit(s-zstream); +if (ret != Z_OK) { +av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); +return AVERROR_EXTERNAL; +} + return 0; } @@ -996,6 +989,7 @@ static av_cold int png_dec_end(AVCodecContext *avctx) s-last_row_size = 0; av_freep(s-tmp_row); s-tmp_row_size = 0; +inflateEnd(s-zstream); return 0; } Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.
--- libavcodec/pngdec.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..8467443 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -924,16 +924,6 @@ static int decode_frame_png(AVCodecContext *avctx, s-y = s-state = 0; -/* init the zlib */ -s-zstream.zalloc = ff_png_zalloc; -s-zstream.zfree = ff_png_zfree; -s-zstream.opaque = NULL; -ret = inflateInit(s-zstream); -if (ret != Z_OK) { -av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); -return AVERROR_EXTERNAL; -} - if ((ret = decode_frame_common(avctx, s, p, avpkt)) 0) goto the_end; @@ -944,7 +934,6 @@ static int decode_frame_png(AVCodecContext *avctx, ret = bytestream2_tell(s-gb); the_end: -inflateEnd(s-zstream); s-crow_buf = NULL; return ret; } @@ -967,6 +956,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) static av_cold int png_dec_init(AVCodecContext *avctx) { PNGDecContext *s = avctx-priv_data; +int ret; s-avctx = avctx; s-last_picture.f = av_frame_alloc(); @@ -979,6 +969,16 @@ static av_cold int png_dec_init(AVCodecContext *avctx) ff_pngdsp_init(s-dsp); } +/* init the zlib */ +s-zstream.zalloc = ff_png_zalloc; +s-zstream.zfree = ff_png_zfree; +s-zstream.opaque = NULL; +ret = inflateInit(s-zstream); +if (ret != Z_OK) { +av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); +return AVERROR_EXTERNAL; +} + return 0; } @@ -996,6 +996,7 @@ static av_cold int png_dec_end(AVCodecContext *avctx) s-last_row_size = 0; av_freep(s-tmp_row); s-tmp_row_size = 0; +inflateEnd(s-zstream); return 0; } -- 2.2.0.rc1.23.gf570943 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
This is of course, completly wrong. The replacement is CryptographicBuffer, allowed in WinRT. On 20 Nov, Jesse Jiang wrote : Hi Reimar, Because of Windows RT cannot use CryptographicBuffer or _beginthreadex API, so I try to use rand() instead of it, or we need to write own function instead of it. If we use WinRT api to instead of these apis, it will cause more bugs. Best regards,Jesse From: reimar.doeffin...@gmx.de Date: Thu, 20 Nov 2014 09:18:30 +0100 To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On 20 November 2014 08:34:54 CET, Jesse Jiang jessejiang0...@outlook.com wrote: Add WinRT API supports At least 2 fairly major issues: 1) using rand() basically never is correct. Use the appropriate CryptographicBuffer function (yes, that means you need some C++ code unfortunately). 2) CreateThread is not compatible with _beginthreadex, there is a good reason why we use this. Using the other without additional changes will cause memleaks or worse. I am not even sure it is at all possible to use CreateThread correctly for us. ___ 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 -- With my kindest regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
On 20 Nov, Jesse Jiang wrote : Add WinRT API supports This patch is wrong on almost every level. rand() is wrong. modifying configure because your headers are broken is wrong too. doing an API rewrapper in FFmpeg is the wrong place, look at winstorecompat in mingw-w64. With my kindest regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.
Hi, - Mail original - Le decadi 30 brumaire, an CCXXIII, Benoit Fouet a écrit : --- libavcodec/pngdec.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..e3d61f6 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -411,11 +411,6 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data, unsigned buf_size; int ret; -zstream.zalloc = ff_png_zalloc; -zstream.zfree = ff_png_zfree; -zstream.opaque = NULL; -if (inflateInit(zstream) != Z_OK) -return AVERROR_EXTERNAL; What happens if one frame contains a damaged zTXt and the next one a valid one? With the current code, since the zstream is inited each time, the first one gives whatever it gives and the second one works normally. With the modified code, I am afraid that the unpredictable state at the end of the damaged frame will be kept for the good one. I expect the new patch should address your issue. Cheers, -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.
Le decadi 30 brumaire, an CCXXIII, Benoit Fouet a écrit : --- libavcodec/pngdec.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..8467443 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -924,16 +924,6 @@ static int decode_frame_png(AVCodecContext *avctx, s-y = s-state = 0; -/* init the zlib */ -s-zstream.zalloc = ff_png_zalloc; -s-zstream.zfree = ff_png_zfree; -s-zstream.opaque = NULL; -ret = inflateInit(s-zstream); -if (ret != Z_OK) { -av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); -return AVERROR_EXTERNAL; -} I expect the new patch should address your issue. AFAICS, the buffer is still inited once and for all and not reset between frames. Or did I miss something? - if ((ret = decode_frame_common(avctx, s, p, avpkt)) 0) goto the_end; @@ -944,7 +934,6 @@ static int decode_frame_png(AVCodecContext *avctx, ret = bytestream2_tell(s-gb); the_end: -inflateEnd(s-zstream); s-crow_buf = NULL; return ret; } @@ -967,6 +956,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) static av_cold int png_dec_init(AVCodecContext *avctx) { PNGDecContext *s = avctx-priv_data; +int ret; s-avctx = avctx; s-last_picture.f = av_frame_alloc(); @@ -979,6 +969,16 @@ static av_cold int png_dec_init(AVCodecContext *avctx) ff_pngdsp_init(s-dsp); } +/* init the zlib */ +s-zstream.zalloc = ff_png_zalloc; +s-zstream.zfree = ff_png_zfree; +s-zstream.opaque = NULL; +ret = inflateInit(s-zstream); +if (ret != Z_OK) { +av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); +return AVERROR_EXTERNAL; +} + return 0; } @@ -996,6 +996,7 @@ static av_cold int png_dec_end(AVCodecContext *avctx) s-last_row_size = 0; av_freep(s-tmp_row); s-tmp_row_size = 0; +inflateEnd(s-zstream); return 0; } Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.
Hi, - Mail original - Le decadi 30 brumaire, an CCXXIII, Benoit Fouet a écrit : --- libavcodec/pngdec.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..8467443 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -924,16 +924,6 @@ static int decode_frame_png(AVCodecContext *avctx, s-y = s-state = 0; -/* init the zlib */ -s-zstream.zalloc = ff_png_zalloc; -s-zstream.zfree = ff_png_zfree; -s-zstream.opaque = NULL; -ret = inflateInit(s-zstream); -if (ret != Z_OK) { -av_log(avctx, AV_LOG_ERROR, inflateInit returned error %d\n, ret); -return AVERROR_EXTERNAL; -} I expect the new patch should address your issue. AFAICS, the buffer is still inited once and for all and not reset between frames. Or did I miss something? I did, you didn't. Actually, I didn't test multiple PNG frames in a container, which would be the way to trigger this, I think. So, I've just tested that, and you are correct. I'll drop this patch. Thanks for your input! -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] ffmpeg: fix indention
indentation* [...] -- Clément B. pgpgGb9NhW91e.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Fix restrict bug
On Thu, Nov 20, 2014 at 07:36:55AM +, Jesse Jiang wrote: *restrict has been replaced by av_restrict. I meet this bug when I compiler for ARM in VS. There should be some other places need to be replaced. Best regards,Jesse float_dsp_init_vfp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 15a5de27155dff04e9cc2e2dc36a4adfa193be80 0002-restrict-bug-should-be-replaced-by-av_restrict.patch From b4077d6d8aead4eb238b5ff0902a0563618abf16 Mon Sep 17 00:00:00 2001 From: jessejiang jesseji...@pptv.com Date: Thu, 20 Nov 2014 15:32:56 +0800 Subject: [PATCH 2/2] *restrict bug should be replaced by av_restrict applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
Hi JB, Based on my understanding, mingw-w64 need gcc, so in this way, we need to linked gcc library into our App. I don't want a big library with our Apps. I know the mingw is a correct way, but how could it works with MSVC? Date: Thu, 20 Nov 2014 09:53:27 +0100 From: j...@videolan.org To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On 20 Nov, Jesse Jiang wrote : Add WinRT API supports This patch is wrong on almost every level. rand() is wrong. modifying configure because your headers are broken is wrong too. doing an API rewrapper in FFmpeg is the wrong place, look at winstorecompat in mingw-w64. With my kindest regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ 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] WinRT API support patch
1. libgcc is not big 2. MSVC 2013 has correctly defined headers to solve the rand issue and the configure part. Le 20/11/2014 11:34, Jesse Jiang a écrit : Hi JB, Based on my understanding, mingw-w64 need gcc, so in this way, we need to linked gcc library into our App. I don't want a big library with our Apps. I know the mingw is a correct way, but how could it works with MSVC? Date: Thu, 20 Nov 2014 09:53:27 +0100 From: j...@videolan.org To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On 20 Nov, Jesse Jiang wrote : Add WinRT API supports This patch is wrong on almost every level. rand() is wrong. modifying configure because your headers are broken is wrong too. doing an API rewrapper in FFmpeg is the wrong place, look at winstorecompat in mingw-w64. With my kindest regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ 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 -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: Prevent icl being incorrectly detected as msvc.
On Thu, Nov 20, 2014 at 09:40:03AM +0100, Benoit Fouet wrote: Hi, - Mail original - Intel compiler xilink will also output the information from the underlying Microsoft linker. A result is that both the Intel info header and the Microsoft info header are output. This means that currently the Intel linker will get detected as the msvc linker incorrectly as configure checks for the presence of Microsoft first. This patch just changes the order of detection so that Intel is checked first. This allows intel to be detected correctly and also fixes an error with lto with icl. LGTM applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] avformat/apngdec: add APNG demuxer.
--- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/apngdec.c| 409 +++ 3 files changed, 411 insertions(+) create mode 100644 libavformat/apngdec.c diff --git a/libavformat/Makefile b/libavformat/Makefile index 38730c5..c1b5ace 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -76,6 +76,7 @@ OBJS-$(CONFIG_AMR_MUXER) += amr.o OBJS-$(CONFIG_ANM_DEMUXER) += anm.o OBJS-$(CONFIG_APC_DEMUXER) += apc.o OBJS-$(CONFIG_APE_DEMUXER) += ape.o apetag.o img2.o +OBJS-$(CONFIG_APNG_DEMUXER) += apngdec.o OBJS-$(CONFIG_AQTITLE_DEMUXER) += aqtitledec.o subtitles.o OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asf.o asfcrypt.o \ avlanguage.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 3f60d7d..81aab56 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -74,6 +74,7 @@ void av_register_all(void) REGISTER_DEMUXER (ANM, anm); REGISTER_DEMUXER (APC, apc); REGISTER_DEMUXER (APE, ape); +REGISTER_DEMUXER (APNG, apng); REGISTER_DEMUXER (AQTITLE, aqtitle); REGISTER_MUXDEMUX(ASF, asf); REGISTER_MUXDEMUX(ASS, ass); diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c new file mode 100644 index 000..54fbd29 --- /dev/null +++ b/libavformat/apngdec.c @@ -0,0 +1,409 @@ +/* + * APNG demuxer + * Copyright (c) 2014 Benoit Fouet + * + * 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 + */ + +/** + * @file + * APNG demuxer. + * @see https://wiki.mozilla.org/APNG_Specification + * @see http://www.w3.org/TR/PNG + * + * Not supported (yet): + * - streams with chunks other than fcTL / fdAT / IEND after the first fcTL + * - streams with multiple fdAT chunks after an fcTL one + */ + +#include avformat.h +#include avio_internal.h +#include internal.h +#include libavutil/imgutils.h +#include libavutil/intreadwrite.h +#include libavutil/opt.h +#include libavcodec/png.h +#include libavcodec/bytestream.h + +#define DEFAULT_APNG_FPS 15 + +typedef struct APNGDemuxContext { +const AVClass *class; + +int max_fps; +int default_fps; + +int is_key_frame; + +/* + * loop options + */ +int ignore_loop; +uint32_t num_frames; +uint32_t num_play; +uint32_t cur_loop; +} APNGDemuxContext; + +/* + * To be a valid APNG file, we mandate, in this order: + * PNGSIG + * IHDR + * ... + * acTL + * ... + * IDAT + */ +static int apng_probe(AVProbeData *p) +{ +GetByteContext gb; +int state = 0; +uint32_t len, tag; + +bytestream2_init(gb, p-buf, p-buf_size); + +if (bytestream2_get_be64(gb) != PNGSIG) +return 0; + +for (;;) { +len = bytestream2_get_be32(gb); +if (len 0x7fff) +return 0; + +tag = bytestream2_get_le32(gb); +/* we don't check IDAT size, as this is the last tag + * we check, and it may be larger than the probe buffer */ +if (tag != MKTAG('I', 'D', 'A', 'T') +len bytestream2_get_bytes_left(gb)) +return 0; + +switch (tag) { +case MKTAG('I', 'H', 'D', 'R'): +if (len != 13) +return 0; +if (av_image_check_size(bytestream2_get_be32(gb), bytestream2_get_be32(gb), 0, NULL)) +return 0; +bytestream2_skip(gb, 9); +state++; +break; +case MKTAG('a', 'c', 'T', 'L'): +if (state != 1 || +len != 8 || +bytestream2_get_be32(gb) == 0) /* 0 is not a valid value for number of frames */ +return 0; +bytestream2_skip(gb, 8); +state++; +break; +case MKTAG('I', 'D', 'A', 'T'): +if (state != 2) +return 0; +goto end; +default: +/* skip other tags */ +bytestream2_skip(gb, len + 4); +break; +} +} + +end: +return AVPROBE_SCORE_MAX; +} + +static int append_extradata(AVCodecContext *s,
Re: [FFmpeg-devel] [PATCH] configure: Prevent icl being incorrectly detected as msvc.
On 11/20/2014 8:40 AM, Benoit Fouet wrote: LGTM http://fate.ffmpeg.org/report.cgi?time=20141120142015slot=i686-windows-icl - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffplay: fix mem leak when opening input or parsing options fail.
--- ffplay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffplay.c b/ffplay.c index f79161d..3009c82 100644 --- a/ffplay.c +++ b/ffplay.c @@ -3169,8 +3169,8 @@ static int read_thread(void *arg) stream_component_close(is, is-video_stream); if (is-subtitle_stream = 0) stream_component_close(is, is-subtitle_stream); -if (is-ic) { -avformat_close_input(is-ic); +if (ic) { +avformat_close_input(ic); } if (ret != 0) { -- 2.2.0.rc2.23.gca0107e ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] avcodec/pngdec: add APNG support.
On Thu, Nov 20, 2014 at 03:07:17PM +0100, Benoit Fouet wrote: --- libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/avcodec.h| 1 + libavcodec/codec_desc.c | 8 +++ libavcodec/pngdec.c | 142 +++- 5 files changed, 150 insertions(+), 3 deletions(-) apng is missing a dependancy on zlib in configure (see png in configure) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato 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: Prevent icl being incorrectly detected as msvc.
On 21 November 2014 01:23, Derek Buitenhuis derek.buitenh...@gmail.com wrote: On 11/20/2014 8:40 AM, Benoit Fouet wrote: LGTM http://fate.ffmpeg.org/report.cgi?time=20141120142015slot=i686-windows-icl - Derek Works fine with lto, but apparently one shouldnt assume the existing code is correct for the other cases :P. It appears there was actually an error in configure thats been there all along that was never found as it was incorrectly detecting icl linker as msvc. Anyway its just missing a couple of values that are set for msvc but werent for icl. Im testing a patch now so should have fixed it soon. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/6] lavc/v4l2-common: Add pack_flags to v4l2 conversion tables and extend the mapping function to use it.
It serves to distinguish if we will (de)packetize the format from an AVFrame or an AVPacket. We will need AVFrame support for v4l m2m and we can certainly not use as-is e.g. V4L2_PIX_FMT_YUV420 as AV_PIX_FMT_YUV420P since the former is pseudo-packed while the later is planar. Also, V4L multi planar formats cannot be packetized into raw video AVPackets. --- libavcodec/v4l2-common.c | 63 libavcodec/v4l2-common.h | 7 +- libavdevice/v4l2.c | 2 +- libavdevice/v4l2enc.c| 2 +- 4 files changed, 40 insertions(+), 34 deletions(-) diff --git a/libavcodec/v4l2-common.c b/libavcodec/v4l2-common.c index 884101d..815a5c4 100644 --- a/libavcodec/v4l2-common.c +++ b/libavcodec/v4l2-common.c @@ -19,49 +19,49 @@ #include v4l2-common.h const struct v4l_fmt_map avpriv_v4l_fmt_conversion_table[] = { -//ff_fmt codec_id v4l2_fmt -{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 }, -{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 }, -{ AV_PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P }, -{ AV_PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV}, -{ AV_PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY}, -{ AV_PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P }, -{ AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 }, -{ AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU410 }, -{ AV_PIX_FMT_RGB555LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 }, -{ AV_PIX_FMT_RGB555BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X }, -{ AV_PIX_FMT_RGB565LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 }, -{ AV_PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X }, -{ AV_PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 }, -{ AV_PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 }, -{ AV_PIX_FMT_BGR0,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 }, -{ AV_PIX_FMT_0RGB,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 }, -{ AV_PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY}, +//ff_fmt codec_id v4l2_fmt pack_flags +{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 , FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 , FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P, FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P, FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 , FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU410 , FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_RGB555LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_RGB555BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X, FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_RGB565LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X, FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_BGR0,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_0RGB,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, +{ AV_PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, #ifdef V4L2_PIX_FMT_Y16 -{ AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Y16 }, +{ AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Y16, FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, #endif -{ AV_PIX_FMT_NV12,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12}, -{ AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_MJPEG }, -{ AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_JPEG}, +{ AV_PIX_FMT_NV12,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 , FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_MJPEG , FF_V4L_PACK_AVPACKET }, +{ AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_JPEG , FF_V4L_PACK_AVPACKET }, #ifdef V4L2_PIX_FMT_H264 -{ AV_PIX_FMT_NONE,
[FFmpeg-devel] [PATCH 1/6] Move lavd/v4l2-common.* to lavc.
This code needs lavc for AV_CODEC_ID_* and can be used by lavc lavfi with v4l m2m support. --- configure | 6 ++- libavcodec/Makefile | 1 + libavcodec/v4l2-common.c | 105 ++ libavcodec/v4l2-common.h | 47 + libavdevice/Makefile | 6 +-- libavdevice/v4l2-common.c | 105 -- libavdevice/v4l2-common.h | 62 --- libavdevice/v4l2.c| 38 - libavdevice/v4l2enc.c | 12 +- 9 files changed, 196 insertions(+), 186 deletions(-) create mode 100644 libavcodec/v4l2-common.c create mode 100644 libavcodec/v4l2-common.h delete mode 100644 libavdevice/v4l2-common.c delete mode 100644 libavdevice/v4l2-common.h diff --git a/configure b/configure index c0aa718..81a6acf 100755 --- a/configure +++ b/configure @@ -1467,6 +1467,7 @@ SUBSYSTEM_LIST= pixelutils network rdft +v4l2 CONFIG_LIST= @@ -2051,6 +2052,7 @@ mpegaudio_select=mpegaudiodsp mpegaudiodsp_select=dct mpegvideo_select=blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp mpegvideoenc_select=me_cmp mpegvideo pixblockdsp qpeldsp +v4l2_deps_any=linux_videodev2_h sys_videoio_h # decoders / encoders aac_decoder_select=mdct sinewin @@ -2496,8 +2498,8 @@ sdl_outdev_deps=sdl sndio_indev_deps=sndio_h sndio_outdev_deps=sndio_h v4l_indev_deps=linux_videodev_h -v4l2_indev_deps_any=linux_videodev2_h sys_videoio_h -v4l2_outdev_deps_any=linux_videodev2_h sys_videoio_h +v4l2_indev_select=v4l2 +v4l2_outdev_select=v4l2 vfwcap_indev_deps=capCreateCaptureWindow vfwcap_defines vfwcap_indev_extralibs=-lavicap32 xv_outdev_deps=X11_extensions_Xvlib_h XvGetPortAttribute diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 6c625ce..a134fa6 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -95,6 +95,7 @@ OBJS-$(CONFIG_SHARED) += log2_tab.o OBJS-$(CONFIG_SINEWIN) += sinewin.o OBJS-$(CONFIG_STARTCODE) += startcode.o OBJS-$(CONFIG_TPELDSP) += tpeldsp.o +OBJS-$(CONFIG_V4L2)+= v4l2-common.o OBJS-$(CONFIG_VIDEODSP)+= videodsp.o OBJS-$(CONFIG_VP3DSP) += vp3dsp.o OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o diff --git a/libavcodec/v4l2-common.c b/libavcodec/v4l2-common.c new file mode 100644 index 000..884101d --- /dev/null +++ b/libavcodec/v4l2-common.c @@ -0,0 +1,105 @@ +/* + * 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 v4l2-common.h + +const struct v4l_fmt_map avpriv_v4l_fmt_conversion_table[] = { +//ff_fmt codec_id v4l2_fmt +{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 }, +{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 }, +{ AV_PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P }, +{ AV_PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV}, +{ AV_PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY}, +{ AV_PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P }, +{ AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 }, +{ AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU410 }, +{ AV_PIX_FMT_RGB555LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 }, +{ AV_PIX_FMT_RGB555BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X }, +{ AV_PIX_FMT_RGB565LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 }, +{ AV_PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X }, +{ AV_PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 }, +{ AV_PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 }, +{ AV_PIX_FMT_BGR0,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 }, +{ AV_PIX_FMT_0RGB,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 }, +{ AV_PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY}, +#ifdef V4L2_PIX_FMT_Y16 +{ AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Y16 }, +#endif +{ AV_PIX_FMT_NV12,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12}, +{ AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,V4L2_PIX_FMT_MJPEG }, +{ AV_PIX_FMT_NONE,AV_CODEC_ID_MJPEG,
[FFmpeg-devel] [PATCH 3/6] Add AV_PIX_FMT_NV12T.
This is the only format supported by MFC5 HW decoders (e.g. Samsung exynos 4412). --- libavutil/pixdesc.c | 12 libavutil/pixfmt.h | 1 + 2 files changed, 13 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 648d014..426dfd4 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -1900,6 +1900,18 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { .name = vda, .flags = AV_PIX_FMT_FLAG_HWACCEL, }, +[AV_PIX_FMT_NV12T] = { +.name = nv12t, +.nb_components = 3, +.log2_chroma_w = 1, +.log2_chroma_h = 1, +.comp = { +{ 0, 0, 1, 0, 7 },/* Y */ +{ 1, 1, 1, 0, 7 },/* U */ +{ 1, 1, 2, 0, 7 },/* V */ +}, +.flags = AV_PIX_FMT_FLAG_PLANAR, +}, }; static const char *color_range_names[AVCOL_RANGE_NB] = { diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 756a1a7..c6709a1 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -289,6 +289,7 @@ enum AVPixelFormat { #if !FF_API_XVMC AV_PIX_FMT_XVMC,/// XVideo Motion Acceleration via common packet passing #endif /* !FF_API_XVMC */ +AV_PIX_FMT_NV12T, /// Same as NV12 except the coordinates differ: Z-shape tiled 64x32 macroblocks. V4L2 specific format corresponding to V4L2_PIX_FMT_NV12MT AV_PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions -- 2.1.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/6] lavc/v4l2-common.c: Add more v4l2 coded formats and multi planar raw formats.
--- libavcodec/v4l2-common.c | 33 + 1 file changed, 33 insertions(+) diff --git a/libavcodec/v4l2-common.c b/libavcodec/v4l2-common.c index 815a5c4..80e1365 100644 --- a/libavcodec/v4l2-common.c +++ b/libavcodec/v4l2-common.c @@ -58,6 +58,39 @@ const struct v4l_fmt_map avpriv_v4l_fmt_conversion_table[] = { { AV_PIX_FMT_BAYER_GRBG8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SGRBG8 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, { AV_PIX_FMT_BAYER_RGGB8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SRGGB8 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME }, #endif +#ifdef V4L2_PIX_FMT_NV12M +{ AV_PIX_FMT_NV12,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12M , FF_V4L_PACK_AVFRAME }, +#endif +#ifdef V4L2_PIX_FMT_NV21M +{ AV_PIX_FMT_NV21,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV21M , FF_V4L_PACK_AVFRAME }, +#endif +#ifdef V4L2_PIX_FMT_NV12MT +{ AV_PIX_FMT_NV12T, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12MT , FF_V4L_PACK_AVFRAME }, +#endif +#ifdef V4L2_PIX_FMT_YUV420M +{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420M, FF_V4L_PACK_AVFRAME }, +#endif +#ifdef V4L2_PIX_FMT_NV16M +{ AV_PIX_FMT_NV16,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV16M , FF_V4L_PACK_AVFRAME }, +#endif +#ifdef V4L2_PIX_FMT_DV +{ AV_PIX_FMT_NONE,AV_CODEC_ID_DVVIDEO, V4L2_PIX_FMT_DV , FF_V4L_PACK_AVPACKET }, +#endif +#ifdef V4L2_PIX_FMT_H263 +{ AV_PIX_FMT_NONE,AV_CODEC_ID_H263, V4L2_PIX_FMT_H263 , FF_V4L_PACK_AVPACKET }, +#endif +#ifdef V4L2_PIX_FMT_MPEG1 +{ AV_PIX_FMT_NONE,AV_CODEC_ID_MPEG1VIDEO, V4L2_PIX_FMT_MPEG1, FF_V4L_PACK_AVPACKET }, +#endif +#ifdef V4L2_PIX_FMT_MPEG2 +{ AV_PIX_FMT_NONE,AV_CODEC_ID_MPEG2VIDEO, V4L2_PIX_FMT_MPEG2, FF_V4L_PACK_AVPACKET }, +#endif +#ifdef V4L2_PIX_FMT_VC1_ANNEX_G +{ AV_PIX_FMT_NONE,AV_CODEC_ID_VC1, V4L2_PIX_FMT_VC1_ANNEX_G, FF_V4L_PACK_AVPACKET }, +#endif +#ifdef V4L2_PIX_FMT_VP8 +{ AV_PIX_FMT_NONE,AV_CODEC_ID_VP8, V4L2_PIX_FMT_VP8, FF_V4L_PACK_AVPACKET }, +#endif { AV_PIX_FMT_NONE,AV_CODEC_ID_NONE, 0}, }; -- 2.1.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 5/6] Add support for V4L2 mem2mem codecs.
Default buffer settings should work with all drivers (mmaped memory from the driver) but would imply useless memcpy()'s if used in the standard way. libavcodec/v4l2.h is now installed to allow applications to get the proper buffers to avoid these copies. This has been tested on MFC5, on a Samsung exynos 4412 SOC (odroid u3). --- Changelog | 1 + configure | 17 +- libavcodec/Makefile | 15 +- libavcodec/allcodecs.c| 7 + libavcodec/v4l2-buffers.c | 725 ++ libavcodec/v4l2-buffers.h | 230 ++ libavcodec/v4l2.h | 66 libavcodec/v4l2_m2m.c | 277 libavcodec/v4l2_m2m.h | 86 + libavcodec/v4l2_m2m_avcodec.h | 30 ++ libavcodec/v4l2_m2m_dec.c | 227 + libavcodec/v4l2_m2m_enc.c | 232 ++ 12 files changed, 1911 insertions(+), 2 deletions(-) create mode 100644 libavcodec/v4l2-buffers.c create mode 100644 libavcodec/v4l2-buffers.h create mode 100644 libavcodec/v4l2.h create mode 100644 libavcodec/v4l2_m2m.c create mode 100644 libavcodec/v4l2_m2m.h create mode 100644 libavcodec/v4l2_m2m_avcodec.h create mode 100644 libavcodec/v4l2_m2m_dec.c create mode 100644 libavcodec/v4l2_m2m_enc.c diff --git a/Changelog b/Changelog index 5f38aea..5910ef6 100644 --- a/Changelog +++ b/Changelog @@ -15,6 +15,7 @@ version next: - ffserver supports codec private options - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer - WebP muxer with animated WebP support +- V4L2 mem2mem HW accelerated codecs support version 2.4: diff --git a/configure b/configure index 81a6acf..68a64e2 100755 --- a/configure +++ b/configure @@ -150,6 +150,7 @@ Component options: Hardware accelerators: --disable-dxva2 disable DXVA2 code [autodetect] + --disable-v4l2_m2m disable V4L2 mem2mem code [autodetect] --disable-vaapi disable VAAPI code [autodetect] --disable-vdadisable VDA code [autodetect] --disable-vdpau disable VDPAU code [autodetect] @@ -1423,6 +1424,7 @@ FEATURE_LIST= HWACCEL_LIST= dxva2 +v4l2_m2m vaapi vda vdpau @@ -2053,6 +2055,7 @@ mpegaudiodsp_select=dct mpegvideo_select=blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp mpegvideoenc_select=me_cmp mpegvideo pixblockdsp qpeldsp v4l2_deps_any=linux_videodev2_h sys_videoio_h +v4l2_m2m_select=v4l2 # decoders / encoders aac_decoder_select=mdct sinewin @@ -2121,10 +2124,14 @@ h261_decoder_select=mpeg_er mpegvideo h261_encoder_select=aandcttables mpegvideoenc h263_decoder_select=error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp h263_encoder_select=aandcttables h263dsp mpegvideoenc +h263_v4l2m2m_decoder_deps=v4l2_m2m +h263_v4l2m2m_encoder_deps=v4l2_m2m h263i_decoder_select=h263_decoder h263p_encoder_select=h263_encoder h264_decoder_select=cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp h264_decoder_suggest=error_resilience +h264_v4l2m2m_decoder_deps=v4l2_m2m +h264_v4l2m2m_encoder_deps=v4l2_m2m hevc_decoder_select=bswapdsp cabac golomb videodsp huffyuv_decoder_select=bswapdsp huffyuvdsp llviddsp huffyuv_encoder_select=bswapdsp huffman huffyuvencdsp llviddsp @@ -2160,13 +2167,17 @@ mpc7_decoder_select=bswapdsp mpegaudiodsp mpc8_decoder_select=mpegaudiodsp mpeg_xvmc_decoder_deps=X11_extensions_XvMClib_h mpeg_xvmc_decoder_select=mpeg2video_decoder +mpeg1_v4l2m2m_decoder_deps=v4l2_m2m mpegvideo_decoder_select=error_resilience mpeg_er mpegvideo mpeg1video_decoder_select=error_resilience mpeg_er mpegvideo mpeg1video_encoder_select=aandcttables mpegvideoenc h263dsp +mpeg2_v4l2m2m_decoder_deps=v4l2_m2m mpeg2video_decoder_select=error_resilience mpeg_er mpegvideo mpeg2video_encoder_select=aandcttables mpegvideoenc h263dsp mpeg4_decoder_select=h263_decoder mpeg4video_parser mpeg4_encoder_select=h263_encoder +mpeg4_v4l2m2m_decoder_deps=v4l2_m2m +mpeg4_v4l2m2m_encoder_deps=v4l2_m2m msmpeg4v1_decoder_select=h263_decoder msmpeg4v2_decoder_select=h263_decoder msmpeg4v2_encoder_select=h263_encoder @@ -,6 +2233,7 @@ utvideo_decoder_select=bswapdsp utvideo_encoder_select=bswapdsp huffman huffyuvencdsp vble_decoder_select=huffyuvdsp vc1_decoder_select=blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode +vc1_v4l2m2m_decoder_deps=v4l2_m2m vc1image_decoder_select=vc1_decoder vorbis_decoder_select=mdct vorbis_encoder_select=mdct @@ -2232,6 +2244,8 @@ vp6a_decoder_select=vp6_decoder vp6f_decoder_select=vp6_decoder vp7_decoder_select=h264pred videodsp vp8_decoder_select=h264pred videodsp +vp8_v4l2m2m_decoder_deps=v4l2_m2m +vp8_v4l2m2m_encoder_deps=v4l2_m2m vp9_decoder_select=videodsp vp9_parser webp_decoder_select=vp8_decoder wmalossless_decoder_select=llauddsp @@ -2727,7 +2741,7 @@ sws_max_filter_size_default=256 set_default sws_max_filter_size # Enable hwaccels by
[FFmpeg-devel] [PATCH 6/6] Add V4L2 m2m filter support. Very useful for HW accelerated format conversion scaling.
--- Changelog | 2 +- configure | 1 + libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_v4l2_m2m.c | 250 ++ 5 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 libavfilter/vf_v4l2_m2m.c diff --git a/Changelog b/Changelog index 5910ef6..7b2d2a7 100644 --- a/Changelog +++ b/Changelog @@ -15,7 +15,7 @@ version next: - ffserver supports codec private options - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer - WebP muxer with animated WebP support -- V4L2 mem2mem HW accelerated codecs support +- V4L2 mem2mem HW accelerated codecs and filters support version 2.4: diff --git a/configure b/configure index 68a64e2..5c6c909 100755 --- a/configure +++ b/configure @@ -2620,6 +2620,7 @@ stereo3d_filter_deps=gpl subtitles_filter_deps=avformat avcodec libass super2xsai_filter_deps=gpl tinterlace_filter_deps=gpl +v4l2_m2m_filter_deps=v4l2_m2m vidstabdetect_filter_deps=libvidstab vidstabtransform_filter_deps=libvidstab pixfmts_super2xsai_test_deps=super2xsai_filter diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 2c56e38..6d523be 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -193,6 +193,7 @@ OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o OBJS-$(CONFIG_TRIM_FILTER) += trim.o OBJS-$(CONFIG_UNSHARP_FILTER)+= vf_unsharp.o +OBJS-$(CONFIG_V4L2_M2M_FILTER) += vf_v4l2_m2m.o OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o OBJS-$(CONFIG_VIDSTABDETECT_FILTER) += vidstabutils.o vf_vidstabdetect.o OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER) += vidstabutils.o vf_vidstabtransform.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 2352d44..f2e4e02 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -208,6 +208,7 @@ void avfilter_register_all(void) REGISTER_FILTER(TRANSPOSE, transpose, vf); REGISTER_FILTER(TRIM, trim, vf); REGISTER_FILTER(UNSHARP,unsharp,vf); +REGISTER_FILTER(V4L2_M2M, v4l2_m2m, vf); REGISTER_FILTER(VFLIP, vflip, vf); REGISTER_FILTER(VIDSTABDETECT, vidstabdetect, vf); REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf); diff --git a/libavfilter/vf_v4l2_m2m.c b/libavfilter/vf_v4l2_m2m.c new file mode 100644 index 000..293162a --- /dev/null +++ b/libavfilter/vf_v4l2_m2m.c @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2014 Alexis Ballier + * + * 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 + */ + +/* + * Missing features: + * - get_buffer + * - effects (hflip, vflip, etc.) + */ +#include sys/ioctl.h + +#include libavcodec/avcodec.h +#include libavcodec/v4l2_m2m.h +#include libavcodec/v4l2-common.h +#include libavutil/pixdesc.h +#include libavutil/opt.h +#include avfilter.h +#include formats.h +#include internal.h + +static av_cold void uninit(AVFilterContext *ctx) { +V4Lm2mContext *s = ctx-priv; +avpriv_v4lm2m_end(s); +} + +static av_cold int init(AVFilterContext *ctx) { +V4Lm2mContext *s = ctx-priv; + +s-output_pool.default_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; +s-capture_pool.default_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; + +// For probing raw2raw device +s-output_pool.av_codec_id = AV_CODEC_ID_RAWVIDEO; +s-output_pool.av_pix_fmt = AV_PIX_FMT_NONE; +s-output_pool_needs_format = 1; + +// We must have 1:1 input:output mapping, so we wait for the device to process data. +s-capture_pool.blocking_dequeue = 100; + +// For probing raw2raw device +s-capture_pool.av_codec_id = AV_CODEC_ID_RAWVIDEO; +s-capture_pool.av_pix_fmt = AV_PIX_FMT_NONE; +s-capture_pool_needs_format = 1; + +return avpriv_v4lm2m_init(s, ctx); +} + +static int query_formats_local(AVFilterFormats **fmts, V4Lm2mContext *s, V4LBufferPool* bp) { +int ret; +AVFilterFormats *formats = NULL; +struct v4l2_fmtdesc fmtdesc = { 0 }; +enum AVPixelFormat pixfmt; + +fmtdesc.type = bp-type; + +while(!ioctl(s-fd, VIDIOC_ENUM_FMT, fmtdesc)) { +pixfmt =
[FFmpeg-devel] [RFC] no longer marking native aac encoder as experimental
Hi, currently the native aac encoder is marked as experimental, while the libvo_aacenc encoder is not. However, after reading the wiki [1] and especially the mentioned mail [2], it seems the native encoder is better. Thus I'm wondering if it would make sense to no longer mark the native aac encoder as experimental. This would also solve problems like [3]. Please comment. Best regards, Andreas 1: https://trac.ffmpeg.org/wiki/Encode/AAC#libvo_aacenc 2: https://ffmpeg.org/pipermail/ffmpeg-devel/2013-June/144589.html 3: https://bugs.debian.org/768793 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/6] Add AV_PIX_FMT_NV12T.
On 20 Nov, Alexis Ballier wrote : This is the only format supported by MFC5 HW decoders (e.g. Samsung exynos 4412). Why not convert it to a normal format? With my kindest regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffplay: fix mem leak when opening input or parsing options fail.
On Thu, Nov 20, 2014 at 04:01:27PM +0100, Benoit Fouet wrote: --- ffplay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffplay.c b/ffplay.c index f79161d..3009c82 100644 --- a/ffplay.c +++ b/ffplay.c @@ -3169,8 +3169,8 @@ static int read_thread(void *arg) stream_component_close(is, is-video_stream); if (is-subtitle_stream = 0) stream_component_close(is, is-subtitle_stream); -if (is-ic) { -avformat_close_input(is-ic); +if (ic) { +avformat_close_input(ic); is-ic should be set to NULL i think avformat_close_input did that previously [...] -- 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 3/6] Add AV_PIX_FMT_NV12T.
On Thu, 20 Nov 2014 17:51:54 +0100 Alexis Ballier aball...@gentoo.org wrote: This is the only format supported by MFC5 HW decoders (e.g. Samsung exynos 4412). --- libavutil/pixdesc.c | 12 libavutil/pixfmt.h | 1 + 2 files changed, 13 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 648d014..426dfd4 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -1900,6 +1900,18 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { .name = vda, .flags = AV_PIX_FMT_FLAG_HWACCEL, }, +[AV_PIX_FMT_NV12T] = { +.name = nv12t, +.nb_components = 3, +.log2_chroma_w = 1, +.log2_chroma_h = 1, +.comp = { +{ 0, 0, 1, 0, 7 },/* Y */ +{ 1, 1, 1, 0, 7 },/* U */ +{ 1, 1, 2, 0, 7 },/* V */ +}, +.flags = AV_PIX_FMT_FLAG_PLANAR, +}, }; static const char *color_range_names[AVCOL_RANGE_NB] = { diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 756a1a7..c6709a1 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -289,6 +289,7 @@ enum AVPixelFormat { #if !FF_API_XVMC AV_PIX_FMT_XVMC,/// XVideo Motion Acceleration via common packet passing #endif /* !FF_API_XVMC */ +AV_PIX_FMT_NV12T, /// Same as NV12 except the coordinates differ: Z-shape tiled 64x32 macroblocks. V4L2 specific format corresponding to V4L2_PIX_FMT_NV12MT AV_PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions I think this should be rejected. It's far too special to be useful in general, and it's not even pixel- or line-addressable (Z-shaped tiles, seriously?). It's pretty much a raw codec, not a pixel format. Also, doesn't libv4l2 handle converting this to something sane transparently? If this is needed for the m2m filter, then maybe it should be part of the v4l2 libavdevice. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Ticket #2547
Hi, What is the status of work on Ticket #2547 https://trac.ffmpeg.org/ticket/2547 and the associated patch https://trac.ffmpeg.org/attachment/ticket/2547/0001-libavformat-segment.c-add-muxrate-option-for-segment.patch? I am still running in to an issue with dts pcr, TS is invalid under varying circumstances. I run in to it big time when encoding mpegts with the -muxrate parameter in CasparCG (using ffmpeg libs) and occasionally when using the latest zeranoe build git-4388e78 (2014-11-20). Under the said build of FFmpeg, the problem happens most often when large amounts of the frame change for example cuts to or from black. This problem is not present when not using the -muxrate command. When using variable bit rate, this is not an issue, but the PCR spacing is to large for hardware decoders at the default 20ms. The same events of cutting to or from a black frame cause large fluctuations in the bitrate in VBR mode. I would theorize that this is related to the same event that causes dtspts when using the -muxrate command. A log of my command is attached. Should I post this info in a new ticket, or add to the existing one that singles out the use of the segmenter? Zach PS C:\Users\Zach\Development\ffmpeg-20141120-git-4388e78-win32-static\bin .\ffmpeg -v 9 -loglevel 99 -rtbufsize 1500 f dshow -i video=HP HD Webcam [Fixed] -f dshow -i audio=Stereo Mix (IDT High Definition -f mpegts -mpegts_pmt_sta pid 0x40 -mpegts_start_pid 0x45 -vf fps=29.97,scale=704x480 -muxrate 1000k -vcodec mpeg2video -threads 0 -crf 0 -tu zerolatency -pix_fmt yuv420p -b:v 500k -acodec ac3 -ar 48000 -b:a 50k -me_method epzs udp://239.0.0.230:1234?pkt_siz 88 ffmpeg version N-67838-g4388e78 Copyright (c) 2000-2014 the FFmpeg developers built on Nov 19 2014 22:02:08 with gcc 4.9.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontco g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable- opencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedi r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enab libx265 --enable-libxavs --enable-libxvid --enable-zlib libavutil 54. 14.100 / 54. 14.100 libavcodec 56. 12.101 / 56. 12.101 libavformat56. 14.100 / 56. 14.100 libavdevice56. 3.100 / 56. 3.100 libavfilter 5. 2.103 / 5. 2.103 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc53. 3.100 / 53. 3.100 Splitting the commandline. Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'. Reading option '-rtbufsize' ... matched as AVOption 'rtbufsize' with argument '1500M'. Reading option '-f' ... matched as option 'f' (force format) with argument 'dshow'. Reading option '-i' ... matched as input file with argument 'video=HP HD Webcam [Fixed]'. Reading option '-f' ... matched as option 'f' (force format) with argument 'dshow'. Reading option '-i' ... matched as input file with argument 'audio=Stereo Mix (IDT High Definition'. Reading option '-f' ... matched as option 'f' (force format) with argument 'mpegts'. Reading option '-mpegts_pmt_start_pid' ... matched as AVOption 'mpegts_pmt_start_pid' with argument '0x40'. Reading option '-mpegts_start_pid' ... matched as AVOption 'mpegts_start_pid' with argument '0x45'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'fps=29.97,scale=704x480'. Reading option '-muxrate' ... matched as AVOption 'muxrate' with argument '1000k'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'mp video'. Reading option '-threads' ... matched as AVOption 'threads' with argument '0'. Reading option '-crf' ... matched as AVOption 'crf' with argument '0'. Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'. Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'. Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '500k'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'ac Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'. Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '50k'. Reading option '-me_method' ... matched
Re: [FFmpeg-devel] [RFC] no longer marking native aac encoder as experimental
On Thu, Nov 20, 2014 at 05:59:35PM +0100, Andreas Cadhalpun wrote: Hi, currently the native aac encoder is marked as experimental, while the libvo_aacenc encoder is not. However, after reading the wiki [1] and especially the mentioned mail [2], it seems the native encoder is better. Thus I'm wondering if it would make sense to no longer mark the native aac encoder as experimental. This would also solve problems like [3]. Please comment. i have no real oppinion on this but if users prefer it to be not marked as experimental then we should make that change. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB DNS cache poisoning attacks, popular search engine, Google internet authority dont be evil, please 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: Prevent icl being incorrectly detected as msvc.
On Fri, Nov 21, 2014 at 06:03:36AM +1100, Matt Oliver wrote: On 21 November 2014 02:28, Matt Oliver protogo...@gmail.com wrote: On 21 November 2014 01:23, Derek Buitenhuis derek.buitenh...@gmail.com wrote: On 11/20/2014 8:40 AM, Benoit Fouet wrote: LGTM http://fate.ffmpeg.org/report.cgi?time=20141120142015slot=i686-windows-icl - Derek Works fine with lto, but apparently one shouldnt assume the existing code is correct for the other cases :P. It appears there was actually an error in configure thats been there all along that was never found as it was incorrectly detecting icl linker as msvc. Anyway its just missing a couple of values that are set for msvc but werent for icl. Im testing a patch now so should have fixed it soon. OK, all it needed was to disable stripping with icl. Its one of those things where it took 2 mins to write a patch but then several hours to test it ;). This has apparently been missing for several years but only became evident now. So the attached patch should fix everything up. configure |1 + 1 file changed, 1 insertion(+) 7cdfa3812263eed574ca3daabff85d8e0d850d12 0001-configure-disable-strip-when-using-icl.patch From d9c7fc366647954f3b554b6e0b8ee5cd7fc09ff3 Mon Sep 17 00:00:00 2001 From: Matthew Oliver protogo...@gmail.com Date: Fri, 21 Nov 2014 05:55:48 +1100 Subject: [PATCH] configure: disable strip when using icl. applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is what and why we do it that matters, not just one of them. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 5/6] Add support for V4L2 mem2mem codecs.
On Thu, Nov 20, 2014 at 05:51:56PM +0100, Alexis Ballier wrote: Default buffer settings should work with all drivers (mmaped memory from the driver) but would imply useless memcpy()'s if used in the standard way. libavcodec/v4l2.h is now installed to allow applications to get the proper buffers to avoid these copies. This has been tested on MFC5, on a Samsung exynos 4412 SOC (odroid u3). [...] +/** + * Sets the status of a V4LBufferPool. + * + * @param[in] bp A pointer to a V4LBufferPool. + * @param[in] cmd The status to set (VIDIOC_STREAMON or VIDIOC_STREAMOFF). + *Warning: If VIDIOC_STREAMOFF is sent to a buffer pool that still has some frames buffered, + *those frames will be dropped. + * @return 0 in case of success, a negative value representing the error otherwise. in general ffmpeg uses larger or equal than 0 for success the advantage of this is that we can use positive return values to return some information in the future without breaking API/ABI [...] diff --git a/libavcodec/v4l2.h b/libavcodec/v4l2.h new file mode 100644 index 000..8771b4f --- /dev/null +++ b/libavcodec/v4l2.h @@ -0,0 +1,66 @@ +/* + * V4L2 bufferpools helper functions + * Copyright (C) 2014 Alexis Ballier + * + * 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 + */ + +#ifndef AVCODEC_V4L2_H +#define AVCODEC_V4L2_H + +#include libavutil/frame.h +#include libavcodec/avcodec.h we use #include in other installed headers is it intentional that you dont use that form ? [...] -- 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
Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test
Hi Lukasz! On 2014-11-19 00:06 +0100, Lukasz Marek wrote: On 18.11.2014 22:20, Reynaldo H. Verdejo Pinochet wrote: Hi. Overall this looks good, thanks. I would move the test to tests/ though and integrate it with the build/test system as, say, the way tiny_ssim is: grep -R tiny_ssim * Makefile:TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 tests/Makefile:FATE_UTILS = base64 tiny_psnr tiny_ssim tests/tiny_ssim.c: * tiny_ssim.c tests/tiny_ssim.c:printf(tiny_ssim file1.yuv file2.yuv widthxheight [seek]\n); I tried as I remember but this test need to be linked with ffmpeg's libs so adding it to FATE_UTILS is not enough Would it help with the build of ffserver_config_test if you apply this (based on your github ffserver branch): --- a/Makefile +++ b/Makefile @@ -69,8 +69,8 @@ $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) tools/cws2fws$(EXESUF): ELIBS = $(ZLIB) tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS) tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS) -tools/ffserver_config_test$(EXESUF): $(FF_DEP_LIBS) -tools/ffserver_config_test$(EXESUF): ELIBS = ffserver_config.o cmdutils.o $(FF_DEP_LIBS) -lm +tools/ffserver_config_test$(EXESUF): ffserver_config.o cmdutils.o $(FF_DEP_LIBS) +tools/ffserver_config_test$(EXESUF): ELIBS = $(FF_EXTRALIBS) config.h: .config .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) Regarding the code in ffserver_config_test.c, it look still quite raw from a very quick look. IIUC it writes data to a hardcoded path in /tmp so at least relocating that relative to the binary location itself or something like that should be better I think. Alexander pgpghOz_S_Z6d.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavc/options: fix rc_eq leak
rc_eq is an option, so it is copied by av_opt_copy(dest, src); above. --- libavcodec/options.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/libavcodec/options.c b/libavcodec/options.c index 9713e8d..44f3e90 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -209,16 +209,6 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) dest-inter_matrix= NULL; dest-rc_override = NULL; dest-subtitle_header = NULL; -#if FF_API_MPV_OPT -FF_DISABLE_DEPRECATION_WARNINGS -dest-rc_eq = NULL; -if (src-rc_eq) { -dest-rc_eq = av_strdup(src-rc_eq); -if (!dest-rc_eq) -return AVERROR(ENOMEM); -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif #define alloc_and_copy_or_fail(obj, size, pad) \ if (src-obj size 0) { \ -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test
On 21.11.2014 00:14, Alexander Strasser wrote: Hi Lukasz! On 2014-11-19 00:06 +0100, Lukasz Marek wrote: On 18.11.2014 22:20, Reynaldo H. Verdejo Pinochet wrote: Hi. Overall this looks good, thanks. I would move the test to tests/ though and integrate it with the build/test system as, say, the way tiny_ssim is: grep -R tiny_ssim * Makefile:TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 tests/Makefile:FATE_UTILS = base64 tiny_psnr tiny_ssim tests/tiny_ssim.c: * tiny_ssim.c tests/tiny_ssim.c:printf(tiny_ssim file1.yuv file2.yuv widthxheight [seek]\n); I tried as I remember but this test need to be linked with ffmpeg's libs so adding it to FATE_UTILS is not enough Would it help with the build of ffserver_config_test if you apply this (based on your github ffserver branch): --- a/Makefile +++ b/Makefile @@ -69,8 +69,8 @@ $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) tools/cws2fws$(EXESUF): ELIBS = $(ZLIB) tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS) tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS) -tools/ffserver_config_test$(EXESUF): $(FF_DEP_LIBS) -tools/ffserver_config_test$(EXESUF): ELIBS = ffserver_config.o cmdutils.o $(FF_DEP_LIBS) -lm +tools/ffserver_config_test$(EXESUF): ffserver_config.o cmdutils.o $(FF_DEP_LIBS) +tools/ffserver_config_test$(EXESUF): ELIBS = $(FF_EXTRALIBS) config.h: .config .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) Looks like it is working, thanks! Regarding the code in ffserver_config_test.c, it look still quite raw from a very quick look. IIUC it writes data to a hardcoded path in /tmp so at least relocating that relative to the binary location itself or something like that should be better I think. Yes, it is raw. I posted it because I needed help with Makefile and as reference (I changed quite much that code so I needed to do some regression test). ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] ffserver: dont leak pb_buffer
--- ffserver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ffserver.c b/ffserver.c index 40a5faa..5e392f7 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2253,6 +2253,7 @@ static int http_prepare_data(HTTPContext *c) c-state = HTTPSTATE_SEND_DATA_TRAILER; } +av_freep(c-pb_buffer); len = avio_close_dyn_buf(ctx-pb, c-pb_buffer); c-cur_frame_bytes = len; c-buffer_ptr = c-pb_buffer; -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] ffserver: dont leak child arguments
Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com --- ffserver.c| 2 +- ffserver_config.c | 18 +- ffserver_config.h | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 933eb0e..40a5faa 100644 --- a/ffserver.c +++ b/ffserver.c @@ -3660,7 +3660,7 @@ static void handle_child_exit(int sig) if (uptime 30) /* Turn off any more restarts */ -feed-child_argv = 0; +ffserver_free_child_args(feed-child_argv); } } } diff --git a/ffserver_config.c b/ffserver_config.c index 02c8431..a235142 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -31,6 +31,8 @@ #include cmdutils.h #include ffserver_config.h +#define MAX_CHILD_ARGS 64 + static int ffserver_save_avoption(AVCodecContext *ctx, const char *opt, const char *arg, AVDictionary **dict, int type, FFServerConfig *config, int line_num); static void vreport_config_error(const char *filename, int line_num, int log_level, @@ -603,7 +605,7 @@ static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, c if (!av_strcasecmp(cmd, Launch)) { int i; -feed-child_argv = av_mallocz(64 * sizeof(char *)); +feed-child_argv = av_mallocz_array(MAX_CHILD_ARGS, sizeof(char *)); if (!feed-child_argv) return AVERROR(ENOMEM); for (i = 0; i 62; i++) { @@ -1278,3 +1280,17 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config) #undef ERROR #undef WARNING + +void ffserver_free_child_args(void *argsp) +{ +int i; +char **args; +if (!argsp) +return; +args = *(char ***)argsp; +if (!args) +return; +for (i = 0; i MAX_CHILD_ARGS; i++) +av_free(args[i]); +av_freep(argsp); +} diff --git a/ffserver_config.h b/ffserver_config.h index 06981de..5bc47b4 100644 --- a/ffserver_config.h +++ b/ffserver_config.h @@ -127,4 +127,6 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed, int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config); +void ffserver_free_child_args(void *argsp); + #endif /* FFSERVER_CONFIG_H */ -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] ffserver: dont leak child arguments
On 21.11.2014 00:47, Lukasz Marek wrote: Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com --- ffserver.c| 2 +- ffserver_config.c | 18 +- ffserver_config.h | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 933eb0e..40a5faa 100644 --- a/ffserver.c +++ b/ffserver.c @@ -3660,7 +3660,7 @@ static void handle_child_exit(int sig) if (uptime 30) /* Turn off any more restarts */ -feed-child_argv = 0; +ffserver_free_child_args(feed-child_argv); } } } diff --git a/ffserver_config.c b/ffserver_config.c index 02c8431..a235142 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -31,6 +31,8 @@ #include cmdutils.h #include ffserver_config.h +#define MAX_CHILD_ARGS 64 + static int ffserver_save_avoption(AVCodecContext *ctx, const char *opt, const char *arg, AVDictionary **dict, int type, FFServerConfig *config, int line_num); static void vreport_config_error(const char *filename, int line_num, int log_level, @@ -603,7 +605,7 @@ static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, c if (!av_strcasecmp(cmd, Launch)) { int i; -feed-child_argv = av_mallocz(64 * sizeof(char *)); +feed-child_argv = av_mallocz_array(MAX_CHILD_ARGS, sizeof(char *)); if (!feed-child_argv) return AVERROR(ENOMEM); for (i = 0; i 62; i++) { Right after submit I notice this hardcoded 62 so I changed locally to MAX_CHILD_ARGS - 2 :] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavc/options: fix rc_eq leak
On Fri, Nov 21, 2014 at 12:23:26AM +0100, Lukasz Marek wrote: rc_eq is an option, so it is copied by av_opt_copy(dest, src); above. --- libavcodec/options.c | 10 -- 1 file changed, 10 deletions(-) LGTM thanks -- 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] [PATCH] lavc/options: fix rc_eq leak
On 21.11.2014 01:08, Michael Niedermayer wrote: On Fri, Nov 21, 2014 at 12:23:26AM +0100, Lukasz Marek wrote: rc_eq is an option, so it is copied by av_opt_copy(dest, src); above. --- libavcodec/options.c | 10 -- 1 file changed, 10 deletions(-) LGTM pushed ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize
On 20.11.2014 02:17, Michael Niedermayer wrote: [...] +{ +AVDictionary *dict = NULL; +char *buffer = NULL; + +printf(Testing av_dict_get_string() and av_dict_parse_string()); +av_dict_get_string(dict, buffer, '=', ','); +printf(%s\n, buffer); +av_freep(buffer); +av_dict_set(dict, aaa, aaa, 0); +av_dict_set(dict, b,b, bbb, 0); +av_dict_set(dict, c=c, ccc, 0); +av_dict_set(dict, ddd, d,d, 0); +av_dict_set(dict, eee, e=e, 0); +av_dict_set(dict, f,f, f=f, 0); +av_dict_set(dict, g=g, g,g, 0); +test_separators(dict, ',', '='); +av_dict_free(dict); +av_dict_set(dict, aaa, aaa, 0); i tried this instead av_dict_set(dict, a\\,=\'\aa, a\\,=\'\aa, 0); and it doesnt seem to work obviously av_get_token is broken, i'm not going to fix it soon, so consider patchset dropped unless no one does or wahtever i dont think we need \ as a seperator, supporting that case would only add work I suggest this: OK. I will fix it later. Updated. Makefile |1 dict.c | 90 +++ dict.h | 18 3 files changed, 109 insertions(+) 5eb2cb6e7f068d0ca4c39f674e8087ba74e2972f 0001-lavu-dict-add-av_dict_serialize.patch From a84dbe1ef00797d79a96664dfd701fd612f027c5 Mon Sep 17 00:00:00 2001 From: Lukasz Marek lukasz.m.lu...@gmail.com Date: Sun, 16 Nov 2014 01:45:07 +0100 Subject: [PATCH] lavu/dict: add av_dict_serialize TODO: bump minor, update doc/APIchanges LGTM pushed this one. I haven't read comments for other commits deeply, but seems minor so probably will resend fixes tomorrow. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 08/11] ffserver: export recommented encoder configuration
On 18.11.2014 22:50, Reynaldo H. Verdejo Pinochet wrote: Hi On 11/16/2014 10:46 PM, Lukasz Marek wrote: [..] @@ -3355,6 +3354,9 @@ static int add_av_stream(FFServerStream *feed, AVStream *st) fst = add_av_stream1(feed, av, 0); if (!fst) return -1; +if (av_stream_get_recommended_encoder_configuration(st)) +av_stream_set_recommended_encoder_configuration(fst, +av_strdup(av_stream_get_recommended_encoder_configuration(st))); Is the return of av_strdup here been freed somewhere?. Also adding braces to ifs when the body is multilined wouldn't hurt. Not a blocker of course. It is not freed here, but lets say setter takeover ownership of this pointer so it is freed in void of libavfromat if no one leak it in an abyss. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 05/11] ffserver: allow skip setting defaults
On 18.11.2014 23:25, Reynaldo H. Verdejo Pinochet wrote: Hi On 11/18/2014 06:54 PM, Nicolas George wrote: L'octidi 28 brumaire, an CCXXIII, Reynaldo H. Verdejo Pinochet a écrit : I think I commented about this before but having yesvar novar options seems redundant. Having var = yes or no if absent (or the other way around depending on the intended default) seems less cumbersome and should simplify the code a bit too, avoiding checking I think exactly the opposite. People who build reliable configurations want to avoid relying on default values as much as possible, because default values can change without notice. Therefore, they need to be able to specify explicitly any behaviour, even if it is currently the default. for the two and imposing a precedence, which is not always documented. I think we can implicitly document that the behaviour for contradictory options is nasal demons. Good point I guess. OK all the same as long as we keep it consistent across config files. Phrased as a question to the author for this very reason. I do think undefined behavior should be avoided if possible without too much hassle, so if we go with the former I would appreciate doc entries specifying the options precedence. Brownie points+ if an odd combination fires a warning(). Not sure I follow, should I change anything? IMHO my proposal it is not really complex and fully customizable. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 03/11] ffserver_config: map ffserver options to AVOptions
On 18.11.2014 21:35, Reynaldo H. Verdejo Pinochet wrote: Hi On 11/16/2014 10:46 PM, Lukasz Marek wrote: Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com [..] @@ -965,43 +881,38 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, ret = av_parse_video_size(w, h, arg); if (ret 0) ERROR(Invalid video size '%s'\n, arg); -else if ((w % 2) || (h % 2)) See bellow -WARNING(Image size is not a multiple of 2\n); -if (av_dict_set_int(config-video_conf, VideoSizeWidth, w, 0) 0 || -av_dict_set_int(config-video_conf, VideoSizeHeight, h, 0) 0) -goto nomem; -} else if (!av_strcasecmp(cmd, VideoFrameRate)) { -AVRational frame_rate; -ffserver_get_arg(arg, sizeof(arg), p); -if (av_parse_video_rate(frame_rate, arg) 0) { -ERROR(Incorrect frame rate: %s\n, arg); -} else { -if (av_dict_set_int(config-video_conf, VideoFrameRateNum, frame_rate.num, 0) 0 || -av_dict_set_int(config-video_conf, VideoFrameRateDen, frame_rate.den, 0) 0) +else { +if ((w % 2) || (h % 2)) Drop the redundant () across %. This part is not part of the commit, but I will remove. Also, please make an effort to break lines at 80 chars as long as it doesn't make the code harder to read. This seems particularly possible on the function declarations. regarding this part, I set my editor to notice 90 chars and I try to respect that, but with some reasonable margin. TBH, 80 chars is prehistoric, probably from the era of crt's with text mode. I don't remember official ffmpeg's rules about that, but common, its 21th century... ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 04/11] ffserver_config: remove ffserver_apply_stream_config function
On 18.11.2014 21:44, Reynaldo H. Verdejo Pinochet wrote: Hi Lukasz On 11/16/2014 10:46 PM, Lukasz Marek wrote: [..] @@ -174,13 +174,20 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed, } /* add a codec and set the default parameters */ -static void add_codec(FFServerStream *stream, AVCodecContext *av) +static void add_codec(FFServerStream *stream, AVCodecContext *av, FFServerConfig *config) { AVStream *st; +AVDictionary **opts; if(stream-nb_streams = FF_ARRAY_ELEMS(stream-streams)) return; +opts = av-codec_type == AVMEDIA_TYPE_AUDIO ? config-audio_opts : config-video_opts; +av_opt_set_dict2(av-priv_data, opts, AV_OPT_SEARCH_CHILDREN); +av_opt_set_dict2(av, opts, AV_OPT_SEARCH_CHILDREN); +if (av_dict_count(*opts)) +av_log(NULL, AV_LOG_ERROR, Something went wrong, %d options not set!!!\n, av_dict_count(*opts)); + Is this really an error? OK to push if so. Otherwise demote to warning and push the updated patch. Usual comments about your line lengths apply too but are not blockers. Yes an no. For now it could be assert, as options are already validated, but AVOption API may change (some dynamic validation or whatever) so decided just to notice, but you are right, demoted to a warning locally. Error should terminate, but I think warning is good enough. As a general comment, I would avoid the grammatical !!!s and such to denote severity. We have the log categories for that. This is also just a tip, not something you need to change. No, it is good point. replaced !!! by ! locally. TBH it was just debug comment, but I decided to keep it. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] doc/examples/decoding_encoding: fix storing all channels
Fixes Ticket3355 Signed-off-by: Michael Niedermayer michae...@gmx.at --- doc/examples/decoding_encoding.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/examples/decoding_encoding.c b/doc/examples/decoding_encoding.c index 556fe98..80da664 100644 --- a/doc/examples/decoding_encoding.c +++ b/doc/examples/decoding_encoding.c @@ -288,6 +288,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f); while (avpkt.size 0) { +int i, ch; int got_frame = 0; if (!decoded_frame) { @@ -304,15 +305,15 @@ static void audio_decode_example(const char *outfilename, const char *filename) } if (got_frame) { /* if a frame has been decoded, output it */ -int data_size = av_samples_get_buffer_size(NULL, c-channels, - decoded_frame-nb_samples, - c-sample_fmt, 1); +int data_size = av_get_bytes_per_sample(c-sample_fmt); if (data_size 0) { /* This should not occur, checking just for paranoia */ fprintf(stderr, Failed to calculate data size\n); exit(1); } -fwrite(decoded_frame-data[0], 1, data_size, outfile); +for (i=0; idecoded_frame-nb_samples; i++) +for (ch=0; chc-channels; ch++) +fwrite(decoded_frame-data[ch] + data_size*i, 1, data_size, outfile); } avpkt.size -= len; avpkt.data += len; @@ -650,7 +651,7 @@ int main(int argc, char **argv) video_encode_example(test.h264, AV_CODEC_ID_H264); } else if (!strcmp(output_type, mp2)) { audio_encode_example(test.mp2); -audio_decode_example(test.sw, test.mp2); +audio_decode_example(test.pcm, test.mp2); } else if (!strcmp(output_type, mpg)) { video_encode_example(test.mpg, AV_CODEC_ID_MPEG1VIDEO); video_decode_example(test%02d.pgm, test.mpg); -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
Do you mean that we can use rand() instead of CryptGenRandom in ffmpeg? Date: Thu, 20 Nov 2014 12:17:10 +0100 From: j...@videolan.org To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch 1. libgcc is not big 2. MSVC 2013 has correctly defined headers to solve the rand issue and the configure part. Le 20/11/2014 11:34, Jesse Jiang a écrit : Hi JB, Based on my understanding, mingw-w64 need gcc, so in this way, we need to linked gcc library into our App. I don't want a big library with our Apps. I know the mingw is a correct way, but how could it works with MSVC? Date: Thu, 20 Nov 2014 09:53:27 +0100 From: j...@videolan.org To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On 20 Nov, Jesse Jiang wrote : Add WinRT API supports This patch is wrong on almost every level. rand() is wrong. modifying configure because your headers are broken is wrong too. doing an API rewrapper in FFmpeg is the wrong place, look at winstorecompat in mingw-w64. With my kindest regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ 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 -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device ___ 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] WinRT API support patch
On Fri, Nov 21, 2014 at 01:43:29AM +, Jesse Jiang wrote: Do you mean that we can use rand() instead of CryptGenRandom in ffmpeg? rand() is completely wrong its not even doing the correct operation rand() is pseudo random the code requires a strong (and non pseudo) random value [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/nellymoser: Use avpriv_float_dsp_alloc()
On Fri, Nov 14, 2014 at 02:39:46PM +0100, Michael Niedermayer wrote: Signed-off-by: Michael Niedermayer michae...@gmx.at --- libavcodec/nellymoserdec.c |9 ++--- libavcodec/nellymoserenc.c | 17 +++-- 2 files changed, 17 insertions(+), 9 deletions(-) applied a while ago but forgot to reply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] dashenc: Add a segment_start_number option
On Nov 20, 2014, at 02:41, Benoit Fouet benoit.fo...@free.fr wrote: Hi, - Mail original - From b38a1396e2335e2d0ef2619b5a3890f91c31c8a8 Mon Sep 17 00:00:00 2001 From: Rodger Combs rodger.co...@gmail.com Date: Thu, 20 Nov 2014 01:47:05 -0600 Subject: [PATCH] dashenc: Add a segment_start_number option This defaults to 0 instead of 1 for consistency with the segment encoder --- libavformat/dashenc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index dac217e..5958270 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -80,6 +80,7 @@ typedef struct DASHContext { int total_duration; char availability_start_time[100]; char dirname[1024]; +int segment_start_number; } DASHContext; static int dash_write(void *opaque, uint8_t *buf, int buf_size) @@ -182,7 +183,7 @@ static void dash_free(AVFormatContext *s) static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext *c) { -int i, start_index = 0, start_number = 1; +int i, start_index = 0, start_number = c-segment_start_number; if (c-window_size) { start_index = FFMAX(os-nb_segments - c-window_size, 0); start_number = FFMAX(os-segment_index - c-window_size, 1); @@ -512,7 +513,7 @@ static int dash_write_header(AVFormatContext *s) set_codec_str(s, os-ctx-streams[0]-codec, os-codec_str, sizeof(os-codec_str)); os-first_dts = AV_NOPTS_VALUE; -os-segment_index = 1; +os-segment_index = c-segment_start_number; } if (!c-has_video c-min_seg_duration = 0) { @@ -754,6 +755,7 @@ static const AVOption options[] = { { use_template, Use SegmentTemplate instead of SegmentList, OFFSET(use_template), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { use_timeline, Use SegmentTimeline in SegmentTemplate, OFFSET(use_timeline), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { single_file, Store all segments in one file, accessed using byte ranges, OFFSET(single_file), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E }, +{ segment_start_number, first segment number to write, OFFSET(segment_start_number), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E }, Default should be 1, in order not to change the current behavior. -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org mailto:ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Alright, here's a version with that. Also, adjusted to reflect the change properly in the MPD. From ec2b7e5033acb25bb0310f12ea576a8185f4e396 Mon Sep 17 00:00:00 2001 From: Rodger Combs rodger.co...@gmail.com Date: Thu, 20 Nov 2014 01:47:05 -0600 Subject: [PATCH] dashenc: Add a segment_start_number option --- libavformat/dashenc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index dac217e..5958270 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -80,6 +80,7 @@ typedef struct DASHContext { int total_duration; char availability_start_time[100]; char dirname[1024]; +int segment_start_number; } DASHContext; static int dash_write(void *opaque, uint8_t *buf, int buf_size) @@ -182,7 +183,7 @@ static void dash_free(AVFormatContext *s) static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext *c) { -int i, start_index = 0, start_number = 1; +int i, start_index = 0, start_number = c-segment_start_number; if (c-window_size) { start_index = FFMAX(os-nb_segments - c-window_size, 0); start_number = FFMAX(os-segment_index - c-window_size, 1); @@ -512,7 +513,7 @@ static int dash_write_header(AVFormatContext *s) set_codec_str(s, os-ctx-streams[0]-codec, os-codec_str, sizeof(os-codec_str)); os-first_dts = AV_NOPTS_VALUE; -os-segment_index = 1; +os-segment_index = c-segment_start_number; } if (!c-has_video c-min_seg_duration = 0) { @@ -754,6 +755,7 @@ static const AVOption options[] = { { use_template, Use SegmentTemplate instead of SegmentList, OFFSET(use_template), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { use_timeline, Use SegmentTimeline in SegmentTemplate, OFFSET(use_timeline), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { single_file, Store all segments in one file, accessed using byte ranges, OFFSET(single_file), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E }, +{ segment_start_number, first segment number to write, OFFSET(segment_start_number), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E }, { NULL }, }; -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
Hi All, I did some research, rand() is pseudo random. CryptGenRandom is the system-wide seed, but it cannot be used in Windows RT. I try to use CryptographicBuffer, which is Windows RT API, but there is a problem. This API needs to link Windows.winmd. The Windows.winmd just like a DLL, but it may different from Windows RT and Windows Phone. First, the SDKs are in the different PATH,Second, the files are also different. It means that developer need to choice platform first, and then compiler for different library. I hope ffmpeg only depends on support win32 apis and CRT apis. So is there any way to instead of srand(time(0)); rand(); ? How about c++11 random or Mersenne twister Algorithmic Best regards,Jesse Date: Fri, 21 Nov 2014 02:49:59 +0100 From: michae...@gmx.at To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On Fri, Nov 21, 2014 at 01:43:29AM +, Jesse Jiang wrote: Do you mean that we can use rand() instead of CryptGenRandom in ffmpeg? rand() is completely wrong its not even doing the correct operation rand() is pseudo random the code requires a strong (and non pseudo) random value [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus ___ 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] dashenc: Add a segment_start_number option
On Nov 20, 2014, at 21:47, Rodger Combs rodger.co...@gmail.com wrote: On Nov 20, 2014, at 02:41, Benoit Fouet benoit.fo...@free.fr mailto:benoit.fo...@free.fr wrote: Hi, - Mail original - From b38a1396e2335e2d0ef2619b5a3890f91c31c8a8 Mon Sep 17 00:00:00 2001 From: Rodger Combs rodger.co...@gmail.com mailto:rodger.co...@gmail.com Date: Thu, 20 Nov 2014 01:47:05 -0600 Subject: [PATCH] dashenc: Add a segment_start_number option This defaults to 0 instead of 1 for consistency with the segment encoder --- libavformat/dashenc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index dac217e..5958270 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -80,6 +80,7 @@ typedef struct DASHContext { int total_duration; char availability_start_time[100]; char dirname[1024]; +int segment_start_number; } DASHContext; static int dash_write(void *opaque, uint8_t *buf, int buf_size) @@ -182,7 +183,7 @@ static void dash_free(AVFormatContext *s) static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext *c) { -int i, start_index = 0, start_number = 1; +int i, start_index = 0, start_number = c-segment_start_number; if (c-window_size) { start_index = FFMAX(os-nb_segments - c-window_size, 0); start_number = FFMAX(os-segment_index - c-window_size, 1); @@ -512,7 +513,7 @@ static int dash_write_header(AVFormatContext *s) set_codec_str(s, os-ctx-streams[0]-codec, os-codec_str, sizeof(os-codec_str)); os-first_dts = AV_NOPTS_VALUE; -os-segment_index = 1; +os-segment_index = c-segment_start_number; } if (!c-has_video c-min_seg_duration = 0) { @@ -754,6 +755,7 @@ static const AVOption options[] = { { use_template, Use SegmentTemplate instead of SegmentList, OFFSET(use_template), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { use_timeline, Use SegmentTimeline in SegmentTemplate, OFFSET(use_timeline), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { single_file, Store all segments in one file, accessed using byte ranges, OFFSET(single_file), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E }, +{ segment_start_number, first segment number to write, OFFSET(segment_start_number), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E }, Default should be 1, in order not to change the current behavior. -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org mailto:ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Alright, here's a version with that. Also, adjusted to reflect the change properly in the MPD. From ec2b7e5033acb25bb0310f12ea576a8185f4e396 Mon Sep 17 00:00:00 2001 From: Rodger Combs rodger.co...@gmail.com mailto:rodger.co...@gmail.com Date: Thu, 20 Nov 2014 01:47:05 -0600 Subject: [PATCH] dashenc: Add a segment_start_number option --- libavformat/dashenc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index dac217e..5958270 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -80,6 +80,7 @@ typedef struct DASHContext { int total_duration; char availability_start_time[100]; char dirname[1024]; +int segment_start_number; } DASHContext; static int dash_write(void *opaque, uint8_t *buf, int buf_size) @@ -182,7 +183,7 @@ static void dash_free(AVFormatContext *s) static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext *c) { -int i, start_index = 0, start_number = 1; +int i, start_index = 0, start_number = c-segment_start_number; if (c-window_size) { start_index = FFMAX(os-nb_segments - c-window_size, 0); start_number = FFMAX(os-segment_index - c-window_size, 1); @@ -512,7 +513,7 @@ static int dash_write_header(AVFormatContext *s) set_codec_str(s, os-ctx-streams[0]-codec, os-codec_str, sizeof(os-codec_str)); os-first_dts = AV_NOPTS_VALUE; -os-segment_index = 1; +os-segment_index = c-segment_start_number; } if (!c-has_video c-min_seg_duration = 0) { @@ -754,6 +755,7 @@ static const AVOption options[] = { { use_template, Use SegmentTemplate instead of SegmentList, OFFSET(use_template), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { use_timeline, Use SegmentTimeline in SegmentTemplate, OFFSET(use_timeline), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E }, { single_file, Store all segments in one file, accessed using byte ranges, OFFSET(single_file), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E }, +{ segment_start_number, first segment number to write, OFFSET(segment_start_number), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E }, { NULL },
Re: [FFmpeg-devel] [PATCH 1/2] lavfi/ebur128: add support for smaller video sizes
(sorry for the delay) On Sun, Nov 16, 2014 at 10:53:15PM +0100, Marton Balint wrote: Signed-off-by: Marton Balint c...@passwd.hu --- doc/filters.texi| 4 ++-- libavfilter/f_ebur128.c | 11 --- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 53f4cb2..713989c 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -10146,8 +10146,8 @@ activated. Default is @code{0}. @item size Set the video size. This option is for video only. For the syntax of this -option, check the Video size section in the ffmpeg-utils manual. Default -and minimum resolution is @code{640x480}. +option, check the Video size section in the ffmpeg-utils manual. The default +resolution is @code{640x480}, the minimum is @code{480x102}. Quoting the EBU 3341: An ‘EBU Mode’ meter shall offer two scales, for when a scale is shown, selectable by the user: 1. range -18.0 LU to +9.0 LU (-41.0 LUFS to -14.0 LUFS), named ‘EBU +9 scale’ 2. range -36.0 LU to +18.0 LU (-59.0 LUFS to -5.0 LUFS), named ‘EBU +18 scale’ When you go down to 480x102, the printed range becomes [-16;+8] LU for +9 scale and [-32;+16] LU for +18 scale (see meter option). I think these range boundaries should be preserved in the output. [...] -- Clément B. pgpc24UC8Z2Py.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] WinRT API support patch
Now, I find a function get_generic_seed() So, I use this function will work fine? uint32_t av_get_random_seed(void){uint32_t seed; #if HAVE_CRYPTGENRANDOMHCRYPTPROV provider;if (CryptAcquireContext(provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {BOOL ret = CryptGenRandom(provider, sizeof(seed), (PBYTE) seed); CryptReleaseContext(provider, 0);if (ret)return seed; }#endif #if HAVE_WINRTAPIreturn get_generic_seed();#endif if (read_random(seed, /dev/urandom) == sizeof(seed))return seed; if (read_random(seed, /dev/random) == sizeof(seed))return seed; return get_generic_seed();} From: jessejiang0...@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 21 Nov 2014 03:51:12 + Subject: Re: [FFmpeg-devel] WinRT API support patch Hi All, I did some research, rand() is pseudo random. CryptGenRandom is the system-wide seed, but it cannot be used in Windows RT. I try to use CryptographicBuffer, which is Windows RT API, but there is a problem. This API needs to link Windows.winmd. The Windows.winmd just like a DLL, but it may different from Windows RT and Windows Phone. First, the SDKs are in the different PATH,Second, the files are also different. It means that developer need to choice platform first, and then compiler for different library. I hope ffmpeg only depends on support win32 apis and CRT apis. So is there any way to instead of srand(time(0)); rand(); ? How about c++11 random or Mersenne twister Algorithmic Best regards,Jesse Date: Fri, 21 Nov 2014 02:49:59 +0100 From: michae...@gmx.at To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] WinRT API support patch On Fri, Nov 21, 2014 at 01:43:29AM +, Jesse Jiang wrote: Do you mean that we can use rand() instead of CryptGenRandom in ffmpeg? rand() is completely wrong its not even doing the correct operation rand() is pseudo random the code requires a strong (and non pseudo) random value [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus ___ 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 5/6] Add support for V4L2 mem2mem codecs.
On Thu, 20 Nov 2014 21:41:56 +0100 Michael Niedermayer michae...@gmx.at wrote: On Thu, Nov 20, 2014 at 05:51:56PM +0100, Alexis Ballier wrote: Default buffer settings should work with all drivers (mmaped memory from the driver) but would imply useless memcpy()'s if used in the standard way. libavcodec/v4l2.h is now installed to allow applications to get the proper buffers to avoid these copies. This has been tested on MFC5, on a Samsung exynos 4412 SOC (odroid u3). [...] +/** + * Sets the status of a V4LBufferPool. + * + * @param[in] bp A pointer to a V4LBufferPool. + * @param[in] cmd The status to set (VIDIOC_STREAMON or VIDIOC_STREAMOFF). + *Warning: If VIDIOC_STREAMOFF is sent to a buffer pool that still has some frames buffered, + *those frames will be dropped. + * @return 0 in case of success, a negative value representing the error otherwise. in general ffmpeg uses larger or equal than 0 for success the advantage of this is that we can use positive return values to return some information in the future without breaking API/ABI yep I can change the doc here; though I don't have much more to return than it has been done [...] diff --git a/libavcodec/v4l2.h b/libavcodec/v4l2.h new file mode 100644 index 000..8771b4f --- /dev/null +++ b/libavcodec/v4l2.h @@ -0,0 +1,66 @@ +/* + * V4L2 bufferpools helper functions + * Copyright (C) 2014 Alexis Ballier + * + * 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 + */ + +#ifndef AVCODEC_V4L2_H +#define AVCODEC_V4L2_H + +#include libavutil/frame.h +#include libavcodec/avcodec.h we use #include in other installed headers is it intentional that you dont use that form ? didn't notice that public headers were doing this, this was intentional only because this header ends up installed; I will change it to the standard then thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/6] Add AV_PIX_FMT_NV12T.
On Thu, 20 Nov 2014 18:42:19 +0100 wm4 nfx...@googlemail.com wrote: I think this should be rejected. It's far too special to be useful in general, and it's not even pixel- or line-addressable (Z-shaped tiles, seriously?). It's pretty much a raw codec, not a pixel format. How do you put this in an AVFrame then ? Also, doesn't libv4l2 handle converting this to something sane transparently? transparently yes, but in sw. A 10W arm soc wouldn't like to transparently convert 1080p@25fps like that also, last time I checked, libv4l2 didnt support NV12MT If this is needed for the m2m filter, then maybe it should be part of the v4l2 libavdevice. I don't understand this. This is needed for HW decoding on MFCv5: it is the only format decoders can produce. To use it in your application, you send it to the m2m filter to get something sane. Alexis. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/6] Add AV_PIX_FMT_NV12T.
On Thu, 20 Nov 2014 18:40:18 +0100 Jean-Baptiste Kempf j...@videolan.org wrote: On 20 Nov, Alexis Ballier wrote : This is the only format supported by MFC5 HW decoders (e.g. Samsung exynos 4412). Why not convert it to a normal format? That is exactly what the m2m filter is for: on 4412 you have MFC HW codecs and fimc (camera m2m module); the fimc m2m module acts like a filter and accepts this format and outputs much saner ones. Alexis. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel