Re: [FFmpeg-devel] [PATCH]lavf/mov: Do not overread iTunes metadata
On Saturday 04 April 2015 06:25:36 am Carl Eugen Hoyos wrote: > Hi! > > Attached patch fixes ticket #4425 for me. New patch attached that does not brake fate. Carl Eugen diff --git a/libavformat/mov.c b/libavformat/mov.c index dc31e5a..eda9d42 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -342,7 +342,7 @@ retry: if (c->itunes_metadata && atom.size > 8) { int data_size = avio_rb32(pb); int tag = avio_rl32(pb); -if (tag == MKTAG('d','a','t','a')) { +if (tag == MKTAG('d','a','t','a') && atom.size >= 16) { data_type = avio_rb32(pb); // type avio_rb32(pb); // unknown str_size = data_size - 16; ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH]lavf/mov: Do not overread iTunes metadata
Hi! Attached patch fixes ticket #4425 for me. Please comment, Carl Eugen diff --git a/libavformat/mov.c b/libavformat/mov.c index dc31e5a..8a4b739 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -342,7 +342,7 @@ retry: if (c->itunes_metadata && atom.size > 8) { int data_size = avio_rb32(pb); int tag = avio_rl32(pb); -if (tag == MKTAG('d','a','t','a')) { +if (tag == MKTAG('d','a','t','a') && data_size < atom.size - 8) { data_type = avio_rb32(pb); // type avio_rb32(pb); // unknown str_size = data_size - 16; ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Add options for level and tier
On Fri, 3 Apr 2015 18:23:05 +0200 Timo Rothenpieler wrote: > --- > libavcodec/nvenc.c | 111 > - 1 file changed, > 110 insertions(+), 1 deletion(-) Needs a changelog description but otherwise looks fine. --phil ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Patch for High color and High bit-depth support
On Thu, Apr 2, 2015 at 3:10 PM, James Zern wrote: > On Thu, Apr 2, 2015 at 12:19 PM, Debargha Mukherjee > wrote: > > [...] > > > > Updated patch to handle the checks better. > > > > > +#if CONFIG_LIBVPX_VP9_ENCODER > > +static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t > codec_caps, > > + struct vpx_codec_enc_cfg *enccfg, > vpx_codec_flags_t *flags, > > + vpx_img_fmt_t *img_fmt) { > > +switch (avctx->pix_fmt) { > > +case AV_PIX_FMT_YUV420P: > > > > Indent is inconsistent with the other switch in this file: align 'case' > with > 'switch'. > done > > > +#ifdef VPX_IMG_FMT_HIGHBITDEPTH > > +enccfg->g_bit_depth = enccfg->g_input_bit_depth = 8; > > +#endif > > +enccfg->g_profile = 0; > > +*img_fmt = VPX_IMG_FMT_I420; > > +return 0; > > +case AV_PIX_FMT_YUV422P: > > +#ifdef VPX_IMG_FMT_HIGHBITDEPTH > > +enccfg->g_bit_depth = enccfg->g_input_bit_depth = 8; > > +#endif > > +enccfg->g_profile = 1; > > +*img_fmt = VPX_IMG_FMT_I422; > > +return 0; > > +case AV_PIX_FMT_YUV444P: > > +#ifdef VPX_IMG_FMT_HIGHBITDEPTH > > +enccfg->g_bit_depth = enccfg->g_input_bit_depth = 8; > > +#endif > > +enccfg->g_profile = 1; > > +*img_fmt = VPX_IMG_FMT_I444; > > +return 0; > > > > You can probably merge profile 1 like 2/3 to cut down on the duplication. > You > might want to set bitdepth to 8 by default reducing the ifdefs here too. > done. > > > +#if CONFIG_LIBVPX_VP9_ENCODER > > +if (avctx->codec_id == AV_CODEC_ID_VP9) { > > +if (set_pix_fmt(avctx, codec_caps, &enccfg, &flags, &img_fmt)) > > +return AVERROR(EINVAL); > > +av_log(avctx, AV_LOG_INFO, "Bit-depth: %d\n", > enccfg.g_bit_depth); > > > > Won't build with a non-high-bitdepth build. > done. > > > -.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, > AV_PIX_FMT_NONE }, > > +.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, > > +AV_PIX_FMT_YUV422P, > > +AV_PIX_FMT_YUV444P, > > +#ifdef VPX_IMG_FMT_HIGHBITDEPTH > > + > AV_PIX_FMT_YUV420P10LE, > > + > AV_PIX_FMT_YUV422P10LE, > > + > AV_PIX_FMT_YUV444P10LE, > > + > AV_PIX_FMT_YUV420P12LE, > > + > AV_PIX_FMT_YUV422P12LE, > > + > AV_PIX_FMT_YUV444P12LE, > > +#endif > done using ff_vp9_init_static(). > > Now a non-high-bitdepth build will fail the encode if given a high-bitdepth > file. Previously this would silently downsample. > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > -- Debargha Mukherjee, Ph.D. Staff Software Engineer, Google, Inc. Email: debar...@google.com Phone: 408-234-5956 (cell) From 9f2d6c0303dba76cb9e744eb49b25f9e9e002899 Mon Sep 17 00:00:00 2001 From: Deb Mukherjee Date: Wed, 25 Mar 2015 17:10:16 -0700 Subject: [PATCH] Support for VP9 high-color/high-bit-depth encoding Patch to support VP9 encoding with new profiles 1-3. Profile 1 (8-bit 422/444) should work with default libvpx configuration. However you will need to configure libvpx with --enable-vp9-highbitdepth before building and linking with ffmpeg for profile 2 (10-/12-bit 420) and profile 3 (10-/12-bit 422/444) encoding. You may use the appropriate profile option on the command line: -profile:v 1 for 422/444 8-bit encoding -profile:v 2 for 420 10-/12- bit encoding -profile:v 3 for 422/444 10-/12-bit encoding If you do not use the -profile:v option, it will be deduced from the source format. --- libavcodec/libvpx.c| 37 - libavcodec/libvpxenc.c | 89 -- 2 files changed, 123 insertions(+), 3 deletions(-) diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c index 5d29893..5111eed 100644 --- a/libavcodec/libvpx.c +++ b/libavcodec/libvpx.c @@ -19,12 +19,47 @@ */ #include - +#include +#include #include "libvpx.h" +static const enum AVPixelFormat vp9_pix_fmts_def[] = { +AV_PIX_FMT_YUV420P, +AV_PIX_FMT_NONE +}; + +static const enum AVPixelFormat vp9_pix_fmts_highcol[] = { +AV_PIX_FMT_YUV420P, +AV_PIX_FMT_YUV422P, +AV_PIX_FMT_YUV444P, +AV_PIX_FMT_NONE +}; + +static const enum AVPixelFormat vp9_pix_fmts_highbd[] = { +AV_PIX_FMT_YUV420P, +AV_PIX_FMT_YUV422P, +AV_PIX_FMT_YUV444P, +AV_PIX_FMT_YUV420P10LE, +AV_PIX_FMT_YUV422P10LE, +AV_PIX_FMT_YUV444P10LE, +AV_PIX_FMT_YUV420P12LE, +AV_PIX_FMT_YUV422P12LE, +AV_PIX_FMT_YUV444P12LE, +AV_PIX_FMT_NONE +}; + av_cold void ff_vp9_init_static(AVCodec *codec) { if (vpx_codec_version_major() < 1 || (vpx_codec_version_major() == 1 && vpx_codec_version_minor() < 3)) codec->capabilities |= CODEC_CAP_EXPERIMENTAL; +if (vpx_c
Re: [FFmpeg-devel] [PATCH] matroskadec: export cover art correctly
On Fri, Apr 03, 2015 at 04:11:53PM +0200, wm4 wrote: > Generally, libavformat exports cover art pictures as video streams with > 1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported > it as attachment with codec_id set to AV_CODEC_ID_MJPEG. > > Obviously, this should be consistent, so change the Matroska demuxer to > export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream. > > Matroska muxing is probably incorrect too. I know that it can create > broken files with an audio track and just 1 video frame when e.g. > remuxing mp3 with APIC to mkv. But for now this commit does not change > anything about muxing, and also continues to write attachments with > AV_CODEC_ID_MJPEG should the muxer application have special knowledge > that the Matroska is broken in this way. > > Fixes trac #4423. > --- > libavformat/matroska.c| 9 +++-- > libavformat/matroska.h| 1 + > libavformat/matroskadec.c | 41 +++-- > libavformat/matroskaenc.c | 5 + > 4 files changed, 44 insertions(+), 12 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
On Fri, Apr 03, 2015 at 08:37:29PM +0200, Andreas Cadhalpun wrote: > On 03.04.2015 20:20, Michael Niedermayer wrote: > > On Fri, Apr 03, 2015 at 07:14:16PM +0200, Andreas Cadhalpun wrote: > >> Signed-off-by: Andreas Cadhalpun > >> --- > >> libavcodec/h263dec.c| 2 +- > >> libavcodec/mpeg4video.h | 3 +++ > >> 2 files changed, 4 insertions(+), 1 deletion(-) > >> > >> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c > >> index a1981a3..0dde897 100644 > >> --- a/libavcodec/h263dec.c > >> +++ b/libavcodec/h263dec.c > >> @@ -459,7 +459,7 @@ retry: > >> } > >> } > >> > >> -if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // > >> divx 5.01+/xvid frame reorder > >> +if (s->bitstream_buffer_size && (s->divx_packed || buf_size < > >> MAX_NVOP_SIZE)) // divx 5.01+/xvid frame reorder > > > > its nitpicking but shouldnt it be <= if the constant is a maximum ? > > I didn't want to change the code, but '<=' would work as well, because > the constant is rather arbitrary. Feel free to change this, when committing. changed applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam" signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On 03.04.2015 16:19, Michael Niedermayer wrote: On Fri, Apr 03, 2015 at 03:22:29PM +0200, Nicolas George wrote: Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : diff --git a/libavformat/avio.h b/libavformat/avio.h index f61a8f8..51913e3 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -63,7 +63,10 @@ enum AVIODirEntryType { AVIO_ENTRY_NAMED_PIPE, AVIO_ENTRY_SYMBOLIC_LINK, AVIO_ENTRY_SOCKET, -AVIO_ENTRY_FILE +AVIO_ENTRY_FILE, +AVIO_ENTRY_SERVER, +AVIO_ENTRY_SHARE, +AVIO_ENTRY_WORKGROUP, }; Sorry if I missed the previous discussions on the mailing list (and if not, maybe just 8 hours before apply was a bit short for discussion), but I had a bit of a concern with this change. Until know, if you wanted to make a recursive listing, you just had to know that you had to recurse into directories. Now... should you recurse into shares? servers? workgroups? nobody knows. There should be some way of knowing whether an entry can be opened like a plain file, entered like a directory, or if it is just one of the weird things that lay in some corners of filesystems, without requiring an update when new types are added. filemode could contain a bit for directories or a function could provide this information, but for example links can be both file and directory or a new field could be added to AVIODirEntry Fortunately this is not an issue for samba as it returns link's target type. Mariusz has sent email to their mailing list with question about this strange links treatment. But this have to be handled somehow for next protocols. It cannot be a bit in filemode, because filemode may be unknown and is set to -1 in this case. I am not convinced that all enums that can be listed recursively has to be marked explicitly. If thats just a case of symlink, then extending struct with target's type and target's path may be more useful and also solves the issue. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] examples/avio_list_dir: init/deinit network
Signed-off-by: Lukasz Marek --- doc/examples/avio_list_dir.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/examples/avio_list_dir.c b/doc/examples/avio_list_dir.c index 281b5af..4060ba6 100644 --- a/doc/examples/avio_list_dir.c +++ b/doc/examples/avio_list_dir.c @@ -74,17 +74,18 @@ int main(int argc, char *argv[]) /* register codecs and formats and other lavf/lavc components*/ av_register_all(); +avformat_network_init(); if ((ret = avio_open_dir(&ctx, input_dir, NULL)) < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot open directory: %s.\n", av_err2str(ret)); -return 1; +goto fail; } cnt = 0; for (;;) { if ((ret = avio_read_dir(ctx, &entry)) < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot list directory: %s.\n", av_err2str(ret)); -return 1; +goto fail; } if (!entry) break; @@ -111,7 +112,9 @@ int main(int argc, char *argv[]) cnt++; }; + fail: avio_close_dir(&ctx); +avformat_network_deinit(); -return 0; +return ret < 0 ? 1 : 0; } -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
On 03.04.2015 20:20, Michael Niedermayer wrote: > On Fri, Apr 03, 2015 at 07:14:16PM +0200, Andreas Cadhalpun wrote: >> Signed-off-by: Andreas Cadhalpun >> --- >> libavcodec/h263dec.c| 2 +- >> libavcodec/mpeg4video.h | 3 +++ >> 2 files changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c >> index a1981a3..0dde897 100644 >> --- a/libavcodec/h263dec.c >> +++ b/libavcodec/h263dec.c >> @@ -459,7 +459,7 @@ retry: >> } >> } >> >> -if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // >> divx 5.01+/xvid frame reorder >> +if (s->bitstream_buffer_size && (s->divx_packed || buf_size < >> MAX_NVOP_SIZE)) // divx 5.01+/xvid frame reorder > > its nitpicking but shouldnt it be <= if the constant is a maximum ? I didn't want to change the code, but '<=' would work as well, because the constant is rather arbitrary. Feel free to change this, when committing. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] mpeg4: only show the divx_packed warning, when a packed frame is present
On Fri, Apr 03, 2015 at 07:14:31PM +0200, Andreas Cadhalpun wrote: > Otherwise it is shown even after the file was fixed with avidemux, > because the userdata string still ends with 'p'. > > Signed-off-by: Andreas Cadhalpun > --- > libavcodec/mpeg4videodec.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User questions about the command line tools should be sent to the ffmpeg-user ML. And questions about how to use libav* should be sent to the libav-user ML. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
On Fri, Apr 03, 2015 at 07:14:16PM +0200, Andreas Cadhalpun wrote: > Signed-off-by: Andreas Cadhalpun > --- > libavcodec/h263dec.c| 2 +- > libavcodec/mpeg4video.h | 3 +++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c > index a1981a3..0dde897 100644 > --- a/libavcodec/h263dec.c > +++ b/libavcodec/h263dec.c > @@ -459,7 +459,7 @@ retry: > } > } > > -if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // > divx 5.01+/xvid frame reorder > +if (s->bitstream_buffer_size && (s->divx_packed || buf_size < > MAX_NVOP_SIZE)) // divx 5.01+/xvid frame reorder its nitpicking but shouldnt it be <= if the constant is a maximum ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/3] lavf/libsmbclient: implement directory listing callbacks
On 3 April 2015 at 03:54, Mariusz Szczepańczyk wrote: > --- > libavformat/libsmbclient.c | 108 > + > 1 file changed, 108 insertions(+) > LGTM, I don't push yet as there is some discussion on other thread. I will be unavailable during following few days, so fell free to push in meanwhile. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] ffmpeg: fix indention
On Thu, Nov 20, 2014 at 10:52:42AM +0100, Clément Bœsch wrote: > indentation* changed applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- 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] [PATCH 1/2] ffmpeg: last frame duplication heuristic
On Wed, Nov 19, 2014 at 01:18:41PM +0100, Michael Niedermayer wrote: > This improves the last frames duration with CFR and when the input durations > are inaccurate or missing > > Signed-off-by: Michael Niedermayer applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : > I think there should be a separate function to construct a new url from a > url > and an entry object, that covers these cases or calls > av_append_path_component() for regular entries. Or we could just skip 20 years of API design and look at what POSIX did with openat(). POSIX forgot to separate open() from namei()/lookup, though, that is a shame. I do not know samba at all, though, so I can not say exactly how it maps. And to be clear: I had no objections to the patch itself. 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 3/4] avcodec: add unpack packed B-frames bitstream filter
Fixes Ticket #2913 Signed-off-by: Andreas Cadhalpun --- Changelog | 1 + doc/bitstream_filters.texi| 20 libavcodec/Makefile | 1 + libavcodec/allcodecs.c| 1 + libavcodec/mpeg4_unpack_bframes_bsf.c | 200 ++ libavcodec/version.h | 2 +- patcheck.tmp | 0 7 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 libavcodec/mpeg4_unpack_bframes_bsf.c create mode 100644 patcheck.tmp diff --git a/Changelog b/Changelog index ba0dff5..a6a0e2d 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ version : - Intel QSV-accelerated H.264 encoding - MMAL-accelerated H.264 decoding - basic APNG encoder and muxer +- unpack DivX-style packed B-frames in MPEG-4 bitstream filter version 2.6: diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 6431ce8..563049e 100644 --- a/doc/bitstream_filters.texi +++ b/doc/bitstream_filters.texi @@ -139,6 +139,26 @@ ffmpeg -i frame_%d.jpg -c:v copy rotated.avi @section mp3_header_decompress +@section mpeg4_unpack_bframes + +Unpack DivX-style packed B-frames. + +DivX-style packed B-frames are not valid MPEG-4 and were only a +workaround for the broken Video for Windows subsystem. +They use more space, can cause minor AV sync issues, require more +CPU power to decode (unless the player has some decoded picture queue +to compensate the 2,0,2,0 frame per packet style) and cause +trouble if copied into a standard container like mp4 or mpeg-ps/ts, +because MPEG-4 decoders may not be able to decode them, since they are +not valid MPEG-4. + +For example to fix an AVI file containing an MPEG-4 stream with +DivX-style packed B-frames using @command{ffmpeg}, you can use the command: + +@example +ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi +@end example + @section noise Damages the contents of packets without damaging the container. Can be diff --git a/libavcodec/Makefile b/libavcodec/Makefile index dd1d850..b01ecd6 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -841,6 +841,7 @@ OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF)+= imx_dump_header_bsf.o OBJS-$(CONFIG_MJPEG2JPEG_BSF) += mjpeg2jpeg_bsf.o OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpega_dump_header_bsf.o +OBJS-$(CONFIG_MPEG4_UNPACK_BFRAMES_BSF) += mpeg4_unpack_bframes_bsf.o OBJS-$(CONFIG_MOV2TEXTSUB_BSF)+= movsub_bsf.o OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += mp3_header_decompress_bsf.o \ mpegaudiodata.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index ef3558a..a3d8c1e 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -605,6 +605,7 @@ void avcodec_register_all(void) REGISTER_BSF(MJPEG2JPEG,mjpeg2jpeg); REGISTER_BSF(MJPEGA_DUMP_HEADER,mjpega_dump_header); REGISTER_BSF(MP3_HEADER_DECOMPRESS, mp3_header_decompress); +REGISTER_BSF(MPEG4_UNPACK_BFRAMES, mpeg4_unpack_bframes); REGISTER_BSF(MOV2TEXTSUB, mov2textsub); REGISTER_BSF(NOISE, noise); REGISTER_BSF(REMOVE_EXTRADATA, remove_extradata); diff --git a/libavcodec/mpeg4_unpack_bframes_bsf.c b/libavcodec/mpeg4_unpack_bframes_bsf.c new file mode 100644 index 000..977e5f0 --- /dev/null +++ b/libavcodec/mpeg4_unpack_bframes_bsf.c @@ -0,0 +1,200 @@ +/* + * Bitstream filter for unpacking DivX-style packed B-frames in MPEG-4 (divx_packed) + * Copyright (c) 2015 Andreas Cadhalpun + * + * 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 "avcodec.h" +#include "get_bits.h" +#include "mpeg4video.h" + +typedef struct UnpackBFramesBSFContext { +uint8_t *b_frame_buf; +int b_frame_buf_size; +int updated_extradata; +} UnpackBFramesBSFContext; + +/* search next start code */ +static unsigned int find_startcode(GetBitContext *gb) +{ +unsigned int startcode; +align_get_bits(gb); +startcode = 0xFF; + +for (; get_bits_count(gb) < gb->size_in_bits;) { +startcode = ((startcode << 8) | get_bits(gb, 8)) & 0x; +
[FFmpeg-devel] [PATCH 4/4] mpeg4: suggest mpeg4_unpack_bframes bsf instead of avidemux/VirtualDub
Signed-off-by: Andreas Cadhalpun --- libavcodec/mpeg4videodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 80dfb91..b8fd50b 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2664,7 +2664,7 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size) if (!ctx->showed_packed_warning) { av_log(s->avctx, AV_LOG_INFO, "Video uses a non-standard and " "wasteful way to store B-frames ('packed B-frames'). " - "Consider using a tool like VirtualDub or avidemux to fix it.\n"); + "Consider using the mpeg4_unpack_bframes bitstream filter to fix it.\n"); ctx->showed_packed_warning = 1; } av_fast_padded_malloc(&s->bitstream_buffer, -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/4] mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
Signed-off-by: Andreas Cadhalpun --- libavcodec/h263dec.c| 2 +- libavcodec/mpeg4video.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index a1981a3..0dde897 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -459,7 +459,7 @@ retry: } } -if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 5.01+/xvid frame reorder +if (s->bitstream_buffer_size && (s->divx_packed || buf_size < MAX_NVOP_SIZE)) // divx 5.01+/xvid frame reorder ret = init_get_bits8(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size); else diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index e83692c..2ba32b2 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -59,6 +59,9 @@ #define VISUAL_OBJ_STARTCODE 0x1B5 #define VOP_STARTCODE0x1B6 +/* smaller packets likely don't contain a real frame */ +#define MAX_NVOP_SIZE 20 + typedef struct Mpeg4DecContext { MpegEncContext m; -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/4] mpeg4: only show the divx_packed warning, when a packed frame is present
Otherwise it is shown even after the file was fixed with avidemux, because the userdata string still ends with 'p'. Signed-off-by: Andreas Cadhalpun --- libavcodec/mpeg4videodec.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 4769dfd..80dfb91 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2077,12 +2077,6 @@ static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb) ctx->divx_version = ver; ctx->divx_build = build; s->divx_packed = e == 3 && last == 'p'; -if (s->divx_packed && !ctx->showed_packed_warning) { -av_log(s->avctx, AV_LOG_INFO, "Video uses a non-standard and " - "wasteful way to store B-frames ('packed B-frames'). " - "Consider using a tool like VirtualDub or avidemux to fix it.\n"); -ctx->showed_packed_warning = 1; -} } /* libavcodec detection */ @@ -2667,6 +2661,12 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size) } if (startcode_found) { +if (!ctx->showed_packed_warning) { +av_log(s->avctx, AV_LOG_INFO, "Video uses a non-standard and " + "wasteful way to store B-frames ('packed B-frames'). " + "Consider using a tool like VirtualDub or avidemux to fix it.\n"); +ctx->showed_packed_warning = 1; +} av_fast_padded_malloc(&s->bitstream_buffer, &s->allocated_bitstream_buffer_size, buf_size - current_pos); -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] chorus filter
Signed-off-by: Paul B Mahol --- libavfilter/Makefile | 1 + libavfilter/af_chorus.c | 380 +++ libavfilter/allfilters.c | 1 + 3 files changed, 382 insertions(+) create mode 100644 libavfilter/af_chorus.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 73e7adf..48cee50 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -64,6 +64,7 @@ OBJS-$(CONFIG_BIQUAD_FILTER) += af_biquads.o OBJS-$(CONFIG_BS2B_FILTER) += af_bs2b.o OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o +OBJS-$(CONFIG_CHORUS_FILTER) += af_chorus.o generate_wave_table.o OBJS-$(CONFIG_COMPAND_FILTER)+= af_compand.o OBJS-$(CONFIG_DCSHIFT_FILTER)+= af_dcshift.o OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o diff --git a/libavfilter/af_chorus.c b/libavfilter/af_chorus.c new file mode 100644 index 000..5ecff1f --- /dev/null +++ b/libavfilter/af_chorus.c @@ -0,0 +1,380 @@ +/* + * Copyright (c) 1998 Juergen Mueller And Sundry Contributors + * This source code is freely redistributable and may be used for + * any purpose. This copyright notice must be maintained. + * Juergen Mueller And Sundry Contributors are not responsible for + * the consequences of using this software. + * + * Copyright (c) 2015 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * chorus audio filter + */ + +#include "libavutil/avstring.h" +#include "libavutil/opt.h" +#include "audio.h" +#include "avfilter.h" +#include "internal.h" +#include "generate_wave_table.h" + +typedef struct ChorusContext { +const AVClass *class; +float in_gain, out_gain; +char *delays_str; +char *decays_str; +char *speeds_str; +char *depths_str; +float *delays; +float *decays; +float *speeds; +float *depths; +float **chorusbuf; +int **phase; +int *length; +int32_t **lookup_table; +int *samples; +int *depth_samples; +int *counter; +int num_chorus; +int max_samples; +int channels; +int modulation; +int fade_out; +int64_t next_pts; +} ChorusContext; + +#define OFFSET(x) offsetof(ChorusContext, x) +#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM + +static const AVOption chorus_options[] = { +{ "in_gain", "set input gain", OFFSET(in_gain),AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A }, +{ "out_gain", "set output gain", OFFSET(out_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A }, +{ "delays", "set delays", OFFSET(delays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A }, +{ "decays", "set decays", OFFSET(decays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A }, +{ "speeds", "set speeds", OFFSET(speeds_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A }, +{ "depths", "set depths", OFFSET(depths_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A }, +{ NULL } +}; + +AVFILTER_DEFINE_CLASS(chorus); + +static void count_items(char *item_str, int *nb_items) +{ +char *p; + +*nb_items = 1; +for (p = item_str; *p; p++) { +if (*p == '|') +(*nb_items)++; +} + +} + +static void fill_items(char *item_str, int *nb_items, float *items) +{ +char *p, *saveptr = NULL; +int i, new_nb_items = 0; + +p = item_str; +for (i = 0; i < *nb_items; i++) { +char *tstr = av_strtok(p, "|", &saveptr); +p = NULL; +new_nb_items += sscanf(tstr, "%f", &items[i]) == 1; +} + +*nb_items = new_nb_items; +} + +static av_cold int init(AVFilterContext *ctx) +{ +ChorusContext *s = ctx->priv; +int nb_delays, nb_decays, nb_speeds, nb_depths; + +if (!s->delays_str || !s->decays_str || !s->speeds_str || !s->depths_str) +return AVERROR(EINVAL); + +count_items(s->delays_str, &nb_delays); +count_items(s->decays_str, &nb_decays); +count_items(s->speeds_str, &nb_speeds); +count_items(s->depths_str, &nb_depths); + +s->delays = av_realloc_f(s->delays, nb_delays, sizeof(*s->delays)); +s->decays = av_realloc_f(s->decays, nb_decays, sizeof(*s->decays)); +s->speeds = av_re
Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : exr lossy compression B44 based on OpenEXR code
On 3/27/15, greeshma wrote: > The corrected patch is attached. > PFA > > Greeshma > It is missing break. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/nvenc: Add options for level and tier
--- libavcodec/nvenc.c | 111 - 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index f77a982..d4e0a39 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -129,6 +129,12 @@ typedef struct NvencDynLoadFunctions #endif } NvencDynLoadFunctions; +typedef struct NvencValuePair +{ +const char *str; +uint32_t num; +} NvencValuePair; + typedef struct NvencContext { AVClass *avclass; @@ -152,11 +158,76 @@ typedef struct NvencContext char *preset; char *profile; +char *level; +char *tier; int cbr; int twopass; int gpu; } NvencContext; +static const NvencValuePair nvenc_h264_level_pairs[] = { +{ "auto", NV_ENC_LEVEL_AUTOSELECT }, +{ "1",NV_ENC_LEVEL_H264_1 }, +{ "1.0", NV_ENC_LEVEL_H264_1 }, +{ "1b", NV_ENC_LEVEL_H264_1b}, +{ "1.0b", NV_ENC_LEVEL_H264_1b}, +{ "1.1", NV_ENC_LEVEL_H264_11}, +{ "1.2", NV_ENC_LEVEL_H264_12}, +{ "1.3", NV_ENC_LEVEL_H264_13}, +{ "2",NV_ENC_LEVEL_H264_2 }, +{ "2.0", NV_ENC_LEVEL_H264_2 }, +{ "2.1", NV_ENC_LEVEL_H264_21}, +{ "2.2", NV_ENC_LEVEL_H264_22}, +{ "3",NV_ENC_LEVEL_H264_3 }, +{ "3.0", NV_ENC_LEVEL_H264_3 }, +{ "3.1", NV_ENC_LEVEL_H264_31}, +{ "3.2", NV_ENC_LEVEL_H264_32}, +{ "4",NV_ENC_LEVEL_H264_4 }, +{ "4.0", NV_ENC_LEVEL_H264_4 }, +{ "4.1", NV_ENC_LEVEL_H264_41}, +{ "4.2", NV_ENC_LEVEL_H264_42}, +{ "5",NV_ENC_LEVEL_H264_5 }, +{ "5.0", NV_ENC_LEVEL_H264_5 }, +{ "5.1", NV_ENC_LEVEL_H264_51}, +{ NULL } +}; + +static const NvencValuePair nvenc_h265_level_pairs[] = { +{ "auto", NV_ENC_LEVEL_AUTOSELECT }, +{ "1",NV_ENC_LEVEL_HEVC_1 }, +{ "1.0", NV_ENC_LEVEL_HEVC_1 }, +{ "2",NV_ENC_LEVEL_HEVC_2 }, +{ "2.0", NV_ENC_LEVEL_HEVC_2 }, +{ "2.1", NV_ENC_LEVEL_HEVC_21}, +{ "3",NV_ENC_LEVEL_HEVC_3 }, +{ "3.0", NV_ENC_LEVEL_HEVC_3 }, +{ "3.1", NV_ENC_LEVEL_HEVC_31}, +{ "4",NV_ENC_LEVEL_HEVC_4 }, +{ "4.0", NV_ENC_LEVEL_HEVC_4 }, +{ "4.1", NV_ENC_LEVEL_HEVC_41}, +{ "5",NV_ENC_LEVEL_HEVC_5 }, +{ "5.0", NV_ENC_LEVEL_HEVC_5 }, +{ "5.1", NV_ENC_LEVEL_HEVC_51}, +{ "5.2", NV_ENC_LEVEL_HEVC_52}, +{ "6",NV_ENC_LEVEL_HEVC_6 }, +{ "6.0", NV_ENC_LEVEL_HEVC_6 }, +{ "6.1", NV_ENC_LEVEL_HEVC_61}, +{ "6.2", NV_ENC_LEVEL_HEVC_62}, +{ NULL } +}; + +static int input_string_to_uint32(AVCodecContext *avctx, const NvencValuePair *pair, const char *input, uint32_t *output) +{ +for (; pair->str; ++pair) { +if (!strcmp(input, pair->str)) { +*output = pair->num; +return 0; +} +} + +return AVERROR(EINVAL); +} + static NvencData* data_queue_dequeue(NvencDataList* queue) { uint32_t mask; @@ -777,6 +848,18 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) goto error; } } + +if (ctx->level) { +res = input_string_to_uint32(avctx, nvenc_h264_level_pairs, ctx->level, &ctx->encode_config.encodeCodecConfig.h264Config.level); + +if (res) { +av_log(avctx, AV_LOG_FATAL, "Level \"%s\" is unknown! Supported levels: auto, 1, 1b, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, 5.1\n", ctx->level); +goto error; +} +} else { +ctx->encode_config.encodeCodecConfig.h264Config.level = NV_ENC_LEVEL_AUTOSELECT; +} + break; case AV_CODEC_ID_H265: ctx->encode_config.encodeCodecConfig.hevcConfig.disableSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0; @@ -785,6 +868,30 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) /* No other profile is supported in the current SDK version 5 */ ctx->encode_config.profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; avctx->profile = FF_PROFILE_HEVC_MAIN; + +if (ctx->level) { +res = input_string_to_uint32(avctx, nvenc_h265_level_pairs, ctx->level, &ctx->encode_config.encodeCodecConfig.hevcConfig.level); + +if (res) { +av_log(avctx, AV_LOG_FATAL, "Level \"%s\" is unknown! Supported levels: auto, 1, 2, 2.1, 3, 3.1, 4, 4.1, 5, 5.1, 5.2, 6, 6.1, 6.2\n", ctx->level); +goto error; +} +} else { +ctx->encode_config.encodeCodecConfig.hevcConfig.level = NV_ENC_LEVEL_AUTOSELECT; +} + +if (ctx->tier) { +if (!strcmp(ctx->tier, "main")) { +ctx->encode_config.encodeCodecConfig.hevcConfig.tier = NV_ENC_TIER_HEVC_MAIN; +} else if (!strcmp(ctx->tier, "high")) { +ctx->encode_config.encodeCodecCo
Re: [FFmpeg-devel] Patch: fix bug for POWER8 LE in file avcodec/ppc/fdctdsp.c
On Fri, Apr 03, 2015 at 09:14:35PM +0800, rongyan wrote: > Hi, > The attachment please find the patch to fix bug on POWER8 LE for jpeg > picture convert. The fucntion ff_fdct_altivec() is fixed and the macros > VEC_FMERGEH and VEC_FMERGEL are added. > > The fate test results is here: > > > Thanks for your review. > > Rong Yan > fdctdsp.c | 86 > +- > 1 file changed, 47 insertions(+), 39 deletions(-) > fd5af45ae44d283f04a28f9ddac1dc2ceeae952f > 0001-avcodec-ppc-fdctdsp.c-POWER-LE-support-in-ff_fdct_al.patch > From 0e6cfab9b3d4c4b8a7149ab97407dbaf239940e3 Mon Sep 17 00:00:00 2001 > From: Rong Yan > Date: Fri, 3 Apr 2015 12:36:18 + > Subject: [PATCH] avcodec/ppc/fdctdsp.c: POWER LE support in ff_fdct_altivec() > add marcos VEC_FMERGEH() VEC_FMERGEL() applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On Fri, Apr 3, 2015 at 4:52 PM, Lukasz Marek wrote: > On 3 April 2015 at 16:05, Lukasz Marek wrote: > > > On 3 April 2015 at 15:22, Nicolas George wrote: > > > >> Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : > >> > diff --git a/libavformat/avio.h b/libavformat/avio.h > >> > index f61a8f8..51913e3 100644 > >> > --- a/libavformat/avio.h > >> > +++ b/libavformat/avio.h > >> > @@ -63,7 +63,10 @@ enum AVIODirEntryType { > >> > AVIO_ENTRY_NAMED_PIPE, > >> > AVIO_ENTRY_SYMBOLIC_LINK, > >> > AVIO_ENTRY_SOCKET, > >> > -AVIO_ENTRY_FILE > >> > +AVIO_ENTRY_FILE, > >> > +AVIO_ENTRY_SERVER, > >> > +AVIO_ENTRY_SHARE, > >> > +AVIO_ENTRY_WORKGROUP, > >> > }; > >> > >> Sorry if I missed the previous discussions on the mailing list (and if > >> not, > >> maybe just 8 hours before apply was a bit short for discussion), but I > >> had a > >> bit of a concern with this change. > >> > >> Until know, if you wanted to make a recursive listing, you just had to > >> know > >> that you had to recurse into directories. Now... should you recurse into > >> shares? servers? workgroups? nobody knows. > >> > >> There should be some way of knowing whether an entry can be opened like > a > >> plain file, entered like a directory, or if it is just one of the weird > >> things that lay in some corners of filesystems, without requiring an > >> update > >> when new types are added. > >> > > > > You have good point about that, but regarding a patch itself do you see > it > > wrong? > > Sever, share, workgroup could be mapped to directory, but what happen > when > > we have delete operation available in API. You can delete directory, but > > how to delete a server or workgroup? > > IMHO patch is OK. > > > > AVIODirEntry can be extended with a flag "can recurse" to indicate that, > > but still I believe author of the client application must be aware of > what > > protocol they are using and how it works. > > > > Simple example with samba: > > doc/examples/avio_list_dir smb:// will list workgroups > doc/examples/avio_list_dir smb://WORKGROUP will list servers in workgroup > doc/examples/avio_list_dir smb://SERVER will list shares on server > doc/examples/avio_list_dir smb://SERVER/SHARE will list files, dirs etc in > SHARE > > smb://WORKGROUP/SERVER/SHARE is invalid. > > So user must know how the protocol works. Samba is a bit specific case, but > stacking directories, "openable" entries is not enough. > I think there should be a separate function to construct a new url from a url and an entry object, that covers these cases or calls av_append_path_component() for regular entries. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On Fri, Apr 3, 2015 at 3:22 PM, Nicolas George wrote: > Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : > > diff --git a/libavformat/avio.h b/libavformat/avio.h > > index f61a8f8..51913e3 100644 > > --- a/libavformat/avio.h > > +++ b/libavformat/avio.h > > @@ -63,7 +63,10 @@ enum AVIODirEntryType { > > AVIO_ENTRY_NAMED_PIPE, > > AVIO_ENTRY_SYMBOLIC_LINK, > > AVIO_ENTRY_SOCKET, > > -AVIO_ENTRY_FILE > > +AVIO_ENTRY_FILE, > > +AVIO_ENTRY_SERVER, > > +AVIO_ENTRY_SHARE, > > +AVIO_ENTRY_WORKGROUP, > > }; > > Sorry if I missed the previous discussions on the mailing list (and if not, > maybe just 8 hours before apply was a bit short for discussion), but I had > a > bit of a concern with this change. > > Until know, if you wanted to make a recursive listing, you just had to know > that you had to recurse into directories. Now... should you recurse into > shares? servers? workgroups? nobody knows. > > There should be some way of knowing whether an entry can be opened like a > plain file, entered like a directory, or if it is just one of the weird > things that lay in some corners of filesystems, without requiring an update > when new types are added. > Right. Even though user should at least roughly be aware of what specific type is representing, the api should provide a way to check if an entry is readable as file or listable as directory. I see two viable solutions: adding new flags to AVIODirEntry or adding functions like: bool avio_is_listable(AVIODirEntry *entry); bool avio_is_readable(AVIODirEntry *entry); (never mind the names, just example) I tend to prefer the second option because these properties should be completely dependant on type, and if it turns out they're not, the implementation can easily be changed/expanded. Regards, Mariusz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] ffmpeg: last frame duplication heuristic
Michael Niedermayer gmx.at> writes: > This improves the last frames duration with CFR and > when the input durations are inaccurate or missing Ping. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] filtfmts: Avoid null pointer dereference
On Fri, Apr 03, 2015 at 07:46:05PM +0530, Himangi Saraogi wrote: > --- > libavfilter/filtfmts.c | 14 +- > 1 file changed, 13 insertions(+), 1 deletion(-) applied thanks [...] -- 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]Fix fps diplay for very small fps
On Fri, Apr 03, 2015 at 02:14:34PM +0200, Carl Eugen Hoyos wrote: > Hi! > > Attached patch improves "ffmpeg -i" output for the sample from > ticket #4393. > > Please comment, Carl Eugen > dump.c |4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > cb560fbeeb217782f01b5e94a5497b235890d32e patchfps.diff > diff --git a/libavformat/dump.c b/libavformat/dump.c LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On 3 April 2015 at 16:05, Lukasz Marek wrote: > On 3 April 2015 at 15:22, Nicolas George wrote: > >> Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : >> > diff --git a/libavformat/avio.h b/libavformat/avio.h >> > index f61a8f8..51913e3 100644 >> > --- a/libavformat/avio.h >> > +++ b/libavformat/avio.h >> > @@ -63,7 +63,10 @@ enum AVIODirEntryType { >> > AVIO_ENTRY_NAMED_PIPE, >> > AVIO_ENTRY_SYMBOLIC_LINK, >> > AVIO_ENTRY_SOCKET, >> > -AVIO_ENTRY_FILE >> > +AVIO_ENTRY_FILE, >> > +AVIO_ENTRY_SERVER, >> > +AVIO_ENTRY_SHARE, >> > +AVIO_ENTRY_WORKGROUP, >> > }; >> >> Sorry if I missed the previous discussions on the mailing list (and if >> not, >> maybe just 8 hours before apply was a bit short for discussion), but I >> had a >> bit of a concern with this change. >> >> Until know, if you wanted to make a recursive listing, you just had to >> know >> that you had to recurse into directories. Now... should you recurse into >> shares? servers? workgroups? nobody knows. >> >> There should be some way of knowing whether an entry can be opened like a >> plain file, entered like a directory, or if it is just one of the weird >> things that lay in some corners of filesystems, without requiring an >> update >> when new types are added. >> > > You have good point about that, but regarding a patch itself do you see it > wrong? > Sever, share, workgroup could be mapped to directory, but what happen when > we have delete operation available in API. You can delete directory, but > how to delete a server or workgroup? > IMHO patch is OK. > > AVIODirEntry can be extended with a flag "can recurse" to indicate that, > but still I believe author of the client application must be aware of what > protocol they are using and how it works. > Simple example with samba: doc/examples/avio_list_dir smb:// will list workgroups doc/examples/avio_list_dir smb://WORKGROUP will list servers in workgroup doc/examples/avio_list_dir smb://SERVER will list shares on server doc/examples/avio_list_dir smb://SERVER/SHARE will list files, dirs etc in SHARE smb://WORKGROUP/SERVER/SHARE is invalid. So user must know how the protocol works. Samba is a bit specific case, but stacking directories, "openable" entries is not enough. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On Fri, Apr 03, 2015 at 03:22:29PM +0200, Nicolas George wrote: > Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : > > diff --git a/libavformat/avio.h b/libavformat/avio.h > > index f61a8f8..51913e3 100644 > > --- a/libavformat/avio.h > > +++ b/libavformat/avio.h > > @@ -63,7 +63,10 @@ enum AVIODirEntryType { > > AVIO_ENTRY_NAMED_PIPE, > > AVIO_ENTRY_SYMBOLIC_LINK, > > AVIO_ENTRY_SOCKET, > > -AVIO_ENTRY_FILE > > +AVIO_ENTRY_FILE, > > +AVIO_ENTRY_SERVER, > > +AVIO_ENTRY_SHARE, > > +AVIO_ENTRY_WORKGROUP, > > }; > > Sorry if I missed the previous discussions on the mailing list (and if not, > maybe just 8 hours before apply was a bit short for discussion), but I had a > bit of a concern with this change. > > Until know, if you wanted to make a recursive listing, you just had to know > that you had to recurse into directories. Now... should you recurse into > shares? servers? workgroups? nobody knows. > > There should be some way of knowing whether an entry can be opened like a > plain file, entered like a directory, or if it is just one of the weird > things that lay in some corners of filesystems, without requiring an update > when new types are added. filemode could contain a bit for directories or a function could provide this information, but for example links can be both file and directory or a new field could be added to AVIODirEntry Is there a problem in the patch itself ? should it be chnaged or reverted? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] filtfmts: Avoid null pointer dereference
--- libavfilter/filtfmts.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libavfilter/filtfmts.c b/libavfilter/filtfmts.c index c1025b9..46a2d94 100644 --- a/libavfilter/filtfmts.c +++ b/libavfilter/filtfmts.c @@ -75,6 +75,7 @@ int main(int argc, char **argv) const char *filter_name; const char *filter_args = NULL; int i; +int ret = 0; av_log_set_level(AV_LOG_DEBUG); @@ -115,11 +116,21 @@ int main(int argc, char **argv) /* create a link for each of the input pads */ for (i = 0; i < filter_ctx->nb_inputs; i++) { AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); +if (!link) { +fprintf(stderr, "Unable to allocate memory for filter input link\n"); +ret = 1; +goto fail; +} link->type = avfilter_pad_get_type(filter_ctx->input_pads, i); filter_ctx->inputs[i] = link; } for (i = 0; i < filter_ctx->nb_outputs; i++) { AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); +if (!link) { +fprintf(stderr, "Unable to allocate memory for filter output link\n"); +ret = 1; +goto fail; +} link->type = avfilter_pad_get_type(filter_ctx->output_pads, i); filter_ctx->outputs[i] = link; } @@ -131,8 +142,9 @@ int main(int argc, char **argv) print_formats(filter_ctx); +fail: avfilter_free(filter_ctx); avfilter_graph_free(&graph_ctx); fflush(stdout); -return 0; +return ret; } -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] matroskadec: export cover art correctly
Generally, libavformat exports cover art pictures as video streams with 1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported it as attachment with codec_id set to AV_CODEC_ID_MJPEG. Obviously, this should be consistent, so change the Matroska demuxer to export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream. Matroska muxing is probably incorrect too. I know that it can create broken files with an audio track and just 1 video frame when e.g. remuxing mp3 with APIC to mkv. But for now this commit does not change anything about muxing, and also continues to write attachments with AV_CODEC_ID_MJPEG should the muxer application have special knowledge that the Matroska is broken in this way. Fixes trac #4423. --- libavformat/matroska.c| 9 +++-- libavformat/matroska.h| 1 + libavformat/matroskadec.c | 41 +++-- libavformat/matroskaenc.c | 5 + 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/libavformat/matroska.c b/libavformat/matroska.c index bc5007a..faa662d 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -99,12 +99,17 @@ const CodecTags ff_mkv_codec_tags[]={ {"" , AV_CODEC_ID_NONE} }; -const CodecMime ff_mkv_mime_tags[] = { -{"text/plain" , AV_CODEC_ID_TEXT}, +const CodecMime ff_mkv_image_mime_tags[] = { {"image/gif" , AV_CODEC_ID_GIF}, {"image/jpeg" , AV_CODEC_ID_MJPEG}, {"image/png" , AV_CODEC_ID_PNG}, {"image/tiff" , AV_CODEC_ID_TIFF}, + +{"" , AV_CODEC_ID_NONE} +}; + +const CodecMime ff_mkv_mime_tags[] = { +{"text/plain" , AV_CODEC_ID_TEXT}, {"application/x-truetype-font", AV_CODEC_ID_TTF}, {"application/x-font" , AV_CODEC_ID_TTF}, {"application/vnd.ms-opentype", AV_CODEC_ID_OTF}, diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 391c56c..344b2c3 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -280,6 +280,7 @@ typedef struct CodecTags{ extern const CodecTags ff_mkv_codec_tags[]; extern const CodecMime ff_mkv_mime_tags[]; +extern const CodecMime ff_mkv_image_mime_tags[]; extern const AVMetadataConv ff_mkv_metadata_conv[]; extern const char * const ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB]; extern const char * const ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT]; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index cad207e..dd0bdce 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2142,20 +2142,41 @@ static int matroska_read_header(AVFormatContext *s) av_dict_set(&st->metadata, "filename", attachments[j].filename, 0); av_dict_set(&st->metadata, "mimetype", attachments[j].mime, 0); st->codec->codec_id = AV_CODEC_ID_NONE; -st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT; -if (ff_alloc_extradata(st->codec, attachments[j].bin.size)) -break; -memcpy(st->codec->extradata, attachments[j].bin.data, - attachments[j].bin.size); -for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) { -if (!strncmp(ff_mkv_mime_tags[i].str, attachments[j].mime, - strlen(ff_mkv_mime_tags[i].str))) { -st->codec->codec_id = ff_mkv_mime_tags[i].id; +for (i = 0; ff_mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; i++) { +if (!strncmp(ff_mkv_image_mime_tags[i].str, attachments[j].mime, + strlen(ff_mkv_image_mime_tags[i].str))) { +st->codec->codec_id = ff_mkv_image_mime_tags[i].id; +break; +} +} + +if (st->codec->codec_id != AV_CODEC_ID_NONE) { +st->disposition |= AV_DISPOSITION_ATTACHED_PIC; +st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + +av_init_packet(&st->attached_pic); +if ((res = av_new_packet(&st->attached_pic, attachments[j].bin.size)) < 0) +return res; +memcpy(st->attached_pic.data, attachments[j].bin.data, attachments[j].bin.size); +st->attached_pic.stream_index = st->index; +st->attached_pic.flags |= AV_PKT_FLAG_KEY; +} else { +st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT; +if (ff_alloc_extradata(st->codec, attachments[j].bin.size)) break; +memcpy(st->codec->extradata, attachments[j].bin.data, +attachments[j].bin.size); + +for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) { +if (!strncmp(ff_mkv_mime_tags[i].str, attachments[j].mime, +strlen
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On 3 April 2015 at 15:22, Nicolas George wrote: > Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : > > diff --git a/libavformat/avio.h b/libavformat/avio.h > > index f61a8f8..51913e3 100644 > > --- a/libavformat/avio.h > > +++ b/libavformat/avio.h > > @@ -63,7 +63,10 @@ enum AVIODirEntryType { > > AVIO_ENTRY_NAMED_PIPE, > > AVIO_ENTRY_SYMBOLIC_LINK, > > AVIO_ENTRY_SOCKET, > > -AVIO_ENTRY_FILE > > +AVIO_ENTRY_FILE, > > +AVIO_ENTRY_SERVER, > > +AVIO_ENTRY_SHARE, > > +AVIO_ENTRY_WORKGROUP, > > }; > > Sorry if I missed the previous discussions on the mailing list (and if not, > maybe just 8 hours before apply was a bit short for discussion), but I had > a > bit of a concern with this change. > > Until know, if you wanted to make a recursive listing, you just had to know > that you had to recurse into directories. Now... should you recurse into > shares? servers? workgroups? nobody knows. > > There should be some way of knowing whether an entry can be opened like a > plain file, entered like a directory, or if it is just one of the weird > things that lay in some corners of filesystems, without requiring an update > when new types are added. > You have good point about that, but regarding a patch itself do you see it wrong? Sever, share, workgroup could be mapped to directory, but what happen when we have delete operation available in API. You can delete directory, but how to delete a server or workgroup? IMHO patch is OK. AVIODirEntry can be extended with a flag "can recurse" to indicate that, but still I believe author of the client application must be aware of what protocol they are using and how it works. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
Le quartidi 14 germinal, an CCXXIII, Mariusz Szczepańczyk a écrit : > diff --git a/libavformat/avio.h b/libavformat/avio.h > index f61a8f8..51913e3 100644 > --- a/libavformat/avio.h > +++ b/libavformat/avio.h > @@ -63,7 +63,10 @@ enum AVIODirEntryType { > AVIO_ENTRY_NAMED_PIPE, > AVIO_ENTRY_SYMBOLIC_LINK, > AVIO_ENTRY_SOCKET, > -AVIO_ENTRY_FILE > +AVIO_ENTRY_FILE, > +AVIO_ENTRY_SERVER, > +AVIO_ENTRY_SHARE, > +AVIO_ENTRY_WORKGROUP, > }; Sorry if I missed the previous discussions on the mailing list (and if not, maybe just 8 hours before apply was a bit short for discussion), but I had a bit of a concern with this change. Until know, if you wanted to make a recursive listing, you just had to know that you had to recurse into directories. Now... should you recurse into shares? servers? workgroups? nobody knows. There should be some way of knowing whether an entry can be opened like a plain file, entered like a directory, or if it is just one of the weird things that lay in some corners of filesystems, without requiring an update when new types are added. Regards, -- Nicolas George ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Patch: fix bug for POWER8 LE in file avcodec/ppc/fdctdsp.c
Hi, The attachment please find the patch to fix bug on POWER8 LE for jpeg picture convert. The fucntion ff_fdct_altivec() is fixed and the macros VEC_FMERGEH and VEC_FMERGEL are added. The fate test results is here: Thanks for your review. Rong Yan 0001-avcodec-ppc-fdctdsp.c-POWER-LE-support-in-ff_fdct_al.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH]Fix fps diplay for very small fps
Hi! Attached patch improves "ffmpeg -i" output for the sample from ticket #4393. Please comment, Carl Eugen diff --git a/libavformat/dump.c b/libavformat/dump.c index 56b37ff..9a7035c 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -118,7 +118,9 @@ void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_paylo static void print_fps(double d, const char *postfix) { uint64_t v = lrintf(d * 100); -if (v % 100) +if (!v) +av_log(NULL, AV_LOG_INFO, "%1.4f %s", d, postfix); +else if (v % 100) av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix); else if (v % (100 * 1000)) av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix); ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Relaxed pattern to find ProRes in MXF.
On Fri, Apr 03, 2015 at 12:55:15PM +0200, Steve Dierker wrote: > Hello, > > > > > +{ { > > 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x > > 60,0x02 > > }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* Ikegami */ > > > > Errm where did this coming from, its unrelated (and wrong afaik as > > its a container UL). > > > > Oh, sorry this is unrelated, I'm currently trying to get to know the > MXF code of ffmpeg. It seems I forgot to reset the working tree. I'm > gonna send you the correct patch on Tuesday, since I'm not on my > workstation right know. removed the stray hunk and applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam" signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Relaxed pattern to find ProRes in MXF.
Hello, > > +{ { > 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x > 60,0x02 > }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* Ikegami */ > > Errm where did this coming from, its unrelated (and wrong afaik as > its a container UL). > Oh, sorry this is unrelated, I'm currently trying to get to know the MXF code of ffmpeg. It seems I forgot to reset the working tree. I'm gonna send you the correct patch on Tuesday, since I'm not on my workstation right know. have a nice Weekend, Steve -- -- XMPP: big...@jabber.ccc.de GitHub: https://github.com/bigzed Website: http://steved.org pgp6epPEn8_28.pgp Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]Support alaw in imkh files
On Fri, Apr 03, 2015 at 10:45:53AM +0200, Carl Eugen Hoyos wrote: > On Thursday 02 April 2015 11:47:08 am Carl Eugen Hoyos wrote: > > > +} else if (m->imkh_cctv && startcode == 0x1c0) { > > > +codec_id = AV_CODEC_ID_PCM_ALAW; > > > > Maybe with "request_probe=50;" - the manual of one > > of the camera claims that MP2 is a possible audio > > codec. > > New patch attached. > > Carl Eugen > mpeg.c |6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) LGTM thanks [...] -- 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] filtfmts: Avoid null pointer dereferences
On Fri, Apr 03, 2015 at 02:25:13PM +0530, Himangi Saraogi wrote: > --- > libavfilter/filtfmts.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/libavfilter/filtfmts.c b/libavfilter/filtfmts.c > index c1025b9..3e2a011 100644 > --- a/libavfilter/filtfmts.c > +++ b/libavfilter/filtfmts.c > @@ -34,6 +34,7 @@ static void print_formats(AVFilterContext *filter_ctx) > > #define PRINT_FMTS(inout, outin, INOUT) \ > for (i = 0; i < filter_ctx->nb_##inout##puts; i++) { > \ > +if (filter_ctx->inout##puts[i]) { \ > if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \ > AVFilterFormats *fmts = \ > filter_ctx->inout##puts[i]->outin##_formats;\ > @@ -61,6 +62,7 @@ static void print_formats(AVFilterContext *filter_ctx) > i, avfilter_pad_get_name(filter_ctx->inout##put_pads, > i), buf); \ > } \ > } \ > +} \ > } \ > > PRINT_FMTS(in, out, IN); > @@ -115,11 +117,15 @@ int main(int argc, char **argv) > /* create a link for each of the input pads */ > for (i = 0; i < filter_ctx->nb_inputs; i++) { > AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); > +if (!link) > +continue; > link->type = avfilter_pad_get_type(filter_ctx->input_pads, i); > filter_ctx->inputs[i] = link; > } > for (i = 0; i < filter_ctx->nb_outputs; i++) { > AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); > +if (!link) > +continue; main should return failure if some malloc inside it failed [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/3] doc/examples: Handle new types in avio_list_dir
On Fri, Apr 03, 2015 at 03:54:09AM +0200, Mariusz Szczepańczyk wrote: > --- > doc/examples/avio_list_dir.c | 6 ++ > 1 file changed, 6 insertions(+) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version
On Fri, Apr 03, 2015 at 03:54:08AM +0200, Mariusz Szczepańczyk wrote: > --- > doc/APIchanges| 5 + > libavformat/avio.h| 5 - > libavformat/version.h | 2 +- > 3 files changed, 10 insertions(+), 2 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] filtfmts: Avoid null pointer dereferences
--- libavfilter/filtfmts.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/filtfmts.c b/libavfilter/filtfmts.c index c1025b9..3e2a011 100644 --- a/libavfilter/filtfmts.c +++ b/libavfilter/filtfmts.c @@ -34,6 +34,7 @@ static void print_formats(AVFilterContext *filter_ctx) #define PRINT_FMTS(inout, outin, INOUT) \ for (i = 0; i < filter_ctx->nb_##inout##puts; i++) { \ +if (filter_ctx->inout##puts[i]) { \ if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \ AVFilterFormats *fmts = \ filter_ctx->inout##puts[i]->outin##_formats;\ @@ -61,6 +62,7 @@ static void print_formats(AVFilterContext *filter_ctx) i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), buf); \ } \ } \ +} \ } \ PRINT_FMTS(in, out, IN); @@ -115,11 +117,15 @@ int main(int argc, char **argv) /* create a link for each of the input pads */ for (i = 0; i < filter_ctx->nb_inputs; i++) { AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); +if (!link) +continue; link->type = avfilter_pad_get_type(filter_ctx->input_pads, i); filter_ctx->inputs[i] = link; } for (i = 0; i < filter_ctx->nb_outputs; i++) { AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); +if (!link) +continue; link->type = avfilter_pad_get_type(filter_ctx->output_pads, i); filter_ctx->outputs[i] = link; } -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] filtfmts: Avoid null pointer dereferences
Himangi Saraogi gmail.com> writes: { \ > -if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \ > +if (filter_ctx->inout##puts[i]) {\ > +if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \ Please resend your patch without the re-indentation. You can send a cosmetic-only patch separately. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]Support alaw in imkh files
On Thursday 02 April 2015 11:47:08 am Carl Eugen Hoyos wrote: > > +} else if (m->imkh_cctv && startcode == 0x1c0) { > > +codec_id = AV_CODEC_ID_PCM_ALAW; > > Maybe with "request_probe=50;" - the manual of one > of the camera claims that MP2 is a possible audio > codec. New patch attached. Carl Eugen diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index a0b5738..6e5f004 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -547,6 +547,9 @@ redo: codec_id = AV_CODEC_ID_ADPCM_ADX; // Auto-detect AC-3 request_probe = 50; +} else if (m->imkh_cctv && startcode == 0x1c0) { +codec_id = AV_CODEC_ID_PCM_ALAW; +request_probe = 50; } else { codec_id = AV_CODEC_ID_MP2; } @@ -591,7 +594,8 @@ skip: st->id= startcode; st->codec->codec_type = type; st->codec->codec_id = codec_id; -if (st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) { +if ( st->codec->codec_id == AV_CODEC_ID_PCM_MULAW +|| st->codec->codec_id == AV_CODEC_ID_PCM_ALAW) { st->codec->channels = 1; st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->sample_rate = 8000; ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel