[FFmpeg-devel] [PATCH] x11grab: fixed next frame capture time calculation
The next frame time could slip, causing the frame rate to drop until frames were dropped. Now will capture at the next correct moment instead. --- libavdevice/x11grab.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index bdfaa66..029d490 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -526,23 +526,22 @@ static int x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) int64_t curtime, delay; struct timespec ts; -/* Calculate the time of the next frame */ -s->time_frame += INT64_C(100); - /* wait based on the frame rate */ for (;;) { curtime = av_gettime(); delay = s->time_frame * av_q2d(s->time_base) - curtime; -if (delay <= 0) { -if (delay < INT64_C(-100) * av_q2d(s->time_base)) -s->time_frame += INT64_C(100); +if (delay <= 0) break; -} ts.tv_sec = delay / 100; ts.tv_nsec = (delay % 100) * 1000; nanosleep(&ts, NULL); } +/* Calculate the time of the next frame */ +do{ + s->time_frame += INT64_C(100); +}while((s->time_frame * av_q2d(s->time_base) - curtime) <= 0); + av_init_packet(pkt); pkt->data = image->data; pkt->size = s->frame_size; -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] sdl: Remove AVPicture usage
On 02/03/2016 08:39 AM, wm4 wrote: While I'm all for reviews, this set is rather inoffensive, and there are much messier and more controversial patches pushed without even sending them to the ML. Do we even have a consistent policy here? You tell me. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv2] doc/demuxers: add some concat demuxer script examples
On 2/3/16, Tobias Rapp wrote: > On 26.01.2016 09:09, Tobias Rapp wrote: >> On 25.01.2016 13:22, Nicolas George wrote: >>> Le decadi 30 nivose, an CCXXIV, Tobias Rapp a ecrit : Attached patch adds some example scripts for the concat demuxer to the documentation. >>> >>> Well, I maintain the code, not really the documentation. >>> >From 5ffc11e8139476d18cd2eaa28338adb0dda80999 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Tue, 19 Jan 2016 15:42:33 +0100 Subject: [PATCH] doc/demuxers: add some concat demuxer script examples Signed-off-by: Tobias Rapp --- doc/demuxers.texi | 21 + 1 file changed, 21 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index fb1e4fb..3900272 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -214,6 +214,27 @@ The default is 0. @end table +@subsection Examples + >>> +Example script which uses absolute filenames and includes some comments: >>> >>> I am not sure that "which" is the most idiomatic here, "that" sound >>> better, >>> but I am not a native speaker. >> >> I can also avoid which/that by "itemize"-ing the examples similar to >> other example sections within the documentation. Attached an updated >> version of the patch. >> >>> [...] > > Ping. > It should be fine if examples have been tested to actually work. > > ___ > 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] [SPI] Outreachy funding
On date Tuesday 2016-02-02 19:35:09 +0100, Michael Niedermayer encoded: > Hi > > I Suggest that we fund 1 slot for outreachy (so that FFmpeg can > participate in this round of Outreachy) assuming no sponsors are > found > The exact amount needed for this would be 6500 USD IIUC > > See: https://wiki.gnome.org/Outreachy/Admin/InfoForOrgs I approve this, assuming we already have an available mentor. I'd also suggest to pay the mentor with the fund, for a total of 500 USD, to incentivate him/her. At the moment we have 9195.00 EUR left in the ffis.de fund, and 8724.85 USD in the SPI fund (last update at the end of November 2015). -- FFmpeg = Funny and Fundamental Marvellous Powered Enhancing Game ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavc/lavf: transmit stream_id information for mpegts KLV data packets
On date Saturday 2016-01-30 13:40:57 +0100, Stefano Sabatini encoded: > This allows to copy information related to the stream ID from the demuxer > to the muxer, thus allowing for example to retain information related to > synchronous and asynchronous KLV data packets. This information is used > in the muxer when remuxing to distinguish the two kind of packets (if the > information is lacking, data packets are considered sychronous). > > The fate reference changes are due to the use of > av_packet_merge_side_data(), which increases the size of the output > packet size, since side data is merged into the packet data. > --- > libavcodec/avcodec.h | 6 ++ > libavcodec/avpacket.c | 1 + > libavformat/mpegts.c | 30 -- > libavformat/mpegtsenc.c | 26 -- > tests/ref/fate/concat-demuxer-simple2-lavf-ts | 128 > +- > tests/ref/seek/lavf-ts| 54 +-- > 6 files changed, 142 insertions(+), 103 deletions(-) Ping. Note: since my purpose is to allow remuxing KLV data, I can change this to enable stream_id side-data only with data streams (so that no reference must be changed). Since I have no strong opinion on this I'd change in case someone has a preference. -- FFmpeg = Funny Freak Mournful Political Elected God ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] rtpdec: support for VC-2 HQ RTP payload format (draft v1)
From: Thomas Volkert --- Changelog| 1 + libavformat/Makefile | 1 + libavformat/rtpdec.c | 1 + libavformat/rtpdec_formats.h | 1 + libavformat/rtpdec_vc2hq.c | 225 +++ libavformat/version.h| 4 +- 6 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 libavformat/rtpdec_vc2hq.c diff --git a/Changelog b/Changelog index 2f2ca3e..0b484d8 100644 --- a/Changelog +++ b/Changelog @@ -64,6 +64,7 @@ version : - new DCA decoder with full support for DTS-HD extensions - significant performance improvements in Windows Television (WTV) demuxer - nnedi deinterlacer +- VC-2 HQ RTP payload format (draft v1) depacketizer version 2.8: diff --git a/libavformat/Makefile b/libavformat/Makefile index 35a383d..db86742 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -51,6 +51,7 @@ OBJS-$(CONFIG_RTPDEC)+= rdt.o \ rtpdec_qdm2.o \ rtpdec_qt.o \ rtpdec_svq3.o \ +rtpdec_vc2hq.o \ rtpdec_vp8.o\ rtpdec_vp9.o\ rtpdec_xiph.o \ diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index c3e50d4..18a0803 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -105,6 +105,7 @@ void ff_register_rtp_dynamic_payload_handlers(void) ff_register_dynamic_payload_handler(&ff_quicktime_rtp_vid_handler); ff_register_dynamic_payload_handler(&ff_svq3_dynamic_handler); ff_register_dynamic_payload_handler(&ff_theora_dynamic_handler); +ff_register_dynamic_payload_handler(&ff_vc2hq_dynamic_handler); ff_register_dynamic_payload_handler(&ff_vorbis_dynamic_handler); ff_register_dynamic_payload_handler(&ff_vp8_dynamic_handler); ff_register_dynamic_payload_handler(&ff_vp9_dynamic_handler); diff --git a/libavformat/rtpdec_formats.h b/libavformat/rtpdec_formats.h index 50a2f4c..4f58dee 100644 --- a/libavformat/rtpdec_formats.h +++ b/libavformat/rtpdec_formats.h @@ -80,6 +80,7 @@ extern RTPDynamicProtocolHandler ff_quicktime_rtp_aud_handler; extern RTPDynamicProtocolHandler ff_quicktime_rtp_vid_handler; extern RTPDynamicProtocolHandler ff_svq3_dynamic_handler; extern RTPDynamicProtocolHandler ff_theora_dynamic_handler; +extern RTPDynamicProtocolHandler ff_vc2hq_dynamic_handler; extern RTPDynamicProtocolHandler ff_vorbis_dynamic_handler; extern RTPDynamicProtocolHandler ff_vp8_dynamic_handler; extern RTPDynamicProtocolHandler ff_vp9_dynamic_handler; diff --git a/libavformat/rtpdec_vc2hq.c b/libavformat/rtpdec_vc2hq.c new file mode 100644 index 000..5c6f4e5 --- /dev/null +++ b/libavformat/rtpdec_vc2hq.c @@ -0,0 +1,225 @@ +/* + * RTP parser for VC-2 HQ payload format (draft version 1) - experimental + * Copyright (c) 2016 Thomas Volkert + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/intreadwrite.h" +#include "libavcodec/dirac.h" + +#include "avio_internal.h" +#include "rtpdec_formats.h" + +#define RTP_VC2HQ_PL_HEADER_SIZE 4 + +#define DIRAC_DATA_UNIT_HEADER_SIZE 13 +#define DIRAC_PIC_NR_SIZE4 +#define DIRAC_RTP_PCODE_HQ_PIC_FRAGMENT 0xEC + +struct PayloadContext { +AVIOContext *buf; +uint32_tframe_size; +uint32_tframe_nr; +uint32_ttimestamp; +uint32_tlast_unit_size; +int seen_sequence_header; +}; + +static const uint8_t start_sequence[] = { 'B', 'B', 'C', 'D' }; + +static void fill_parse_info_header(PayloadContext *pl_ctx, uint8_t *buf, + uint8_t parse_code, uint32_t data_unit_size) +{ +memcpy(buf, start_sequence, sizeof(start_sequence)); +buf[4] = parse_code; +AV_WB32(&buf[5], data_unit_size); +AV_WB32(&buf[9], pl_ctx->last_unit_size); + +pl_ctx->last_unit_size = data_unit_size; +} + +static int vc2hq_handle_sequence_header(PayloadCon
Re: [FFmpeg-devel] [PATCHv2] doc/demuxers: add some concat demuxer script examples
On date Tuesday 2016-01-26 09:09:16 +0100, Tobias Rapp encoded: > On 25.01.2016 13:22, Nicolas George wrote: > >Le decadi 30 nivôse, an CCXXIV, Tobias Rapp a écrit : > >>Attached patch adds some example scripts for the concat demuxer to the > >>documentation. > > > >Well, I maintain the code, not really the documentation. > > > >>>From 5ffc11e8139476d18cd2eaa28338adb0dda80999 Mon Sep 17 00:00:00 2001 > >>From: Tobias Rapp > >>Date: Tue, 19 Jan 2016 15:42:33 +0100 > >>Subject: [PATCH] doc/demuxers: add some concat demuxer script examples > >> > >>Signed-off-by: Tobias Rapp > >>--- > >> doc/demuxers.texi | 21 + > >> 1 file changed, 21 insertions(+) > >> > >>diff --git a/doc/demuxers.texi b/doc/demuxers.texi > >>index fb1e4fb..3900272 100644 > >>--- a/doc/demuxers.texi > >>+++ b/doc/demuxers.texi > >>@@ -214,6 +214,27 @@ The default is 0. > >> > >> @end table > >> > >>+@subsection Examples > >>+ > > > >>+Example script which uses absolute filenames and includes some comments: > > > >I am not sure that "which" is the most idiomatic here, "that" sound better, > >but I am not a native speaker. > > I can also avoid which/that by "itemize"-ing the examples similar to > other example sections within the documentation. Attached an updated > version of the patch. > > >>+@example > >>+# my first filename > >>+file /mnt/share/file-1.wav > >>+# my second filename including whitespace > >>+file '/mnt/share/file 2.wav' > >>+# my third filename including whitespace plus single quote > >>+file '/mnt/share/file 3'\''.wav' > >>+@end example > >>+ > >>+Example script which allows for input format auto-probing, uses safe > >>filenames > >>+and sets the duration of the first file: > >>+@example > >>+ffconcat version 1.0 > >>+file file-1.wav > >>+duration 20.0 > >>+file 'file 2.wav' > >>+@end example > >>+ > >> @section flv > >> > >> Adobe Flash Video Format demuxer. > > > >No objection apart from that. > > Regards, > Tobias > From 2faf6c05df62c69347091aa6254c2db796d19345 Mon Sep 17 00:00:00 2001 > From: Tobias Rapp > Date: Tue, 26 Jan 2016 09:02:51 +0100 > Subject: [PATCH] doc/demuxers: add some concat demuxer script examples > > Signed-off-by: Tobias Rapp > --- > doc/demuxers.texi | 25 + > 1 file changed, 25 insertions(+) > > diff --git a/doc/demuxers.texi b/doc/demuxers.texi > index fb1e4fb..02cd041 100644 > --- a/doc/demuxers.texi > +++ b/doc/demuxers.texi > @@ -214,6 +214,31 @@ The default is 0. > > @end table > > +@subsection Examples > + > +@itemize > +@item > +Use absolute filenames and include some comments: > +@example > +# my first filename > +file /mnt/share/file-1.wav > +# my second filename including whitespace > +file '/mnt/share/file 2.wav' > +# my third filename including whitespace plus single quote > +file '/mnt/share/file 3'\''.wav' > +@end example > + > +@item > +Allow for input format auto-probing, use safe filenames and set the duration > of > +the first file: > +@example > +ffconcat version 1.0 > +file file-1.wav > +duration 20.0 > +file 'file 2.wav' > +@end example > +@end itemize Nit: add an empty line after the "duration" directive, so that it's clear that it applies to the first file. LGTM otherwise, thanks. -- FFmpeg = Fostering and Fancy Multimedia Patchable Elaborated Guru ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x11grab: fixed next frame capture time calculation
Trevor \\ Higgins gmail.com> writes: > -if (delay <= 0) { The patch will get more readable and easier to review if you don't change this line. > +do{ > +}while((s->time_frame * av_q2d(s->time_base) - curtime) <= 0); Please make this: do { ... } while ((... to keep the style consistent within the file. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv3] doc/demuxers: add some concat demuxer script examples
On 03.02.2016 10:23, Stefano Sabatini wrote: From 2faf6c05df62c69347091aa6254c2db796d19345 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Tue, 26 Jan 2016 09:02:51 +0100 Subject: [PATCH] doc/demuxers: add some concat demuxer script examples Signed-off-by: Tobias Rapp --- doc/demuxers.texi | 25 + 1 file changed, 25 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index fb1e4fb..02cd041 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -214,6 +214,31 @@ The default is 0. @end table +@subsection Examples + +@itemize +@item +Use absolute filenames and include some comments: +@example +# my first filename +file /mnt/share/file-1.wav +# my second filename including whitespace +file '/mnt/share/file 2.wav' +# my third filename including whitespace plus single quote +file '/mnt/share/file 3'\''.wav' +@end example + +@item +Allow for input format auto-probing, use safe filenames and set the duration of +the first file: +@example +ffconcat version 1.0 +file file-1.wav +duration 20.0 +file 'file 2.wav' +@end example +@end itemize Nit: add an empty line after the "duration" directive, so that it's clear that it applies to the first file. I agree. Have also added an empty line after the header line in the new patch. LGTM otherwise, thanks. New patch attached. It also replaces the 'file 2.wav' in the second example which didn't actually work in safe mode with 'subdir/file-2.wav' (thanks to Paul B Mahol for noticing it). Regards, Tobias >From efe7e2854f7155106339ba7b2fa6619f5721d2d7 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Tue, 26 Jan 2016 09:02:51 +0100 Subject: [PATCH] doc/demuxers: add some concat demuxer script examples Signed-off-by: Tobias Rapp --- doc/demuxers.texi | 27 +++ 1 file changed, 27 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 188808b..6b5f8bb 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -214,6 +214,33 @@ The default is 0. @end table +@subsection Examples + +@itemize +@item +Use absolute filenames and include some comments: +@example +# my first filename +file /mnt/share/file-1.wav +# my second filename including whitespace +file '/mnt/share/file 2.wav' +# my third filename including whitespace plus single quote +file '/mnt/share/file 3'\''.wav' +@end example + +@item +Allow for input format auto-probing, use safe filenames and set the duration of +the first file: +@example +ffconcat version 1.0 + +file file-1.wav +duration 20.0 + +file subdir/file-2.wav +@end example +@end itemize + @section flv Adobe Flash Video Format demuxer. -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv2] doc/demuxers: add some concat demuxer script examples
On 03.02.2016 09:48, Paul B Mahol wrote: On 2/3/16, Tobias Rapp wrote: On 26.01.2016 09:09, Tobias Rapp wrote: On 25.01.2016 13:22, Nicolas George wrote: Le decadi 30 nivose, an CCXXIV, Tobias Rapp a ecrit : Attached patch adds some example scripts for the concat demuxer to the documentation. Well, I maintain the code, not really the documentation. >From 5ffc11e8139476d18cd2eaa28338adb0dda80999 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Tue, 19 Jan 2016 15:42:33 +0100 Subject: [PATCH] doc/demuxers: add some concat demuxer script examples Signed-off-by: Tobias Rapp --- doc/demuxers.texi | 21 + 1 file changed, 21 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index fb1e4fb..3900272 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -214,6 +214,27 @@ The default is 0. @end table +@subsection Examples + +Example script which uses absolute filenames and includes some comments: I am not sure that "which" is the most idiomatic here, "that" sound better, but I am not a native speaker. I can also avoid which/that by "itemize"-ing the examples similar to other example sections within the documentation. Attached an updated version of the patch. [...] Ping. It should be fine if examples have been tested to actually work. Oops. You're right the second example doesn't work in safe mode because whitespace is not allowed. Have sent version 3 of the patch in a separate mail. Now the two examples have been tested literally. Regards, Tobias ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/dca_parser: set actual samplerate
Fixes timestamps with raw .dts demuxing. --- libavcodec/dca_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index 70e64a8..337a99d 100644 --- a/libavcodec/dca_parser.c +++ b/libavcodec/dca_parser.c @@ -166,6 +166,7 @@ static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx, /* read the duration and sample rate from the frame header */ if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, &pc1->framesize)) { s->duration= duration; +avctx->sample_rate = sample_rate; } else s->duration = 0; -- 2.7.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/dca_parser: set actual samplerate
On Wed, Feb 3, 2016 at 12:41 PM, wm4 wrote: > Fixes timestamps with raw .dts demuxing. > --- > libavcodec/dca_parser.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c > index 70e64a8..337a99d 100644 > --- a/libavcodec/dca_parser.c > +++ b/libavcodec/dca_parser.c > @@ -166,6 +166,7 @@ static int dca_parse(AVCodecParserContext *s, > AVCodecContext *avctx, > /* read the duration and sample rate from the frame header */ > if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, > &pc1->framesize)) { > s->duration= duration; > +avctx->sample_rate = sample_rate; > } else > s->duration = 0; > > -- > 2.7.0 > This is incorrect. http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=00ae5b401b24592a9f7019baada5b349152ee2fc Alternative patch attached. 0001-dca_parser-ensure-frame-duration-matches-the-actual-.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/dca_parser: set actual samplerate
On Wed, 3 Feb 2016 12:41:20 +0100 wm4 wrote: > Fixes timestamps with raw .dts demuxing. > --- > libavcodec/dca_parser.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c > index 70e64a8..337a99d 100644 > --- a/libavcodec/dca_parser.c > +++ b/libavcodec/dca_parser.c > @@ -166,6 +166,7 @@ static int dca_parse(AVCodecParserContext *s, > AVCodecContext *avctx, > /* read the duration and sample rate from the frame header */ > if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, > &pc1->framesize)) { > s->duration= duration; > +avctx->sample_rate = sample_rate; > } else > s->duration = 0; > wm4: that patch is wrong Nevermind this patch. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/dca_parser: set actual samplerate
On Wed, 3 Feb 2016 12:45:39 +0100 Hendrik Leppkes wrote: > On Wed, Feb 3, 2016 at 12:41 PM, wm4 wrote: > > Fixes timestamps with raw .dts demuxing. > > --- > > libavcodec/dca_parser.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c > > index 70e64a8..337a99d 100644 > > --- a/libavcodec/dca_parser.c > > +++ b/libavcodec/dca_parser.c > > @@ -166,6 +166,7 @@ static int dca_parse(AVCodecParserContext *s, > > AVCodecContext *avctx, > > /* read the duration and sample rate from the frame header */ > > if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, > > &pc1->framesize)) { > > s->duration= duration; > > +avctx->sample_rate = sample_rate; > > } else > > s->duration = 0; > > > > -- > > 2.7.0 > > > > This is incorrect. > http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=00ae5b401b24592a9f7019baada5b349152ee2fc Nice one. > Alternative patch attached. Fine with me, although it would indeed be better to have the parser parse the extensions correctly. But until someone goes through the effort, this patch is better. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv3] doc/demuxers: add some concat demuxer script examples
On date Wednesday 2016-02-03 11:47:46 +0100, Tobias Rapp encoded: [...] > From efe7e2854f7155106339ba7b2fa6619f5721d2d7 Mon Sep 17 00:00:00 2001 > From: Tobias Rapp > Date: Tue, 26 Jan 2016 09:02:51 +0100 > Subject: [PATCH] doc/demuxers: add some concat demuxer script examples > > Signed-off-by: Tobias Rapp > --- > doc/demuxers.texi | 27 +++ > 1 file changed, 27 insertions(+) Applied, thanks. -- FFmpeg = Free Faithless Martial Pure Exuberant Game ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]levc/hevc_cabac Optimise ff_hevc_hls_residual_coding (v2)
On Tue, 2 Feb 2016 12:52:15 +0100, you wrote: >Hi, > >as a motus operandi for this review, I have no time for a proper one, >or at least not fitting with John's timeframe. I'll try to close as >many pending discussions, and would prefer if someone else completed >the review/validation/commit. Do we have another volunteer? >[snip] Many thanks JC ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2] diracdec: allow decoding of field-coded pictures
This commit allows for the decoding of field-coded pictures in the HQ profile of VC-2. What it basically does is it gets a single field while in HQ field-coded mode, does not output a frame on that field but waits for the second field, decodes it to the same frame as the last field (avoiding a memcpy) and then outputs a frame with the 2 fields interleaved. This is done in a bit of a hacky way since it works around the whole previous structure of the decoder which is needingly complex to support old Dirac P and B frames. Signed-off-by: Rostislav Pehlivanov --- libavcodec/dirac.c| 15 ++- libavcodec/dirac.h| 1 + libavcodec/diracdec.c | 116 +- 3 files changed, 91 insertions(+), 41 deletions(-) diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index 39df2a8..d19adcf 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -324,7 +324,7 @@ int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh, { AVDiracSeqHeader *dsh; GetBitContext gb; -unsigned video_format, picture_coding_mode; +unsigned video_format; int ret; dsh = av_mallocz(sizeof(*dsh)); @@ -373,17 +373,8 @@ int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh, if (ret < 0) goto fail; -/* [DIRAC_STD] picture_coding_mode shall be 0 for fields and 1 for frames - * currently only used to signal field coding */ -picture_coding_mode = svq3_get_ue_golomb(&gb); -if (picture_coding_mode != 0) { -if (log_ctx) { -av_log(log_ctx, AV_LOG_ERROR, "Unsupported picture coding mode %d", - picture_coding_mode); -} -ret = AVERROR_INVALIDDATA; -goto fail; -} +/* [DIRAC_STD] picture_coding_mode shall be 1 for fields and 0 for frames */ +dsh->field_coding = svq3_get_ue_golomb(&gb); *pdsh = dsh; return 0; diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h index cb80fdc..447fafc 100644 --- a/libavcodec/dirac.h +++ b/libavcodec/dirac.h @@ -74,6 +74,7 @@ typedef struct AVDiracSeqHeader { uint8_t interlaced; uint8_t top_field_first; +uint8_t field_coding; uint8_t frame_rate_index; ///< index into dirac_frame_rate[] uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[] diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index ca44e7b..57a96bb 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -161,6 +161,8 @@ typedef struct DiracContext { int dc_prediction; /* has dc prediction */ int globalmc_flag; /* use global motion compensation*/ int num_refs; /* number of reference pictures */ +int field_coding; /* fields instead of frames */ +int cur_field; /* 0 -> progressive/top, 1 -> bottom */ /* wavelet decoding */ unsigned wavelet_depth; /* depth of the IDWT */ @@ -227,6 +229,9 @@ typedef struct DiracContext { dirac_weight_func weight_func; dirac_biweight_func biweight_func; +DiracFrame dummy_picture; + +DiracFrame prev_field; DiracFrame *current_picture; DiracFrame *ref_pics[2]; @@ -456,9 +461,11 @@ static av_cold int dirac_decode_init(AVCodecContext *avctx) ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); ff_videodsp_init(&s->vdsp, 8); +s->dummy_picture.avframe = av_frame_alloc(); for (i = 0; i < MAX_FRAMES; i++) { s->all_frames[i].avframe = av_frame_alloc(); if (!s->all_frames[i].avframe) { +av_frame_free(&s->dummy_picture.avframe); while (i > 0) av_frame_free(&s->all_frames[--i].avframe); return AVERROR(ENOMEM); @@ -482,6 +489,7 @@ static av_cold int dirac_decode_end(AVCodecContext *avctx) int i; dirac_decode_flush(avctx); +av_frame_free(&s->dummy_picture.avframe); for (i = 0; i < MAX_FRAMES; i++) av_frame_free(&s->all_frames[i].avframe); @@ -1822,6 +1830,7 @@ static int dirac_decode_frame_internal(DiracContext *s) for (comp = 0; comp < 3; comp++) { Plane *p = &s->plane[comp]; uint8_t *frame = s->current_picture->avframe->data[comp]; +frame += s->cur_field*p->stride; /* FIXME: small resolutions */ for (i = 0; i < 4; i++) @@ -1838,11 +1847,12 @@ static int dirac_decode_frame_internal(DiracContext *s) return ret; if (!s->num_refs) { /* intra */ +const int idx = (s->bit_depth - 8) >> 1; +const int ostride = p->stride << s->field_coding; for (y = 0; y < p->height; y += 16) { -int idx = (s->bit_depth - 8) >> 1; ff_spatial_idwt_slice2(&d, y+16); /* decode */ -s->diracdsp.put_signed_rect_clamped[idx](frame + y*p->stride, -
[FFmpeg-devel] [PATCH] avformat/http: Add crypto to default whitelist
Dear friends, I think we missed the crypto in the default_whitelist in case of http. Otherwise encrypted HLS will fail with [hls,applehttp @ 0x2af39c00] playlist[0] open_input [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts], start_seq_no [1], cur_seq_no [14] [hls,applehttp @ 0x2af39c00]open_input curseqno [14] startseqno [1] [hls,applehttp @ 0x2af39c00] HLS request for url 'http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts', offset 0, playlist 0 [NULL @ 0x2af3a200] KEY_AES_128 seg->key [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key] pls->key_url [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key] [hls,applehttp @ 0x2af39c00] open_input [KEY_AES_128] [hls,applehttp @ 0x2af39c00] : c->persistence [0] [hls,applehttp @ 0x2af39c00] : c->probing [1] [hls,applehttp @ 0x2af39c00] : pls->input [NULL] [hls,applehttp @ 0x2af39c00]using normal http path for URL [crypto+http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts] [crypto @ 0x2aff7cc0] Protocol not on whitelist 'http,https,tls,rtp,tcp,udp! Please find attached a patch to overcome this issue. Feedback for sure is warmly welcome. Regards Michael 0001-add-crypto-to-default-whitlist-to-get-encrypted-HLS-.patch Description: 0001-add-crypto-to-default-whitlist-to-get-encrypted-HLS-.patch ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC][WIP][PATCH] avfilter: add luascript filter
On 2016-02-02 23:25, Paul B Mahol wrote: > Hi, > > patch attached. Nice. I look forward to reading it. Firstly: why limit it to Lua 5.1? I think it should also support LuaJIT. While it is ABI compatible with 5.1 this patch would require its headers to be in "lua-5.1". My suggestion would be to test for LuaJIT first then fallback to 5.1. (Perhaps it isn't doing a lot in Lua code which then makes LuaJIT a little redundant.) Anyway, that is getting a little off topic. I will apply read the patch in detail later. Something else I should note. If you don't take care to provide a sandbox people could end up executing arbitrary code if they run scripts from the net. signature.asc Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC][WIP][PATCH] avfilter: add luascript filter
On Tue, 2 Feb 2016 23:25:27 +0100 Paul B Mahol wrote: > From 5caafe2f74d6eb5563b1103193cc8d136edcfd0f Mon Sep 17 00:00:00 2001 > From: Paul B Mahol > Date: Tue, 2 Feb 2016 10:09:50 +0100 > Subject: [RFC][WIP][PATCH] avfilter: add luascript filter > > Signed-off-by: Paul B Mahol > --- > configure | 4 + > libavfilter/Makefile| 1 + > libavfilter/allfilters.c| 1 + > libavfilter/src_luascript.c | 428 > > 4 files changed, 434 insertions(+) > create mode 100644 libavfilter/src_luascript.c > > diff --git a/configure b/configure > index c415d5a..289c62e 100755 > --- a/configure > +++ b/configure > @@ -275,6 +275,7 @@ External library support: >--disable-lzma disable lzma [autodetect] >--enable-decklinkenable Blackmagic DeckLink I/O support [no] >--enable-mmalenable decoding via MMAL [no] > + --enable-lua51 enable lua5.1, needed for luascript filter [no] >--enable-netcdf enable NetCDF, needed for sofalizer filter [no] >--enable-nvenc enable NVIDIA NVENC support [no] >--enable-openal enable OpenAL 1.1 capture support [no] > @@ -1494,6 +1495,7 @@ EXTERNAL_LIBRARY_LIST=" > libzimg > libzmq > libzvbi > +lua51 > lzma > mmal > netcdf > @@ -2867,6 +2869,7 @@ hqdn3d_filter_deps="gpl" > interlace_filter_deps="gpl" > kerndeint_filter_deps="gpl" > ladspa_filter_deps="ladspa dlopen" > +luascript_filter_deps="lua51" > mcdeint_filter_deps="avcodec gpl" > movie_filter_deps="avcodec avformat" > mpdecimate_filter_deps="gpl" > @@ -5577,6 +5580,7 @@ enabled mmal && > (check_code cc interface/mmal/mmal.h > "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS" || > die "ERROR: mmal firmware headers too old") > > +enabled lua51 && require_pkg_config lua5.1 lua.h lua_newstate Lua and pkg-config is a sad state of affair. Almost every Linux distro and BSD variant use a different name for pkg-config. (Upstream Lua provides no .pc file.) > enabled netcdf&& require_pkg_config netcdf netcdf.h > nc_inq_libvers > enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: > nvEncodeAPI.h not found."; } && > { check_cpp_condition nvEncodeAPI.h > "NVENCAPI_MAJOR_VERSION >= 5" || > diff --git a/libavfilter/Makefile b/libavfilter/Makefile > index e76d18e..bd9fce8 100644 > --- a/libavfilter/Makefile > +++ b/libavfilter/Makefile > @@ -298,6 +298,7 @@ OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER) += > vaf_spectrumsynth.o window_func. > > # multimedia sources > OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o > +OBJS-$(CONFIG_LUASCRIPT_FILTER) += src_luascript.o > OBJS-$(CONFIG_MOVIE_FILTER) += src_movie.o > > # Windows resource file > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c > index 27d54bc..00eb8a4 100644 > --- a/libavfilter/allfilters.c > +++ b/libavfilter/allfilters.c > @@ -318,6 +318,7 @@ void avfilter_register_all(void) > > /* multimedia sources */ > REGISTER_FILTER(AMOVIE, amovie, avsrc); > +REGISTER_FILTER(LUASCRIPT, luascript, avsrc); > REGISTER_FILTER(MOVIE, movie, avsrc); > > /* those filters are part of public or internal API => registered > diff --git a/libavfilter/src_luascript.c b/libavfilter/src_luascript.c > new file mode 100644 > index 000..949256e > --- /dev/null > +++ b/libavfilter/src_luascript.c > @@ -0,0 +1,428 @@ > +/* > + * Copyright (c) 2016 Paul B Mahol > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > + */ > + > +#include > +#include > + > +#include > +#include > +#include This include path is not portable. > + > +#include "libavutil/attributes.h" > +#include "libavutil/avstring.h" > +#include "libavutil/avassert.h" > +#include "libavutil/opt.h" > +#include "libavutil/imgutils.h" > +#include "libavutil/internal.h" > +#include "libavutil/timestamp.h" > +#include "libavformat/avformat.h" > +#include "audio.h" > +#include "avfilter.h" > +#include "buffersink.h" > +#include "formats.h" > +#include "internal.h" > +#include "video.h" >
Re: [FFmpeg-devel] [PATCH v5 1/5] libavcodec: VAAPI support infrastructure
On Tue, 2 Feb 2016 19:51:53 + Mark Thompson wrote: > On 01/02/16 15:58, wm4 wrote: > > On Sat, 30 Jan 2016 22:11:52 + > > Mark Thompson wrote: > > > >> --- > >> configure | 5 + > >> libavcodec/Makefile| 1 + > >> libavcodec/vaapi_support.c | 710 > >> + > >> libavcodec/vaapi_support.h | 122 > >> 4 files changed, 838 insertions(+) > >> create mode 100644 libavcodec/vaapi_support.c > >> create mode 100644 libavcodec/vaapi_support.h > >> > >> diff --git a/configure b/configure > >> index dba8180..e7f53af 100755 > >> --- a/configure > >> +++ b/configure > >> @@ -2037,6 +2037,7 @@ CONFIG_EXTRA=" > >> texturedsp > >> texturedspenc > >> tpeldsp > >> +vaapi_recent > >> videodsp > >> vp3dsp > >> vp56dsp > >> @@ -5768,6 +5769,10 @@ enabled vaapi && > >> check_lib va/va.h vaInitialize -lva || > >> disable vaapi > >> > >> +enabled vaapi && > >> +check_code cc va/va.h "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" && > >> +enable vaapi_recent > >> + > >> enabled vaapi && enabled xlib && > >> check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 && > >> enable vaapi_x11 > >> diff --git a/libavcodec/Makefile b/libavcodec/Makefile > >> index de957d8..045d118 100644 > >> --- a/libavcodec/Makefile > >> +++ b/libavcodec/Makefile > >> @@ -719,6 +719,7 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += > >> adpcmenc.o adpcm_data.o > >> OBJS-$(CONFIG_D3D11VA)+= dxva2.o > >> OBJS-$(CONFIG_DXVA2) += dxva2.o > >> OBJS-$(CONFIG_VAAPI) += vaapi.o > >> +OBJS-$(CONFIG_VAAPI_RECENT) += vaapi_support.o > >> OBJS-$(CONFIG_VDA)+= vda.o videotoolbox.o > >> OBJS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.o > >> OBJS-$(CONFIG_VDPAU) += vdpau.o > >> diff --git a/libavcodec/vaapi_support.c b/libavcodec/vaapi_support.c > >> new file mode 100644 > >> index 000..2e22f98 > >> --- /dev/null > >> +++ b/libavcodec/vaapi_support.c > >> @@ -0,0 +1,710 @@ > >> +/* > >> + * VAAPI helper functions. > >> + * > >> + * Copyright (C) 2016 Mark Thompson > >> + * > >> + * 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 "vaapi_support.h" > >> + > >> +#include "libavutil/avassert.h" > >> +#include "libavutil/imgutils.h" > >> +#include "libavutil/pixfmt.h" > >> + > >> + > >> +static AVClass vaapi_class = { > >> +.class_name = "vaapi", > >> +.item_name = av_default_item_name, > >> +.version= LIBAVUTIL_VERSION_INT, > >> +}; > >> +static AVClass *vaapi_log = &vaapi_class; > > > > We've talked about it on IRC. So the idea was matching > > AVVAAPIHardwareContext with vaapi_context, which is why the first > > member of AVVAAPIHardwareContext can't be AVClass. I think trying to > > somehow make these structs compatible should be given up, and instead > > the struct should have a vaapi_context pointer field instead. > > Yes. > > > Also, I'm very worried about how this patch in general with combine > > with the API Libav is planning to add: > > > > https://lists.libav.org/pipermail/libav-devel/2016-January/074490.html > > > > To make this clear, above patch series: > > - extends the buffer pool to make it useful for the hwdec case (where > > you need to free the hw context when the final AVFrame is unreffed) > > - create a common API for hwaccel contexts, which overlaps with this > > patch to some degree, but not fully > > - adds a hwaccel context field to AVFrame > > - the hwaccel context is refcounted > > - adds helper for reading back data from hwaccel AVFrames in an > > API-independent way > > > > I'm not sure what to make out of this mess. Any ideas? I don't really > > want to hold this patch series back either. There is not much reason to > > refactor the whole API 1 week after it has been added either. > > I'm not sure how to respond usefully to all of that, it adds a lot of new > things all over the place. > > It looks like it has most of the elements needed here, though I would need to > examine it more carefully
Re: [FFmpeg-devel] [PATCH v5 5/5] libavfilter: VAAPI surface scaler
On Tue, 2 Feb 2016 20:26:17 + Mark Thompson wrote: > On 01/02/16 16:14, wm4 wrote: > > On Sat, 30 Jan 2016 22:15:04 + > > Mark Thompson wrote: > >> +{ "hardware_context", "VAAPI hardware context", > >> + OFFSET(hardware_context), AV_OPT_TYPE_INT64, > >> + { .i64 = 0 }, INT64_MIN, INT64_MAX, AV_OPT_FLAG_VIDEO_PARAM }, > > > > Most of it is probably ok. But before it gets ready to be applied, I > > think we should find a semi-elegant way to populate the filter graph > > with the hw context. The "hardware_context" option is just a void* > > pointer, and there isn't anything that would prevent a big mess if e.g. > > vaapi support is introduced later. > > > > Seems like the Libav patch does provide something of value here with > > its generic hw context. It could be a field in AVFilterGraph itself. > > Yeah, the libav patch does let you solve that problem by putting the > information generically in more places. > > My rather inelegant thought was to add another function (and associated > fields) on the filter graph which applies options to all filters if the > option is present for them, something like: > > int avfilter_graph_set_options_on_everything(AVFilterGraph *graph, > AVDictionary **options); > > (Run before adding anything to the graph, because the options need to be > present at filter init time.) Unclear if it has any other use to justify its > existence, though. Also necessitates making the naming a bit more specific > to avoid possible collisions ("vaapi_hardware_context", I guess), and then > being careful with it in future. > > The other way I can see to do it in ffmpeg is to know the set of filter names > and run through the whole graph to add the option to them, but there isn't > really a time which works to do it. In any case, it doesn't help lav* users. By the way, the Libav ML now has a newer patch, which adds something to pass the hwctx along filters. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2] x11grab: fixed next frame capture time calculation
The next frame time could slip, causing the frame rate to drop until frames were dropped. Now will capture at the next correct moment instead. --- Fixed the style to conform to the standard --- libavdevice/x11grab.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index bdfaa66..9dc3472 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -526,16 +526,11 @@ static int x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) int64_t curtime, delay; struct timespec ts; -/* Calculate the time of the next frame */ -s->time_frame += INT64_C(100); - /* wait based on the frame rate */ for (;;) { curtime = av_gettime(); delay = s->time_frame * av_q2d(s->time_base) - curtime; if (delay <= 0) { -if (delay < INT64_C(-100) * av_q2d(s->time_base)) -s->time_frame += INT64_C(100); break; } ts.tv_sec = delay / 100; @@ -543,6 +538,11 @@ static int x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) nanosleep(&ts, NULL); } +/* Calculate the time of the next frame */ +do { + s->time_frame += INT64_C(100); +} while ((s->time_frame * av_q2d(s->time_base) - curtime) <= 0); + av_init_packet(pkt); pkt->data = image->data; pkt->size = s->frame_size; -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC][WIP][PATCH] avfilter: add luascript filter
On 2/3/16, wm4 wrote: > I'm not sure if I understand the implications. Do you have an example > file? It just proof of concept, nothing useful yet. This one is able to load single source like movie/amovie/testsrc2 and give output frames. I already wrote code that naively parse filtergraphs where you call filters like this: lavfi.filter(nil , "movie", "options", { movie_out }); lavfi.filter({ movie_out } , "vflip", nil, { outpads }); The thing is I need to do lot more for actual scripting support. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/http: Add crypto to default whitelist
On Wed, Feb 03, 2016 at 01:18:15PM +, Schenk, Michael wrote: > Dear friends, > > > > I think we missed the crypto in the default_whitelist in case of http. > Otherwise encrypted HLS will fail with > > > > [hls,applehttp @ 0x2af39c00] playlist[0] open_input > [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts], > start_seq_no [1], cur_seq_no [14] > > [hls,applehttp @ 0x2af39c00]open_input curseqno [14] startseqno [1] > > [hls,applehttp @ 0x2af39c00] HLS request for url > 'http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts', > offset 0, playlist 0 > > [NULL @ 0x2af3a200] KEY_AES_128 seg->key > [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key] > pls->key_url > [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key] > > [hls,applehttp @ 0x2af39c00] open_input [KEY_AES_128] > > [hls,applehttp @ 0x2af39c00] : c->persistence [0] > > [hls,applehttp @ 0x2af39c00] : c->probing [1] > > [hls,applehttp @ 0x2af39c00] : pls->input [NULL] > > [hls,applehttp @ 0x2af39c00]using normal http path for URL > [crypto+http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts] > > [crypto @ 0x2aff7cc0] Protocol not on whitelist 'http,https,tls,rtp,tcp,udp! > > > > Please find attached a patch to overcome this issue. > > > > Feedback for sure is warmly welcome. > > > > Regards > > > > Michael > > http.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > 99c3f1cbda849ab5a0a140353219f175e8cfc33d > 0001-add-crypto-to-default-whitlist-to-get-encrypted-HLS-.patch > From 4e9a375f18b1d85c26516e4e2307cabad1aedc98 Mon Sep 17 00:00:00 2001 > From: "Schenk, Michael" > Date: Wed, 3 Feb 2016 14:12:33 +0100 > Subject: [PATCH] add crypto to default whitlist to get encrypted HLS working > again applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once"- "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew ..." signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] feature request: add instructions on the trac upload page for how to upload larger files
On 2/2/16, Carl Eugen Hoyos wrote: > Roger Pack gmail.com> writes: > >> I wonder if it would be possible to tweak some config >> setting so that 10 MB uploads is the max? > > Please don't! reasoning? if we're going to use the disk space by putting it in incoming why not make it easier for users to upload files? Just wondering. -roger- ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] diracdec: move the MAX_DWT_LEVELS macro to dirac.h
On Tue, Feb 02, 2016 at 12:35:28PM +, Rostislav Pehlivanov wrote: > Used by the VC-2 encoder. > > Signed-off-by: Rostislav Pehlivanov > --- > libavcodec/dirac.h| 11 +++ > libavcodec/diracdec.c | 12 +--- > 2 files changed, 12 insertions(+), 11 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras 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] diradec: split tables away to a separate diractab file
On Tue, Feb 02, 2016 at 02:28:56PM +, Rostislav Pehlivanov wrote: > On 2 February 2016 at 13:32, Michael Niedermayer > wrote: > > > > > did you forget to add the diractab file ? > > > > > Ah, I did. > > Correct patch attached. > Makefile |2 - > diracdec.c | 79 -- > diractab.c | 89 > + > diractab.h | 41 > 4 files changed, 137 insertions(+), 74 deletions(-) > acbf6d1284de644dbda8e941ae56d9571b69a12d > 0001-diradec-split-tables-away-to-a-separate-diractab-fil.patch > From dbbe6e72fdc0ca04f4806a1b9c13ead4b563a488 Mon Sep 17 00:00:00 2001 > From: Rostislav Pehlivanov > Date: Tue, 2 Feb 2016 14:24:57 + > Subject: [PATCH v2] diradec: split tables away to a separate diractab file LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting. 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/4] diracdec: move the MAX_DWT_LEVELS macro to dirac.h
On Wed, 2016-02-03 at 15:53 +0100, Michael Niedermayer wrote: > On Tue, Feb 02, 2016 at 12:35:28PM +, Rostislav Pehlivanov wrote: > > Used by the VC-2 encoder. > > > > Signed-off-by: Rostislav Pehlivanov > > --- > > libavcodec/dirac.h| 11 +++ > > libavcodec/diracdec.c | 12 +--- > > 2 files changed, 12 insertions(+), 11 deletions(-) > > LGTM > > thx > > [...] > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Applied, Thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] diradec: split tables away to a separate diractab file
On Wed, 2016-02-03 at 15:55 +0100, Michael Niedermayer wrote: > On Tue, Feb 02, 2016 at 02:28:56PM +, Rostislav Pehlivanov wrote: > > On 2 February 2016 at 13:32, Michael Niedermayer > er.cc> > > wrote: > > > > > > > > did you forget to add the diractab file ? > > > > > > > > Ah, I did. > > > > Correct patch attached. > > > Makefile |2 - > > diracdec.c | 79 -- > > > > diractab.c | 89 > > + > > diractab.h | 41 > > 4 files changed, 137 insertions(+), 74 deletions(-) > > acbf6d1284de644dbda8e941ae56d9571b69a12d 0001-diradec-split- > > tables-away-to-a-separate-diractab-fil.patch > > From dbbe6e72fdc0ca04f4806a1b9c13ead4b563a488 Mon Sep 17 00:00:00 > > 2001 > > From: Rostislav Pehlivanov > > Date: Tue, 2 Feb 2016 14:24:57 + > > Subject: [PATCH v2] diradec: split tables away to a separate > > diractab file > > LGTM > > thx > [...] > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Applied, Thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/4] avformat: add vc2 as an allowed rawenc Dirac extension
On Wed, 2016-02-03 at 01:55 +0100, Michael Niedermayer wrote: > On Tue, Feb 02, 2016 at 12:35:30PM +, Rostislav Pehlivanov wrote: > > Signed-off-by: Rostislav Pehlivanov > > --- > > libavformat/rawenc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > should be ok > > [...] > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I'll wait until the encoder gets okayed before pushing this as it's not useful at the moment. Thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] Add TargetTypeValue in Matroska tag prefix
Le quartidi 14 pluviôse, an CCXXIV, Pierre Choffet a écrit : > Previously, the Matroska tag names were structured like this: > [/] > This lead to an issue when is not available: the different > levels tags overwrite each > other when they have the same name. > > This patch transforms the name prefix into: > [-]/ > > As the TargetTypeValue has default value in case it has no data, it prevents > from overriding of other levels > tags. > --- > libavformat/matroskadec.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c > index d788232..d7d0e54 100644 > --- a/libavformat/matroskadec.c > +++ b/libavformat/matroskadec.c > @@ -1460,8 +1460,16 @@ static void matroska_convert_tags(AVFormatContext *s) > i, tags[i].target.trackuid); > } > } else { > -matroska_convert_tag(s, &tags[i].tag, &s->metadata, > - tags[i].target.type); > +char *prefix; > +if (tags[i].target.type) > +prefix = av_asprintf("%"PRIu64"-%s", > + tags[i].target.typevalue, > + tags[i].target.type); > +else > +prefix = av_asprintf("%"PRIu64, tags[i].target.typevalue); > + > +matroska_convert_tag(s, &tags[i].tag, &s->metadata, prefix); > +av_free(prefix); Thanks for the change, but with asprintf, checks for allocation failure are necessary. > } > } > } 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] Check av_dup_packet() return code
Fixes: CID1338320 Signed-off-by: Michael Niedermayer --- libavcodec/frame_thread_encoder.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index 04c9a0e..27ae356 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -89,7 +89,9 @@ static void * attribute_align_arg worker(void *v){ pthread_mutex_unlock(&c->buffer_mutex); av_frame_free(&frame); if(got_packet) { -av_dup_packet(pkt); +int ret2 = av_dup_packet(pkt); +if (ret >= 0 && ret2 < 0) +ret = ret2; } else { pkt->data = NULL; pkt->size = 0; -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] sdl: Remove AVPicture usage
On 2/3/2016 4:39 AM, wm4 wrote: > On Tue, 2 Feb 2016 23:41:59 -0300 > James Almer wrote: > >> On 2/2/2016 11:17 PM, Timothy Gu wrote: >>> On Mon, Feb 01, 2016 at 07:04:06PM -0800, Timothy Gu wrote: --- libavdevice/sdl.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) >>> >>> Set pushed. >>> >>> Timothy >> >> You sent this set last night. There was no reason to push it in a hurry >> without waiting for a review. > > While I'm all for reviews, this set is rather inoffensive, and there > are much messier and more controversial patches pushed without even > sending them to the ML. Do we even have a consistent policy here? Give it at least a couple days before pushing unreviewed patches for code you don't maintain? Inoffensive were the two cosmetic ones he pushed before, which are fine, but making encoders use a different API could use a second pair of eyes. It's not like the older deprecated API is being removed soon and these patches needed to go in asap. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avutil/imgutils: Assert that the 2nd av_image_fill_linesizes() call in av_image_fill_linesizes() still succeeds
Fixes CID1271742 Signed-off-by: Michael Niedermayer --- libavutil/imgutils.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index 3320664..f4a015a 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -385,6 +385,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size, int i, j, nb_planes = 0, linesize[4]; int size = av_image_get_buffer_size(pix_fmt, width, height, align); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); +int ret; if (size > dst_size || size < 0 || !desc) return AVERROR(EINVAL); @@ -394,7 +395,9 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size, nb_planes++; -av_image_fill_linesizes(linesize, pix_fmt, width); +ret = av_image_fill_linesizes(linesize, pix_fmt, width); +av_assert0(ret >= 0); // was checked previously + for (i = 0; i < nb_planes; i++) { int h, shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0; const uint8_t *src = src_data[i]; -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] feature request: add instructions on the trac upload page for how to upload larger files
Roger Pack gmail.com> writes: > On 2/2/16, Carl Eugen Hoyos ag.or.at> wrote: > > Roger Pack gmail.com> writes: > > > >> I wonder if it would be possible to tweak some config > >> setting so that 10 MB uploads is the max? > > > > Please don't! > > reasoning? For 50% of the bug report, 2.5 MB are too much, for the other 50%, 10 are not enough. (Yes, this is an exaggeration but the point is that for a very large number of tickets, the uploaded files are already too large, I want to avoid even larger files.) Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Add mkdir support for HLS localtime-generated segment files
Hi, this patch adds -use_localtime_mkdir option to the HLS encoder. Use with -use_localtime, and set -hls_segment_filename to a path which contains a subdirectory i.e. /some/path/%Y%m%d/%Y%m%dT%H%M%S-%s.ts This will mkdir the %Y%m%d-part of the path if it does not already exist. In addition, each filename in the playlist output will be prefixed with this subdirectory (if playlist and segment shares the same base path). Example: $ ffmpeg -f hls -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename /dvr/test/%Y%m%d/%Y%m%dT%H%M%S-%s.ts /dvr/test/playlist.m3u8 This will create put segments created (today) in /dvr/test/20160203/, and the 20160203 dir will be automatically created if it does not already exist. The m3u8 playlist will contain segment paths like this: 20160203/20160203T224121-1454535681.ts The subdir support could possibly be enabled outside of the localtime/mkdir-scope. Regards Johan From 40327f78d70b3f1b97b222de5adf70020c466db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Str=C3=B6m?= Date: Wed, 3 Feb 2016 22:20:07 +0100 Subject: [PATCH] hlsenc: add use_localtime_mkdir option to automatically create time-based directory Use with -use_localtime, and set -hls_segment_filename to a path which contains a subdirectory i.e. /some/path/%Y%m%d/%Y%m%dT%H%M%S-%s.ts This will mkdir the %Y%m%d-part of the path if it does not already exist. In addition, each filename in the playlist output will be prefixed with this subdirectory (if playlist and segment shares the same base path). --- libavformat/hlsenc.c | 46 -- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index bc28e3c..073618d 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -82,6 +82,7 @@ typedef struct HLSContext { char *segment_filename; int use_localtime; ///< flag to expand filename with localtime +int use_localtime_mkdir;///< flag to mkdir dirname in timebased filename int allowcache; int64_t recording_time; int has_video; @@ -303,16 +304,33 @@ static int hls_mux_init(AVFormatContext *s) } /* Create a new segment and append it to the segment list */ -static int hls_append_segment(HLSContext *hls, double duration, int64_t pos, - int64_t size) +static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double duration, + int64_t pos, int64_t size) { HLSSegment *en = av_malloc(sizeof(*en)); +char *tmp, *p; +const char *pl_dir, *filename; int ret; if (!en) return AVERROR(ENOMEM); -av_strlcpy(en->filename, av_basename(hls->avf->filename), sizeof(en->filename)); +filename = av_basename(hls->avf->filename); + +if (hls->use_localtime_mkdir) { +/* Possibly prefix with mkdir'ed subdir, if playlist share same + * base path. */ +tmp = av_strdup(s->filename); +if (!tmp) +return AVERROR(ENOMEM); + +pl_dir = av_dirname(tmp); +p = hls->avf->filename; +if (strstr(p, pl_dir) == p) +filename = hls->avf->filename + strlen(pl_dir) + 1; +av_free(tmp); +} +av_strlcpy(en->filename, filename, sizeof(en->filename)); if(hls->has_subtitle) av_strlcpy(en->sub_filename, av_basename(hls->vtt_avf->filename), sizeof(en->sub_filename)); @@ -509,6 +527,21 @@ static int hls_start(AVFormatContext *s) av_log(oc, AV_LOG_ERROR, "Could not get segment filename with use_localtime\n"); return AVERROR(EINVAL); } + +if (c->use_localtime_mkdir) { +const char *dir; +char *fn_copy = av_strdup(oc->filename); +if (!fn_copy) { +return AVERROR(ENOMEM); +} +dir = av_dirname(fn_copy); +if (mkdir(dir, 0777) == -1 && errno != EEXIST) { +av_log(oc, AV_LOG_ERROR, "Could not create directory %s with use_localtime_mkdir\n", dir); +av_free(fn_copy); +return AVERROR(errno); +} +av_free(fn_copy); +} } else if (av_get_frame_filename(oc->filename, sizeof(oc->filename), c->basename, c->wrap ? c->sequence % c->wrap : c->sequence) < 0) { av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' you can try use -use_localtime 1 with it\n", c->basename); @@ -782,7 +815,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) new_start_pos = avio_tell(hls->avf->pb); hls->size = new_start_pos - hls->start_pos; -ret = hls_append_segment(hls, hls->
Re: [FFmpeg-devel] [PATCH] lavf: forward protocol_whitelist for the remaining cases
On 03.02.2016 03:41, Michael Niedermayer wrote: > On Wed, Feb 03, 2016 at 01:51:55AM +0100, Andreas Cadhalpun wrote: >> @@ -274,4 +282,5 @@ URLProtocol ff_ffrtmphttp_protocol = { >> .priv_data_size = sizeof(RTMP_HTTPContext), >> .flags = URL_PROTOCOL_FLAG_NETWORK, >> .priv_data_class= &ffrtmphttp_class, >> +.default_whitelist = "https,http,tcp", > > if it needs https it might need tls too Yes, updated patch attached. Best regards, Andreas >From 595133afad21a4e264642259e8c74708dd4a72ba Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Wed, 3 Feb 2016 01:01:34 +0100 Subject: [PATCH] lavf: forward protocol_whitelist for the remaining cases Also set a default_whitelist for mmsh and ffrtmphttp. Signed-off-by: Andreas Cadhalpun --- libavformat/mmsh.c | 9 + libavformat/rtmphttp.c | 9 + libavformat/rtsp.c | 8 3 files changed, 26 insertions(+) diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c index 16f07fe..d992337 100644 --- a/libavformat/mmsh.c +++ b/libavformat/mmsh.c @@ -246,6 +246,14 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim host, port, mmsh->request_seq++); av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0); +if (!mms->mms_hd->protocol_whitelist && h->protocol_whitelist) { +mms->mms_hd->protocol_whitelist = av_strdup(h->protocol_whitelist); +if (!mms->mms_hd->protocol_whitelist) { +err = AVERROR(ENOMEM); +goto fail; +} +} + err = ffurl_connect(mms->mms_hd, NULL); if (err) { goto fail; @@ -410,4 +418,5 @@ URLProtocol ff_mmsh_protocol = { .url_read_seek = mmsh_read_seek, .priv_data_size = sizeof(MMSHContext), .flags = URL_PROTOCOL_FLAG_NETWORK, +.default_whitelist = "http,tcp", }; diff --git a/libavformat/rtmphttp.c b/libavformat/rtmphttp.c index 8ed5eb1..67e81cc 100644 --- a/libavformat/rtmphttp.c +++ b/libavformat/rtmphttp.c @@ -220,6 +220,14 @@ static int rtmp_http_open(URLContext *h, const char *uri, int flags) av_opt_set(rt->stream->priv_data, "multiple_requests", "1", 0); av_opt_set_bin(rt->stream->priv_data, "post_data", "", 1, 0); +if (!rt->stream->protocol_whitelist && h->protocol_whitelist) { +rt->stream->protocol_whitelist = av_strdup(h->protocol_whitelist); +if (!rt->stream->protocol_whitelist) { +ret = AVERROR(ENOMEM); +goto fail; +} +} + /* open the http context */ if ((ret = ffurl_connect(rt->stream, NULL)) < 0) goto fail; @@ -274,4 +282,5 @@ URLProtocol ff_ffrtmphttp_protocol = { .priv_data_size = sizeof(RTMP_HTTPContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class= &ffrtmphttp_class, +.default_whitelist = "https,http,tcp,tls", }; diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index d710469..24a1e2b 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1746,6 +1746,14 @@ redirect: sessioncookie); av_opt_set(rt->rtsp_hd->priv_data, "headers", headers, 0); +if (!rt->rtsp_hd->protocol_whitelist && s->protocol_whitelist) { +rt->rtsp_hd->protocol_whitelist = av_strdup(s->protocol_whitelist); +if (!rt->rtsp_hd->protocol_whitelist) { +err = AVERROR(ENOMEM); +goto fail; +} +} + /* complete the connection */ if (ffurl_connect(rt->rtsp_hd, NULL)) { err = AVERROR(EIO); -- 2.7.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Check av_dup_packet() return code
On 03.02.2016 19:05, Michael Niedermayer wrote: > Fixes: CID1338320 > > Signed-off-by: Michael Niedermayer > --- > libavcodec/frame_thread_encoder.c |4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/frame_thread_encoder.c > b/libavcodec/frame_thread_encoder.c > index 04c9a0e..27ae356 100644 > --- a/libavcodec/frame_thread_encoder.c > +++ b/libavcodec/frame_thread_encoder.c > @@ -89,7 +89,9 @@ static void * attribute_align_arg worker(void *v){ > pthread_mutex_unlock(&c->buffer_mutex); > av_frame_free(&frame); > if(got_packet) { > -av_dup_packet(pkt); > +int ret2 = av_dup_packet(pkt); > +if (ret >= 0 && ret2 < 0) > +ret = ret2; > } else { > pkt->data = NULL; > pkt->size = 0; > Checking the return code this way is probably OK, but maybe you can also replace the deprecated av_dup_packet with av_packet_ref while at it? Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avutil/aes_crt: free AVAESCTR struct properly
Signed-off-by: James Almer --- libavutil/aes_ctr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/aes_ctr.c b/libavutil/aes_ctr.c index 2343543..e9c568f 100644 --- a/libavutil/aes_ctr.c +++ b/libavutil/aes_ctr.c @@ -79,7 +79,7 @@ void av_aes_ctr_free(struct AVAESCTR *a) { if (a) { av_freep(&a->aes); -av_freep(a); +av_free(a); } } -- 2.7.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avutil/aes_crt: free AVAESCTR struct properly
On 03.02.2016 23:26, James Almer wrote: > Signed-off-by: James Almer > --- > libavutil/aes_ctr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavutil/aes_ctr.c b/libavutil/aes_ctr.c > index 2343543..e9c568f 100644 > --- a/libavutil/aes_ctr.c > +++ b/libavutil/aes_ctr.c > @@ -79,7 +79,7 @@ void av_aes_ctr_free(struct AVAESCTR *a) > { > if (a) { > av_freep(&a->aes); > -av_freep(a); > +av_free(a); > } > } > > Sure. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avutil/aes_crt: free AVAESCTR struct properly
On 2/3/2016 7:29 PM, Andreas Cadhalpun wrote: > On 03.02.2016 23:26, James Almer wrote: >> Signed-off-by: James Almer >> --- >> libavutil/aes_ctr.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/libavutil/aes_ctr.c b/libavutil/aes_ctr.c >> index 2343543..e9c568f 100644 >> --- a/libavutil/aes_ctr.c >> +++ b/libavutil/aes_ctr.c >> @@ -79,7 +79,7 @@ void av_aes_ctr_free(struct AVAESCTR *a) >> { >> if (a) { >> av_freep(&a->aes); >> -av_freep(a); >> +av_free(a); >> } >> } >> >> > > Sure. > > Best regards, > Andreas Pushed, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] sdl: Remove AVPicture usage
On Tue, Feb 02, 2016 at 11:41:59PM -0300, James Almer wrote: > On 2/2/2016 11:17 PM, Timothy Gu wrote: > > On Mon, Feb 01, 2016 at 07:04:06PM -0800, Timothy Gu wrote: > >> --- > >> libavdevice/sdl.c | 10 ++ > >> 1 file changed, 6 insertions(+), 4 deletions(-) > > > > Set pushed. > > > > Timothy > > You sent this set last night. There was no reason to push it in a hurry > without waiting for a review. Noted, will be more careful in the future. Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
Fixes: CID1351343 Signed-off-by: Michael Niedermayer --- libavformat/mp3enc.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 7296234..71f5178 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -192,7 +192,8 @@ static int mp3_write_xing(AVFormatContext *s) return -1; header |= mask; -avpriv_mpegaudio_decode_header(&mpah, header); +ret = avpriv_mpegaudio_decode_header(&mpah, header); +av_assert0(ret >= 0); mp3->xing_offset = xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1] + 4; bytes_needed = mp3->xing_offset + XING_SIZE; -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86/emms: run the instruction unconditionally on supported targets
On 2/3/2016 2:21 AM, James Almer wrote: > Inlined functions like AV_ZERO* and AV_COPY* may use mmx instructions > regardless of runtime cpuflags. > > Signed-off-by: James Almer > --- > On targets where __MMX__ is not defined (like default x86_32 builds) the > runtime check is a must, and neither of the above functions will use mmx > instructions anyway. > > libavutil/x86/emms.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h > index a529b6b..0deeb8c 100644 > --- a/libavutil/x86/emms.h > +++ b/libavutil/x86/emms.h > @@ -34,7 +34,9 @@ void avpriv_emms_yasm(void); > */ > static av_always_inline void emms_c(void) > { > +#if !defined(__MMX__) > if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) > +#endif > __asm__ volatile ("emms" ::: "memory"); > } > #elif HAVE_MMX && HAVE_MM_EMPTY > If you want a simple test case, on x86_32 do: configure --cpu=pentium-mmx && make fate-dca CPUFLAGS=0 And watch it crash. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avfilter/af_apulsator: assert that pathes leaving uninitialized variables do not occur
Fixes: CID1341581, CID1341582 Signed-off-by: Michael Niedermayer --- libavfilter/af_apulsator.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/af_apulsator.c b/libavfilter/af_apulsator.c index 6c81530..802b8d0 100644 --- a/libavfilter/af_apulsator.c +++ b/libavfilter/af_apulsator.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "libavutil/opt.h" #include "avfilter.h" #include "internal.h" @@ -117,6 +118,7 @@ static double lfo_get_value(SimpleLFO *lfo) case SAWDOWN: val = 1 - phs * 2; break; +default: av_assert0(0); } return val * lfo->amount; @@ -207,6 +209,7 @@ static int config_input(AVFilterLink *inlink) case UNIT_BPM: freq = s->bpm / 60; break; case UNIT_MS: freq = 1 / (s->ms / 1000.); break; case UNIT_HZ: freq = s->hz; break; +default: av_assert0(0); } s->lfoL.freq = freq; -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/5] lavf/asfenc: add AVClass to context
Signed-off-by: Marton Balint --- libavformat/asfenc.c | 17 + 1 file changed, 17 insertions(+) diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 87993b6..9f082c6 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -216,6 +216,7 @@ typedef struct ASFStream { } ASFStream; typedef struct ASFContext { +AVClass *av_class; uint32_t seqno; int is_streamed; ASFStream streams[128]; ///< it's max number and it's not that big @@ -1044,6 +1045,13 @@ static int asf_write_trailer(AVFormatContext *s) } #if CONFIG_ASF_MUXER +static const AVClass asf_muxer_class = { +.class_name = "ASF muxer", +.item_name = av_default_item_name, +.option = 0, +.version= LIBAVUTIL_VERSION_INT, +}; + AVOutputFormat ff_asf_muxer = { .name = "asf", .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"), @@ -1059,10 +1067,18 @@ AVOutputFormat ff_asf_muxer = { .codec_tag = (const AVCodecTag * const []) { codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }, +.priv_class= &asf_muxer_class, }; #endif /* CONFIG_ASF_MUXER */ #if CONFIG_ASF_STREAM_MUXER +static const AVClass asf_stream_muxer_class = { +.class_name = "ASF stream muxer", +.item_name = av_default_item_name, +.option = 0, +.version= LIBAVUTIL_VERSION_INT, +}; + AVOutputFormat ff_asf_stream_muxer = { .name = "asf_stream", .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"), @@ -1078,5 +1094,6 @@ AVOutputFormat ff_asf_stream_muxer = { .codec_tag = (const AVCodecTag * const []) { codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }, +.priv_class= &asf_stream_muxer_class, }; #endif /* CONFIG_ASF_STREAM_MUXER */ -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 5/5] lavf/asfenc: add support for setting packet size
Signed-off-by: Marton Balint --- doc/muxers.texi | 20 libavformat/asf.h| 2 -- libavformat/asfenc.c | 41 + 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 4ba8883..2e6bb4c 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -37,6 +37,26 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4. @end table +@anchor{asf} +@section asf + +Advanced Systems Format muxer. + +Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this +muxer too. + +@subsection Options + +It accepts the following options: + +@table @option +@item packet_size +Set the muxer packet size. By tuning this setting you may reduce data +fragmentation or muxer overhead depending on your source. Default value is +3200, minimum is 100, maximum is 64k. + +@end table + @anchor{chromaprint} @section chromaprint diff --git a/libavformat/asf.h b/libavformat/asf.h index 1070293..914ddef 100644 --- a/libavformat/asf.h +++ b/libavformat/asf.h @@ -26,8 +26,6 @@ #include "metadata.h" #include "riff.h" -#define PACKET_SIZE 3200 - typedef enum ASFDataType { ASF_UNICODE= 0, ASF_BYTE_ARRAY = 1, diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 9c6c9cf..a6a8242 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -23,6 +23,7 @@ #include "libavutil/dict.h" #include "libavutil/mathematics.h" #include "libavutil/parseutils.h" +#include "libavutil/opt.h" #include "avformat.h" #include "avlanguage.h" #include "avio_internal.h" @@ -172,19 +173,20 @@ ASF_PAYLOAD_REPLICATED_DATA_LENGTH + \ ASF_PAYLOAD_LENGTH_FIELD_SIZE) -#define SINGLE_PAYLOAD_DATA_LENGTH\ -(PACKET_SIZE -\ - PACKET_HEADER_MIN_SIZE - \ +#define SINGLE_PAYLOAD_HEADERS\ +(PACKET_HEADER_MIN_SIZE + \ PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD) -#define MULTI_PAYLOAD_CONSTANT\ -(PACKET_SIZE -\ - PACKET_HEADER_MIN_SIZE - \ - 1 - /* Payload Flags */ \ +#define MULTI_PAYLOAD_HEADERS \ +(PACKET_HEADER_MIN_SIZE + \ + 1 + /* Payload Flags */ \ 2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS) #define DATA_HEADER_SIZE 50 +#define PACKET_SIZE_MAX 65536 +#define PACKET_SIZE_MIN 100 + typedef struct ASFPayload { uint8_t type; uint16_t size; @@ -234,7 +236,7 @@ typedef struct ASFContext { int64_t packet_timestamp_start; int64_t packet_timestamp_end; unsigned int packet_nb_payloads; -uint8_t packet_buf[PACKET_SIZE]; +uint8_t packet_buf[PACKET_SIZE_MAX]; AVIOContext pb; /* only for reading */ uint64_t data_offset;///< beginning of the first data packet @@ -247,6 +249,7 @@ typedef struct ASFContext { uint64_t next_packet_offset; int next_start_sec; int end_sec; +int packet_size; } ASFContext; static const AVCodecTag codec_asf_bmp_tags[] = { @@ -755,7 +758,7 @@ static int asf_write_header(AVFormatContext *s) { ASFContext *asf = s->priv_data; -s->packet_size = PACKET_SIZE; +s->packet_size = asf->packet_size; s->max_interleave_delta = 0; asf->nb_packets = 0; @@ -866,7 +869,7 @@ static void flush_packet(AVFormatContext *s) asf->packet_nb_payloads, asf->packet_size_left); -packet_filled_size = PACKET_SIZE - asf->packet_size_left; +packet_filled_size = asf->packet_size - asf->packet_size_left; av_assert0(packet_hdr_size <= asf->packet_size_left); memset(asf->packet_buf + packet_filled_size, 0, asf->packet_size_left); @@ -923,13 +926,14 @@ static void put_frame(AVFormatContext *s, ASFStream *stream, AVStream *avst, while (m_obj_offset < m_obj_size) { payload_len = m_obj_size - m_obj_offset; if (asf->packet_timestamp_start == -1) { -asf->multi_payloads_present = (payload_len < MULTI_PAYLOAD_CONSTANT); +const int multi_payload_constant = (asf->packet_size - MULTI_PAYLOAD_HEADERS); +asf->multi_payloads_present = (payload_len < multi_payload_constant); -asf->packet_size_left = PACKET_SIZE; +asf->packet_size_left = asf->packet_size; if (asf->multi_payloads_present) { -frag_len1 = MULTI_PAYLOAD_CONSTANT - 1; +frag_len1 = multi_payload_constant - 1; } else { -frag_len1 = SINGLE_PAYLOAD_DATA_LENGTH; +frag_len1 = asf->packet_size - SINGLE_PAYLOAD_HEADERS; } a
[FFmpeg-devel] [PATCH 2/5] lavf/asfenc: check the number of streams in header
Signed-off-by: Marton Balint --- libavformat/asfenc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 9f082c6..6932c11 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -684,6 +684,11 @@ static int asf_write_header(AVFormatContext *s) s->max_interleave_delta = 0; asf->nb_packets = 0; +if (s->nb_streams > 127) { +av_log(s, AV_LOG_ERROR, "ASF can only handle 127 streams\n"); +return AVERROR(EINVAL); +} + asf->index_ptr = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK); if (!asf->index_ptr) return AVERROR(ENOMEM); -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/5] lavf/asfenc: add support for storing languages
Signed-off-by: Marton Balint --- libavformat/asf.c| 4 +++ libavformat/asf.h| 1 + libavformat/asfenc.c | 73 +--- 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/libavformat/asf.c b/libavformat/asf.c index 80d24db..455ca4d 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -143,6 +143,10 @@ const ff_asf_guid ff_asf_digital_signature = { 0xfc, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e }; +const ff_asf_guid ff_asf_extended_stream_properties_object = { +0xcb, 0xa5, 0xe6, 0x14, 0x72, 0xc6, 0x32, 0x43, 0x83, 0x99, 0xa9, 0x69, 0x52, 0x06, 0x5b, 0x5a +}; + /* List of official tags at http://msdn.microsoft.com/en-us/library/dd743066(VS.85).aspx */ const AVMetadataConv ff_asf_metadata_conv[] = { { "WM/AlbumArtist", "album_artist" }, diff --git a/libavformat/asf.h b/libavformat/asf.h index f98fc46..1070293 100644 --- a/libavformat/asf.h +++ b/libavformat/asf.h @@ -101,6 +101,7 @@ extern const ff_asf_guid ff_asf_language_guid; extern const ff_asf_guid ff_asf_content_encryption; extern const ff_asf_guid ff_asf_ext_content_encryption; extern const ff_asf_guid ff_asf_digital_signature; +extern const ff_asf_guid ff_asf_extended_stream_properties_object; extern const AVMetadataConv ff_asf_metadata_conv[]; diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 6932c11..e2aa2e0 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -23,6 +23,7 @@ #include "libavutil/dict.h" #include "libavutil/mathematics.h" #include "avformat.h" +#include "avlanguage.h" #include "avio_internal.h" #include "internal.h" #include "riff.h" @@ -220,6 +221,8 @@ typedef struct ASFContext { uint32_t seqno; int is_streamed; ASFStream streams[128]; ///< it's max number and it's not that big +const char *languages[128]; +int nb_languages; /* non streamed additonnal info */ uint64_t nb_packets; ///< how many packets are there in the file, invalid if broadcasting int64_t duration;///< in 100ns units @@ -403,6 +406,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, bit_rate = 0; for (n = 0; n < s->nb_streams; n++) { +AVDictionaryEntry *entry; enc = s->streams[n]->codec; avpriv_set_pts_info(s->streams[n], 32, 1, 1000); /* 32 bit pts in ms */ @@ -412,6 +416,27 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, && enc->sample_aspect_ratio.num > 0 && enc->sample_aspect_ratio.den > 0) has_aspect_ratio++; + +entry = av_dict_get(s->streams[n]->metadata, "language", NULL, 0); +if (entry) { +const char *iso6391lang = av_convert_lang_to(entry->value, AV_LANG_ISO639_1); +if (iso6391lang) { +int i; +for (i = 0; i < asf->nb_languages; i++) { +if (!strcmp(asf->languages[i], iso6391lang)) { +asf->streams[n].stream_language_index = i; +break; +} +} +if (i >= asf->nb_languages) { +asf->languages[asf->nb_languages] = iso6391lang; +asf->streams[n].stream_language_index = asf->nb_languages; +asf->nb_languages++; +} +} +} else { +asf->streams[n].stream_language_index = 128; +} } if (asf->is_streamed) { @@ -441,13 +466,48 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, avio_wl32(pb, bit_rate ? bit_rate : -1); /* Maximum data rate in bps */ end_header(pb, hpos); -/* unknown headers */ +/* header_extension */ hpos = put_header(pb, &ff_asf_head1_guid); ff_put_guid(pb, &ff_asf_head2_guid); avio_wl16(pb, 6); +avio_wl32(pb, 0); /* length, to be filled later */ +if (asf->nb_languages) { +int64_t hpos2; +int i; + +hpos2 = put_header(pb, &ff_asf_language_guid); +avio_wl16(pb, asf->nb_languages); +for (i = 0; i < asf->nb_languages; i++) { +avio_w8(pb, 6); +avio_put_str16le(pb, asf->languages[i]); +} +end_header(pb, hpos2); + +for (n = 0; n < s->nb_streams; n++) { +int64_t es_pos; +if (asf->streams[n].stream_language_index > 127) +continue; +es_pos = put_header(pb, &ff_asf_extended_stream_properties_object); +avio_wl64(pb, 0); /* start time */ +avio_wl64(pb, 0); /* end time */ +avio_wl32(pb, s->streams[n]->codec->bit_rate); /* data bitrate bps */ +avio_wl32(pb, 5000); /* buffer size ms */ +avio_wl32(pb, 0); /* initial buffer fullness */ +avio_wl32(pb, s->streams[n]->codec->bit_rate); /* peak dat
[FFmpeg-devel] [PATCH 4/5] lavf/asfenc: add support for storing creation time
Signed-off-by: Marton Balint --- libavformat/asfenc.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index e2aa2e0..9c6c9cf 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -22,6 +22,7 @@ #include "libavutil/avassert.h" #include "libavutil/dict.h" #include "libavutil/mathematics.h" +#include "libavutil/parseutils.h" #include "avformat.h" #include "avlanguage.h" #include "avio_internal.h" @@ -223,6 +224,7 @@ typedef struct ASFContext { ASFStream streams[128]; ///< it's max number and it's not that big const char *languages[128]; int nb_languages; +int64_t creation_time; /* non streamed additonnal info */ uint64_t nb_packets; ///< how many packets are there in the file, invalid if broadcasting int64_t duration;///< in 100ns units @@ -309,12 +311,12 @@ static void put_chunk(AVFormatContext *s, int type, asf->seqno++; } -/* convert from unix to windows time */ -static int64_t unix_to_file_time(int ti) +/* convert from av time to windows time */ +static int64_t unix_to_file_time(int64_t ti) { int64_t t; -t = ti * INT64_C(1000); +t = ti * INT64_C(10); t += INT64_C(1164447360); return t; } @@ -383,8 +385,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; -AVDictionaryEntry *tags[5]; -int header_size, n, extra_size, extra_size2, wav_extra_size, file_time; +AVDictionaryEntry *tags[5], *t; +int header_size, n, extra_size, extra_size2, wav_extra_size; int has_title, has_aspect_ratio = 0; int metadata_count; AVCodecContext *enc; @@ -402,6 +404,15 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, duration = asf->duration + PREROLL_TIME * 1; has_title = tags[0] || tags[1] || tags[2] || tags[3] || tags[4]; + +if (!file_size && (t = av_dict_get(s->metadata, "creation_time", NULL, 0))) { +if (av_parse_time(&asf->creation_time, t->value, 0) < 0) { +av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", t->value); +asf->creation_time = 0; +} +av_dict_set(&s->metadata, "creation_time", NULL, 0); +} + metadata_count = av_dict_count(s->metadata); bit_rate = 0; @@ -454,8 +465,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, hpos = put_header(pb, &ff_asf_file_header); ff_put_guid(pb, &ff_asf_my_guid); avio_wl64(pb, file_size); -file_time = 0; -avio_wl64(pb, unix_to_file_time(file_time)); +avio_wl64(pb, unix_to_file_time(asf->creation_time)); avio_wl64(pb, asf->nb_packets); /* number of packets */ avio_wl64(pb, duration); /* end time stamp (in 100ns units) */ avio_wl64(pb, asf->duration); /* duration (in 100ns units) */ -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [FFmpeg-cvslog] lavc: Move prediction_method to codec private options
On Wed, Feb 03, 2016 at 05:49:56PM +0100, Vittorio Giovara wrote: > ffmpeg | branch: master | Vittorio Giovara | Mon > Nov 9 03:15:06 2015 +0100| [2862b63783b5556f7f3fb2d097629bc6879f833a] | > committer: Vittorio Giovara > > lavc: Move prediction_method to codec private options > > This options is only used by huffyuv, ffvhuv, jpegls, mjpeg, > mpegvideoenc, png, utvideo. > It is a very codec-specific options, so deprecate the global variant. > Set proper limits to the maximum allowed values, and update utvideoenc > tests to use the new option name. > > Signed-off-by: Vittorio Giovara > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2862b63783b5556f7f3fb2d097629bc6879f833a [...] > @@ -631,12 +638,32 @@ FF_ENABLE_DEPRECATION_WARNINGS > return 0; > } > > +#define OFFSET(x) offsetof(UtvideoContext, x) > +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM > +static const AVOption options[] = { > +{ "pred", "Prediction method", OFFSET(frame_pred), AV_OPT_TYPE_INT, { .i64 = > PRED_LEFT }, PRED_NONE, PRED_MEDIAN, VE, "pred" }, > +{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_NONE }, INT_MIN, > INT_MAX, VE, "pred" }, > +{ "left", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_LEFT }, INT_MIN, > INT_MAX, VE, "pred" }, > +{ "gradient", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_GRADIENT }, > INT_MIN, INT_MAX, VE, "pred" }, > +{ "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_MEDIAN }, > INT_MIN, INT_MAX, VE, "pred" }, > + > +{ NULL}, > +}; this breaks existing command line usage like -pred 3 and "3" previously lacked a named constant so people had to use a litteral 3 i think this change should be documented if its left that way [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/libutvideoenc: fix compiler warnings, initialize the correct type
Signed-off-by: Michael Niedermayer --- libavcodec/libutvideoenc.cpp |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp index d5dfef9..2635184 100644 --- a/libavcodec/libutvideoenc.cpp +++ b/libavcodec/libutvideoenc.cpp @@ -229,9 +229,9 @@ static av_cold int utvideo_encode_close(AVCodecContext *avctx) #define OFFSET(x) offsetof(UtVideoContext, x) #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { -{ "pred", "Prediction method", OFFSET(pred), AV_OPT_TYPE_INT, 0, 0, 2, VE, "pred" }, -{ "left", NULL, 0, AV_OPT_TYPE_CONST, 0, INT_MIN, INT_MAX, VE, "pred" }, -{ "median", NULL, 0, AV_OPT_TYPE_CONST, 2, INT_MIN, INT_MAX, VE, "pred" }, +{ "pred", "Prediction method", OFFSET(pred), AV_OPT_TYPE_INT, {i64: 0}, 0, 2, VE, "pred" }, +{ "left", NULL, 0, AV_OPT_TYPE_CONST, {i64: 0}, INT_MIN, INT_MAX, VE, "pred" }, +{ "median", NULL, 0, AV_OPT_TYPE_CONST, {i64: 2}, INT_MIN, INT_MAX, VE, "pred" }, { NULL }, }; -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavf/asfenc: add AVClass to context
On Thu, Feb 04, 2016 at 01:57:55AM +0100, Marton Balint wrote: > Signed-off-by: Marton Balint > --- > libavformat/asfenc.c | 17 + > 1 file changed, 17 insertions(+) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86/emms: run the instruction unconditionally on supported targets
On Wed, Feb 03, 2016 at 02:21:28AM -0300, James Almer wrote: > Inlined functions like AV_ZERO* and AV_COPY* may use mmx instructions > regardless of runtime cpuflags. > > Signed-off-by: James Almer > --- > On targets where __MMX__ is not defined (like default x86_32 builds) the > runtime check is a must, and neither of the above functions will use mmx > instructions anyway. > > libavutil/x86/emms.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h > index a529b6b..0deeb8c 100644 > --- a/libavutil/x86/emms.h > +++ b/libavutil/x86/emms.h > @@ -34,7 +34,9 @@ void avpriv_emms_yasm(void); > */ > static av_always_inline void emms_c(void) > { > +#if !defined(__MMX__) > if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) > +#endif should be ok, but please add a comment to the code explaining why this is done [...] -- 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 2/5] lavf/asfenc: check the number of streams in header
On Thu, Feb 04, 2016 at 01:57:56AM +0100, Marton Balint wrote: > Signed-off-by: Marton Balint > --- > libavformat/asfenc.c | 5 + > 1 file changed, 5 insertions(+) LGTM thx [...] -- 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] x86/emms: run the instruction unconditionally on supported targets
On 2/3/2016 11:57 PM, Michael Niedermayer wrote: > On Wed, Feb 03, 2016 at 02:21:28AM -0300, James Almer wrote: >> Inlined functions like AV_ZERO* and AV_COPY* may use mmx instructions >> regardless of runtime cpuflags. >> >> Signed-off-by: James Almer >> --- >> On targets where __MMX__ is not defined (like default x86_32 builds) the >> runtime check is a must, and neither of the above functions will use mmx >> instructions anyway. >> >> libavutil/x86/emms.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h >> index a529b6b..0deeb8c 100644 >> --- a/libavutil/x86/emms.h >> +++ b/libavutil/x86/emms.h >> @@ -34,7 +34,9 @@ void avpriv_emms_yasm(void); >> */ >> static av_always_inline void emms_c(void) >> { >> +#if !defined(__MMX__) >> if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) >> +#endif > > should be ok, but please add a comment to the code explaining why > this is done Done and pushed. Thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel