Re: [FFmpeg-devel] [PATCH] avcodec: add new Videotoolbox hwaccel.

2015-06-24 Thread Sebastien Zwickert

> On 20 Jun 2015, at 17:08, Hendrik Leppkes  wrote:
> 
> On Sat, Jun 20, 2015 at 1:33 PM, Sebastien Zwickert  
> wrote:
>> Old videtotoolbox patch rebased and updated to target the new HWAccel API.
>> As VDA is a wrapper of VideoToolbox framework, the changes base vda 
>> implementation
>> upon the videotoolbox implementation to factorize common part of code.
>> 
> 
> As this basically replaces the internal VDA implementation, how does
> this impact OSX version dependency?

Thanks to point me out this, the current patch is wrong because it breaks VDA 
implementation
on 10.6 and 10.7 systems. I’ll update it to solve this issue.

> From what I understand, VDA works on 10.6+. What does VT support?

10.8+

> Can
> I still build a binary that works on 10.6 upwards with VT/VDA enabled?
> 
> If not, this is an issue for me, as thats what I currently do.

Sure, I’ll provide a new patch that takes into account the OSX version 
dependencies. 

—
Sebastien Zwickert
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: add new Videotoolbox hwaccel.

2015-06-24 Thread Sebastien Zwickert

> On 20 Jun 2015, at 17:35, Clément Bœsch  wrote:
> 
> On Sat, Jun 20, 2015 at 01:33:00PM +0200, Sebastien Zwickert wrote:
>> Old videtotoolbox patch rebased and updated to target the new HWAccel API.
>> As VDA is a wrapper of VideoToolbox framework, the changes base vda 
>> implementation
>> upon the videotoolbox implementation to factorize common part of code.
>> 
>> ---
>> Changelog|   1 +
>> MAINTAINERS  |   1 +
>> Makefile |   5 +-
>> configure|  19 +-
>> ffmpeg.h |   2 +
>> ffmpeg_opt.c |   5 +-
>> ffmpeg_vda.c | 134 
>> ffmpeg_videotoolbox.c| 147 +
>> libavcodec/Makefile  |  12 +-
>> libavcodec/allcodecs.c   |   5 +
>> libavcodec/h263dec.c |   3 +
>> libavcodec/h264_slice.c  |   4 +
>> libavcodec/mpeg12dec.c   |   3 +
>> libavcodec/vda.c |   2 +-
>> libavcodec/vda_h264.c| 154 +-
>> libavcodec/vda_internal.h|  33 --
>> libavcodec/vda_vt_internal.h |  57 
>> libavcodec/version.h |   2 +-
>> libavcodec/videotoolbox.c| 705 
>> +++
>> libavcodec/videotoolbox.h| 126 
>> libavutil/pixdesc.c  |   4 +
>> libavutil/pixfmt.h   |   2 +
>> 22 files changed, 1113 insertions(+), 313 deletions(-)
>> delete mode 100644 ffmpeg_vda.c
>> create mode 100644 ffmpeg_videotoolbox.c
>> delete mode 100644 libavcodec/vda_internal.h
>> create mode 100644 libavcodec/vda_vt_internal.h
>> create mode 100644 libavcodec/videotoolbox.c
>> create mode 100644 libavcodec/videotoolbox.h
>> 
> 
> Nice, thanks a lot.
> 
> [...]
>> diff --git a/configure b/configure
>> index 3960b73..84aab50 100755
>> --- a/configure
>> +++ b/configure
>> @@ -155,6 +155,7 @@ Hardware accelerators:
>>   --disable-vaapi  disable VAAPI code [autodetect]
>>   --disable-vdadisable VDA code [autodetect]
>>   --disable-vdpau  disable VDPAU code [autodetect]
>> +  --enable-videotoolboxenable Videotoolbox code [autodetect]
>> 
> 
> --disable-videotoolboxdisable VideoToolbox code [autodetect]

Done locally.

> 
> [...]
>> diff --git a/ffmpeg_videotoolbox.c b/ffmpeg_videotoolbox.c
>> new file mode 100644
>> index 000..a2be112
>> --- /dev/null
>> +++ b/ffmpeg_videotoolbox.c
>> @@ -0,0 +1,147 @@
>> +/*
>> + * 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
>> + */
>> +
> 
> It would be nice to send the patch with -M diff option that detect
> renames…

Thanks, I’ll add this option.
> 
>> +#include "config.h"
>> +
>> +#include "libavcodec/avcodec.h"
>> +#include "libavcodec/vda.h"
>> +#include "libavcodec/videotoolbox.h"
>> +#include "libavutil/imgutils.h"
>> +
>> +#include "ffmpeg.h"
>> +
>> +typedef struct VTContext {
>> +AVFrame *tmp_frame;
>> +} VTContext;
>> +
>> +static int videotoolbox_retrieve_data(AVCodecContext *s, AVFrame *frame)
>> +{
>> +InputStream *ist = s->opaque;
>> +VTContext  *vt = ist->hwaccel_ctx;
>> +CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
>> +OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
>> +CVReturn err;
>> +uint8_t *data[4] = { 0 };
>> +int linesize[4] = { 0 };
>> +int planes, ret, i;
>> +
>> +av_frame_unref(vt->tmp_frame);
>> +
>> +switch (pixel_format) {
>> +case kCVPixelFormatType_420YpCbCr8Planar: vt->tmp_frame->format = 
>> AV_PIX_FMT_YUV420P; break;
>> +case kCVPixelFormatType_422YpCbCr8:   vt->tmp_frame->format = 
>> AV_PIX_FMT_UYVY422; break;
> 
>> +case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: 
>> vt->tmp_frame->format = AV_PIX_FMT_NV12; break;
> 
> ...It would detect the addition of such changes :)
> 
> Which brings me to the following questions:
> 
> - does this "VideoRange" means we need to set a special colorspace range?
>  (see av_frame_set_color_range())

As far I understand, there’s no need to set a special colorspace range. this 
pixel format type is standard,
it’s commented like this when defined in CVPixelBuffer.h:
// Bi-Planar Component Y'CbCr 8-bit 4:2:0, video-range (luma=[16,235] 
chroma=[16,240])

> - since there seems to exist no way of s

[FFmpeg-devel] Request for CVs (I¹m NOT from an Agency)

2015-06-24 Thread Ed Silvester
Hi,

Full-time role for FFmpeg developer, based in London.

I’m looking to hire a very specific person. I know you’re out there!   -  I 
work for a large company that streams tens of thousand of live sporting events 
a year.   We use FFmpeg in our encoding back-end and I want to strengthen this 
team with more developing resources.  The person I’m looking for will bring 
more than just his or her knowledge of FFmpeg and will be able to get involved 
in research and development of the wider video streaming and encoding related 
requirements of a large enterprise.  You’re going to need to know your onions, 
be prepared to prove it,  be based in London and be legally entitled to work 
here already.

If you’d like to know more please send your CV to me 
ed.silves...@performgroup.com and I will send a job description to you, if I 
think you could fit the bill.

Thanks.



CONFIDENTIALITY - This email and any files transmitted with it, are 
confidential, may be legally privileged and are intended solely for the use of 
the individual or entity to whom they are addressed. If this has come to you in 
error, you must not copy, distribute, disclose or use any of the information it 
contains. Please notify the sender immediately and delete them from your system.

SECURITY - Please be aware that communication by email, by its very nature, is 
not 100% secure and by communicating with Perform Group by email you consent to 
us monitoring and reading any such correspondence.

VIRUSES - Although this email message has been scanned for the presence of 
computer viruses, the sender accepts no liability for any damage sustained as a 
result of a computer virus and it is the recipient’s responsibility to ensure 
that email is virus free.

AUTHORITY - Any views or opinions expressed in this email are solely those of 
the sender and do not necessarily represent those of Perform Group.

COPYRIGHT - Copyright of this email and any attachments belongs to Perform 
Group, Companies House Registration number 6324278.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/matroskaenc: fix crash on empty H.264 packets

2015-06-24 Thread Rodger Combs
Fixes:
ffmpeg -i https://dl.dropboxusercontent.com/u/105828/sample%20crash%20file.mkv \
-bsf:v h264_mp4toannexb -c copy -y -f matroska /dev/null

Not 100% sure if this is the best place to do this.
---
 libavformat/matroskaenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 3b525ad..37d9caa 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1568,7 +1568,8 @@ static void mkv_write_block(AVFormatContext *s, 
AVIOContext *pb,
avio_tell(pb), pkt->size, pkt->pts, pkt->dts, pkt->duration,
keyframe != 0);
 if (codec->codec_id == AV_CODEC_ID_H264 && codec->extradata_size > 0 &&
-(AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
+(AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1) &&
+pkt->data)
 ff_avc_parse_nal_units_buf(pkt->data, &data, &size);
 else if (codec->codec_id == AV_CODEC_ID_HEVC && codec->extradata_size > 6 
&&
  (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 
1))
-- 
2.4.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Support Ctrl+Break in ffmpeg.exe on Windows as if it was Ctrl+C

2015-06-24 Thread Roger Pack
On 7/5/12, Michael Niedermayer  wrote:
> On Mon, Jun 25, 2012 at 02:21:21PM +0200, Michael Niedermayer wrote:
>> On Tue, Jun 19, 2012 at 07:10:04PM +0200, Reimar Döffinger wrote:
>> > On 19 Jun 2012, at 11:31, Joe Wreschnig 
>> > wrote:
>> > > On Windows, the Ctrl+Break key combination usually does what Ctrl+C
>> > > does. It is more common for processes to send other processes
>> > > Ctrl+Break rather than Ctrl+C, because sending Ctrl+C / SIGINT
>> > > doesn't
>> > > work if you started a child in a new process group.
>> > >
>> > > This patch makes ffmpeg.exe register what Windows calls a console
>> > > control event handler, which allows it to intercept Ctrl+Break. It
>> > > hands it off directly to the usual SIGINT/SIGTERM handler. The same
>> > > function also processes closing the console window, mapping it to
>> > > SIGTERM.
>> > >
>> > > Obviously, this is only enabled if compiling for a platform where
>> > > SetConsoleCtrlHandler is available (i.e. modern Windows).
>> >
>> > What is "modern"? Also it is rather unusual to recompile for different
>> > Windows versions, couldn't you with about the same effort just use
>> > GetProcAddress (more complex code, but in exchange you'd save on all the
>> > configure changes and #ifs).
>>
>> It seems versions that dont support this are no longer supported
>> by microsoft. IMHO we shouldnt bother too much with such old windows
>> versions unless someone wants to / volunteers to do it.
>>
>> thus, if there are no objections i will apply this patch once a few
>> minor issues are fixed (ifdef breaking compile to be precisse)
>
> iam waiting for a working patch
> i could try to fix it before applying myself but with patches for
> non linux platforms i prefer to avoid changing as the changes would
> be untested ,..

Sorry I dropped the ball on this one.
See attached.  The major gains we get out of this (in my head at
least) is hopefully better shutdown if somebody logs out (which has
bitten me before).  Or if someone closes a console window which also
shuts down FFmpeg.

I noticed that even with handling notifications of "logout" that
ffmpeg can still easily leave behind corrupted mp4 files (it gets
killed quickly after).
Makes me wonder if there's some way to make it shutdown more quickly,
but I'm not sure if it's a problem yet or not.
Cheers!
-roger-


0001-windows-respond-to-logoff-and-ctrl-break-messages.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] patch: log when hard exiting from too many signals.

2015-06-24 Thread Roger Pack
If it looks worth anything, see attached (there's only one file).
Thanks!


0002-log-error-message-when-shutting-down-from-too-many-s.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] verbiage

2015-06-24 Thread Roger Pack
Hello again.
I was thinking this text:

Received signal %d: terminating.

Today sounds as if the process is "hard exiting" (like SIGKILL or some
odd) when it might be as benign as a ctrl+c that is used as a normal
shutdown process.

Perhaps it could be made to be something like:

Shutting down because received signal %d

To avoid confusion? (If no response I'll submit a patch with the same).
Cheers!
-roger-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] patch: log when hard exiting from too many signals.

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 04:28:22AM -0600, Roger Pack wrote:
> If it looks worth anything, see attached (there's only one file).
> Thanks!

>  ffmpeg.c |4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 76e781dafd7324903c7cc08dbf297bd95841126c  
> 0002-log-error-message-when-shutting-down-from-too-many-s.patch
> From dad4f89ec0dc5bdeaeb1923e159fa12655bdde7a Mon Sep 17 00:00:00 2001
> From: rogerdpack 
> Date: Wed, 24 Jun 2015 04:26:26 -0600
> Subject: [PATCH 2/2] log error message when shutting down from too many
>  signals
> 
> Signed-off-by: rogerdpack 
> ---
>  ffmpeg.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 720e105..6aa5d1b 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -324,8 +324,10 @@ sigterm_handler(int sig)
>  received_sigterm = sig;
>  received_nb_signals++;
>  term_exit_sigsafe();
> -if(received_nb_signals > 3)
> +if(received_nb_signals > 3){

> +av_log(NULL, AV_LOG_ERROR, "Received %d shutdown signals, hard 
> exiting.", received_nb_signals);

i think its better to use fprintf(stderr,...
here instead of av_log()

when things are already stuck for some reason staying with the
simpler, lower level code seems more robust to me

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] patch: log when hard exiting from too many signals.

2015-06-24 Thread wm4
On Wed, 24 Jun 2015 13:04:27 +0200
Michael Niedermayer  wrote:

> On Wed, Jun 24, 2015 at 04:28:22AM -0600, Roger Pack wrote:
> > If it looks worth anything, see attached (there's only one file).
> > Thanks!
> 
> >  ffmpeg.c |4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 76e781dafd7324903c7cc08dbf297bd95841126c  
> > 0002-log-error-message-when-shutting-down-from-too-many-s.patch
> > From dad4f89ec0dc5bdeaeb1923e159fa12655bdde7a Mon Sep 17 00:00:00 2001
> > From: rogerdpack 
> > Date: Wed, 24 Jun 2015 04:26:26 -0600
> > Subject: [PATCH 2/2] log error message when shutting down from too many
> >  signals
> > 
> > Signed-off-by: rogerdpack 
> > ---
> >  ffmpeg.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index 720e105..6aa5d1b 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -324,8 +324,10 @@ sigterm_handler(int sig)
> >  received_sigterm = sig;
> >  received_nb_signals++;
> >  term_exit_sigsafe();
> > -if(received_nb_signals > 3)
> > +if(received_nb_signals > 3){
> 
> > +av_log(NULL, AV_LOG_ERROR, "Received %d shutdown signals, hard 
> > exiting.", received_nb_signals);
> 
> i think its better to use fprintf(stderr,...
> here instead of av_log()
> 
> when things are already stuck for some reason staying with the
> simpler, lower level code seems more robust to me
> 
> [...]
> 

Neither av_log not printf() are safe in a signal handler.

You could use write().
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] verbiage

2015-06-24 Thread compn
On Wed, 24 Jun 2015 04:30:10 -0600
Roger Pack  wrote:

> Received signal %d: terminating.
> 
> Today sounds as if the process is "hard exiting" (like SIGKILL or some
> odd) when it might be as benign as a ctrl+c that is used as a normal
> shutdown process.
> 
> Perhaps it could be made to be something like:
> 
> Shutting down because received signal %d

ffmpeg exiting normally, received signal %d

?

-compn
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/matroskaenc: fix crash on empty H.264 packets

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 04:21:15AM -0500, Rodger Combs wrote:
> Fixes:
> ffmpeg -i 
> https://dl.dropboxusercontent.com/u/105828/sample%20crash%20file.mkv \
> -bsf:v h264_mp4toannexb -c copy -y -f matroska /dev/null
> 

> Not 100% sure if this is the best place to do this.

fixed differently

Thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/evrc: make it possible to disable postfilter

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 06:05:38AM +, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/evrcdec.c | 29 ++---
>  1 file changed, 26 insertions(+), 3 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


[FFmpeg-devel] [PATCH] lavc/adpcm: THP: set approx_nb_samples correctly

2015-06-24 Thread Rodger Combs
---
 libavcodec/adpcm.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index bad0be4..2dac23b 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -654,11 +654,9 @@ static int get_nb_samples(AVCodecContext *avctx, 
GetByteContext *gb,
 buf_size   -= 8 + 36 * ch;
 buf_size   /= ch;
 nb_samples  = buf_size / 8 * 14;
-if (buf_size % 8 > 1) {
+if (buf_size % 8 > 1)
 nb_samples += (buf_size % 8 - 1) * 2;
-if (*coded_samples & 1)
-nb_samples -= 1;
-}
+*approx_nb_samples = 1;
 break;
 case AV_CODEC_ID_ADPCM_AFC:
 nb_samples = buf_size / (9 * ch) * 16;
-- 
2.4.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: add ssim filter

2015-06-24 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 Changelog|   1 +
 doc/filters.texi |  58 +++
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_ssim.c| 399 +++
 5 files changed, 460 insertions(+)
 create mode 100644 libavfilter/vf_ssim.c

diff --git a/Changelog b/Changelog
index 3f240f0..6d86562 100644
--- a/Changelog
+++ b/Changelog
@@ -7,6 +7,7 @@ version :
 - little-endian ADPCM_THP decoder
 - Hap decoder and encoder
 - DirectDraw Surface image/texture decoder
+- ssim filter
 
 
 version 2.7:
diff --git a/doc/filters.texi b/doc/filters.texi
index 82e23c8..d9f913f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8834,6 +8834,64 @@ in [-30,0] will filter edges. Default value is 0.
 If a chroma option is not explicitly set, the corresponding luma value
 is set.
 
+@section ssim
+
+Obtain the SSIM (Structural SImilarity Metric) between two input videos.
+
+This filter takes in input two input videos, the first input is
+considered the "main" source and is passed unchanged to the
+output. The second input is used as a "reference" video for computing
+the SSIM.
+
+Both video inputs must have the same resolution and pixel format for
+this filter to work correctly. Also it assumes that both inputs
+have the same number of frames, which are compared one by one.
+
+The filter stores the calculated SSIM of each frame.
+
+The description of the accepted parameters follows.
+
+@table @option
+@item stats_file, f
+If specified the filter will use the named file to save the PSNR of
+each individual frame.
+@end table
+
+The file printed if @var{stats_file} is selected, contains a sequence of
+key/value pairs of the form @var{key}:@var{value} for each compared
+couple of frames.
+
+A description of each shown parameter follows:
+
+@table @option
+@item n
+sequential number of the input frame, starting from 1
+
+@item Y, U, V, R, G, B
+SSIM of the compared frames for the component specified by the suffix.
+
+@item All
+SSIM of the compared frames for the whole frame.
+
+@item dB
+Same as above but in dB representation.
+@end table
+
+For example:
+@example
+movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
+[main][ref] ssim="stats_file=stats.log" [out]
+@end example
+
+On this example the input file being processed is compared with the
+reference file @file{ref_movie.mpg}. The SSIM of each individual frame
+is stored in @file{stats.log}.
+
+Another example with both psnr and ssim at same time:
+@example
+ffmpeg -i main.mpg -i ref.mpg -lavfi  "ssim;[0:v][1:v]psnr" -f null -
+@end example
+
 @section stereo3d
 
 Convert between different stereoscopic image formats.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index fc9f455..55cd055 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -197,6 +197,7 @@ OBJS-$(CONFIG_SIGNALSTATS_FILTER)+= 
vf_signalstats.o
 OBJS-$(CONFIG_SMARTBLUR_FILTER)  += vf_smartblur.o
 OBJS-$(CONFIG_SPLIT_FILTER)  += split.o
 OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o
+OBJS-$(CONFIG_SSIM_FILTER)   += vf_ssim.o dualinput.o 
framesync.o
 OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
 OBJS-$(CONFIG_SUBTITLES_FILTER)  += vf_subtitles.o
 OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 415ed1b..3898498 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -212,6 +212,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(SMARTBLUR,  smartblur,  vf);
 REGISTER_FILTER(SPLIT,  split,  vf);
 REGISTER_FILTER(SPP,spp,vf);
+REGISTER_FILTER(SSIM,   ssim,   vf);
 REGISTER_FILTER(STEREO3D,   stereo3d,   vf);
 REGISTER_FILTER(SUBTITLES,  subtitles,  vf);
 REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
new file mode 100644
index 000..604fb44
--- /dev/null
+++ b/libavfilter/vf_ssim.c
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2003-2013 Loren Merritt
+ * 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, M

Re: [FFmpeg-devel] [PATCH] avfilter: add ssim filter

2015-06-24 Thread Ronald S. Bultje
Hi,

On Wed, Jun 24, 2015 at 9:21 AM, Paul B Mahol  wrote:

> Signed-off-by: Paul B Mahol 
> ---
>  Changelog|   1 +
>  doc/filters.texi |  58 +++
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/vf_ssim.c| 399
> +++
>  5 files changed, 460 insertions(+)
>  create mode 100644 libavfilter/vf_ssim.c


LGTM!

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf: set is_connected flag so url can be properly closed

2015-06-24 Thread Michael Niedermayer
On Tue, Jun 23, 2015 at 03:35:16AM +0200, Mariusz Szczepańczyk wrote:
> ---
>  libavformat/avio.c | 1 +
>  1 file changed, 1 insertion(+)

applied

thanks

[...]
-- 
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] electronicarts: demux alpha stream

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 12:31:56AM +1000, Peter Ross wrote:
> .vp6 files may contain two video streams: one for the primary video
> stream and another for the alpha mask. The file format uses identical
> data structures for both streams.
> 
> Signed-off-by: Peter Ross 
> ---
>  libavformat/electronicarts.c | 136 
> +--
>  1 file changed, 80 insertions(+), 56 deletions(-)
> 
> diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
> index d999a0b..1c35e2d 100644
> --- a/libavformat/electronicarts.c
> +++ b/libavformat/electronicarts.c
> @@ -59,18 +59,25 @@
>  #define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
>  #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
>  #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
> +#define AVhd_TAG MKTAG('A', 'V', 'h', 'd')
> +#define AV0K_TAG MKTAG('A', 'V', '0', 'K')
> +#define AV0F_TAG MKTAG('A', 'V', '0', 'F')
>  #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')  /* CMV header */
>  #define MVIf_TAG MKTAG('M', 'V', 'I', 'f')  /* CMV I-frame */
>  #define AVP6_TAG MKTAG('A', 'V', 'P', '6')
>  
> -typedef struct EaDemuxContext {
> -int big_endian;
> -
> -enum AVCodecID video_codec;
> +typedef struct VideoProperties {
> +enum AVCodecID codec;
>  AVRational time_base;
>  int width, height;
>  int nb_frames;
> -int video_stream_index;
> +int stream_index;
> +} VideoProperties;
> +
> +typedef struct EaDemuxContext {
> +int big_endian;
> +
> +VideoProperties video, alpha;
>  
>  enum AVCodecID audio_codec;
>  int audio_stream_index;

can you split the changes that are due to the
VideoProperties/EaDemuxContext change from  the alpha stuff ?
that would make the then 2 commits more readable

also is there a sample/testcase available for this ?

Thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Support Ctrl+Break in ffmpeg.exe on Windows as if it was Ctrl+C

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 04:19:38AM -0600, Roger Pack wrote:
> On 7/5/12, Michael Niedermayer  wrote:
> > On Mon, Jun 25, 2012 at 02:21:21PM +0200, Michael Niedermayer wrote:
> >> On Tue, Jun 19, 2012 at 07:10:04PM +0200, Reimar Döffinger wrote:
> >> > On 19 Jun 2012, at 11:31, Joe Wreschnig 
> >> > wrote:
> >> > > On Windows, the Ctrl+Break key combination usually does what Ctrl+C
> >> > > does. It is more common for processes to send other processes
> >> > > Ctrl+Break rather than Ctrl+C, because sending Ctrl+C / SIGINT
> >> > > doesn't
> >> > > work if you started a child in a new process group.
> >> > >
> >> > > This patch makes ffmpeg.exe register what Windows calls a console
> >> > > control event handler, which allows it to intercept Ctrl+Break. It
> >> > > hands it off directly to the usual SIGINT/SIGTERM handler. The same
> >> > > function also processes closing the console window, mapping it to
> >> > > SIGTERM.
> >> > >
> >> > > Obviously, this is only enabled if compiling for a platform where
> >> > > SetConsoleCtrlHandler is available (i.e. modern Windows).
> >> >
> >> > What is "modern"? Also it is rather unusual to recompile for different
> >> > Windows versions, couldn't you with about the same effort just use
> >> > GetProcAddress (more complex code, but in exchange you'd save on all the
> >> > configure changes and #ifs).
> >>
> >> It seems versions that dont support this are no longer supported
> >> by microsoft. IMHO we shouldnt bother too much with such old windows
> >> versions unless someone wants to / volunteers to do it.
> >>
> >> thus, if there are no objections i will apply this patch once a few
> >> minor issues are fixed (ifdef breaking compile to be precisse)
> >
> > iam waiting for a working patch
> > i could try to fix it before applying myself but with patches for
> > non linux platforms i prefer to avoid changing as the changes would
> > be untested ,..
> 
> Sorry I dropped the ball on this one.
> See attached.  The major gains we get out of this (in my head at
> least) is hopefully better shutdown if somebody logs out (which has
> bitten me before).  Or if someone closes a console window which also
> shuts down FFmpeg.
> 
> I noticed that even with handling notifications of "logout" that
> ffmpeg can still easily leave behind corrupted mp4 files (it gets
> killed quickly after).

> Makes me wonder if there's some way to make it shutdown more quickly,
> but I'm not sure if it's a problem yet or not.

iam not sure i understand ?
does windows kill the process immedeatly after CtrlHandler() returns?
if so CtrlHandler() should wait for the main loop to exit and cleanup
finishing before it returns

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] fate/api-tests: Move api-flac-test to API tests directory.

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 02:27:32AM +0100, George Boyle wrote:
> ---
>  libavcodec/Makefile|   2 -
>  libavcodec/api-flac-test.c | 266 
> -
>  tests/Makefile |   1 +
>  tests/api/Makefile |   3 +
>  tests/api/api-flac-test.c  | 266 
> +
>  tests/fate/api.mak |   8 ++
>  tests/fate/libavcodec.mak  |   6 -
>  7 files changed, 278 insertions(+), 274 deletions(-)
>  delete mode 100644 libavcodec/api-flac-test.c
>  create mode 100644 tests/api/api-flac-test.c
>  create mode 100644 tests/fate/api.mak

this seems not fully working:

./configure  --progs-suffix=abc --build-suffix=def > /dev/null
make -j12 testprogs > /dev/null

tests/api/Makefile:8: target `tests/api/api-flac-test' doesn't match the target 
pattern
tests/api/Makefile:8: target `tests/api/api-flac-test' doesn't match the target 
pattern

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vp9: fix profile check for intraonly frames.

2015-06-24 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 9d9326c..3ad9056 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -594,7 +594,7 @@ static int decode_frame_header(AVCodecContext *ctx,
 av_log(ctx, AV_LOG_ERROR, "Invalid sync code\n");
 return AVERROR_INVALIDDATA;
 }
-if (ctx->profile == 1) {
+if (ctx->profile >= 1) {
 if ((fmt = read_colorspace_details(ctx)) < 0)
 return fmt;
 } else {
-- 
2.1.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat: Add H264 API test

2015-06-24 Thread Ludmila Glinskih
Hi!

вт, 23 июня 2015 г. в 16:21, Ronald S. Bultje :

> Hi,
>
> On Tue, Jun 23, 2015 at 9:05 AM, Ludmila Glinskih 
> wrote:
>
> > +do {
> > +if (pkt.stream_index != video_stream)
> > +break;
>
>
> That check shouldn't be necessary for the last frame. Sorry for missing
> that on the first iteration.
>

Explain me, please, why it's not necessary?


> Ronald
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCHv3] libavformat: Add H264 API test

2015-06-24 Thread Ludmila Glinskih
I added av_find_best_stream() and changed libavformat.mak, because previous 
version failed without samples.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat: Add H264 API test

2015-06-24 Thread Ludmila Glinskih
Result differs in pkt_duration and time_base.den for some reason.
Right now it tests only one example (adjusted to match the output).

Signed-off-by: Ludmila Glinskih 
---
 libavformat/Makefile|   1 +
 libavformat/api-h264-test.c | 183 
 tests/fate/libavformat.mak  |   4 +
 tests/ref/fate/api-h264 |  18 +
 4 files changed, 206 insertions(+)
 create mode 100644 libavformat/api-h264-test.c
 create mode 100644 tests/ref/fate/api-h264

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 993ec09..5cc0f6c 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -547,6 +547,7 @@ TESTPROGS = seek
\
 url \
 
 TESTPROGS-$(CONFIG_NETWORK)  += noproxy
+TESTPROGS-yes  += api-h264
 TESTPROGS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh
 
 TOOLS = aviocat \
diff --git a/libavformat/api-h264-test.c b/libavformat/api-h264-test.c
new file mode 100644
index 000..784cdd9
--- /dev/null
+++ b/libavformat/api-h264-test.c
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2015 Ludmila Glinskih
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * H264 codec test.
+ */
+
+#include "libavutil/adler32.h"
+#include "libavcodec/avcodec.h"
+#include "libavformat/avformat.h"
+#include "libavutil/imgutils.h"
+
+static int video_decode_example(const char *input_filename)
+{
+AVCodec *codec = NULL;
+AVCodecContext *origin_ctx = NULL, *ctx= NULL;
+AVFrame *fr = NULL;
+uint8_t *byte_buffer = NULL;
+AVPacket pkt;
+AVFormatContext *fmt_ctx = NULL;
+int number_of_written_bytes;
+int video_stream;
+int get_frame = 0;
+int byte_buffer_size;
+int i = 0;
+int result;
+
+result = avformat_open_input(&fmt_ctx, input_filename, NULL, NULL);
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't open file\n");
+return result;
+}
+
+result = avformat_find_stream_info(fmt_ctx, NULL);
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't get stream info\n");
+return result;
+}
+
+video_stream = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, 
NULL, 0);
+if (video_stream < 0) {
+  av_log(NULL, AV_LOG_ERROR, "Can't find video stream in input file\n");
+  return -1;
+}
+
+origin_ctx = fmt_ctx->streams[video_stream]->codec;
+
+codec = avcodec_find_decoder(origin_ctx->codec_id);
+if (!codec) {
+av_log(NULL, AV_LOG_ERROR, "Can't find decoder\n");
+return -1;
+}
+
+ctx = avcodec_alloc_context3(codec);
+if (!ctx) {
+av_log(NULL, AV_LOG_ERROR, "Can't allocate decoder context\n");
+return AVERROR(ENOMEM);
+}
+
+result = avcodec_copy_context(ctx, origin_ctx);
+if (result) {
+av_log(NULL, AV_LOG_ERROR, "Can't copy decoder context\n");
+return result;
+}
+
+result = avcodec_open2(ctx, codec, NULL);
+if (result < 0) {
+av_log(ctx, AV_LOG_ERROR, "Can't open decoder\n");
+return result;
+}
+
+fr = av_frame_alloc();
+if (!fr) {
+av_log(NULL, AV_LOG_ERROR, "Can't allocate frame\n");
+return AVERROR(ENOMEM);
+}
+
+byte_buffer_size = av_image_get_buffer_size(ctx->pix_fmt, ctx->width, 
ctx->height, 16);
+byte_buffer = av_malloc(byte_buffer_size);
+if (!byte_buffer) {
+av_log(NULL, AV_LOG_ERROR, "Can't allocate buffer\n");
+return AVERROR(ENOMEM);
+}
+
+printf("#tb %d: %d/%d\n", video_stream, 
fmt_ctx->streams[video_stream]->time_base.num, 
fmt_ctx->streams[video_stream]->time_base.den);
+i = 0;
+av_init_packet(&pkt);
+while (av_read_frame(fmt_ctx, &pkt) >= 0) {
+if (pkt.stream_index == video_stream) {
+get_frame = 0;
+if (pkt

Re: [FFmpeg-devel] [PATCH] libavformat: Add H264 API test

2015-06-24 Thread Ronald S. Bultje
Hi,

On Wed, Jun 24, 2015 at 11:45 AM, Ludmila Glinskih 
wrote:

> вт, 23 июня 2015 г. в 16:21, Ronald S. Bultje :
> > On Tue, Jun 23, 2015 at 9:05 AM, Ludmila Glinskih 
> > wrote:
> >
> > > +do {
> > > +if (pkt.stream_index != video_stream)
> > > +break;
> >
> >
> > That check shouldn't be necessary for the last frame. Sorry for missing
> > that on the first iteration.
>
> Explain me, please, why it's not necessary?


Because the packet didn't come from the demuxer, you created it yourself.
If the last packet from the demuxer had a different stream_id, it means you
wouldn't flush at all.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] fix reference quicktime movie reading

2015-06-24 Thread Maksym Veremeyenko

Hi,

i noticed that ffmpeg from latest git stop decoding all reference mov files:


[root@dev-5 data]# ffmpeg -debug 3 -i BNC123914.mov -y q.mp4
ffmpeg version N-73128-g5a1f785 Copyright (c) 2000-2015 the FFmpeg 
developers

  built with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
  configuration: --prefix=/usr/local/enctools --enable-debug=3 
--extra-cflags='-O0 -ggdb -I/usr/local/enctools/include' 
--extra-ldflags=-L/usr/local/enctools/lib --enable-shared --enable-gpl 
--enable-version3 --enable-nonfree --enable-avfilter --enable-pthreads 
--enable-bzlib --enable-zlib --enable-libfaac --enable-libmp3lame 
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 
--enable-libxvid --enable-libfreetype --disable-stripping

  libavutil  54. 27.100 / 54. 27.100
  libavcodec 56. 44.101 / 56. 44.101
  libavformat56. 38.101 / 56. 38.101
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 18.100 /  5. 18.100
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc53.  3.100 / 53.  3.100
 matched as AVOption 'debug' with argument '3'.
Reading option '-i' ... matched as input file with argument 'BNC123914.mov'.
Reading option '-y' ... matched as option 'y' (overwrite output files) 
with argument '1'.

Reading option 'q.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file BNC123914.mov.
Successfully parsed a group of options.
Opening an input file: BNC123914.mov.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Format mov,mp4,m4a,3gp,3g2,mj2 
probed with size=2048 and score=50

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] volume f, len 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] filename BNC123914.dv, len 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] nlvl from 1, nlvl to 2
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 0, len 9
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] dir media.dir
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 2, len 73
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] path 
/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 11, len 5
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type -1, len 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Absolute path 
/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv 
not tried for security reasons, set demuxer option use_absolute_path to 
allow absolute paths
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] stream 0, error opening alias: 
path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv', 
dir='media.dir', filename='BNC123914.dv', volume='f', nlvl_from=1, nlvl_to=2

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] volume f, len 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] filename BNC123914.aiff, len 14
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] nlvl from 1, nlvl to 2
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 0, len 9
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] dir media.dir
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 2, len 75
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] path 
/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 11, len 5
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type -1, len 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Absolute path 
/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff 
not tried for security reasons, set demuxer option use_absolute_path to 
allow absolute paths
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] stream 1, error opening alias: 
path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff', 
dir='media.dir', filename='BNC123914.aiff', volume='f', nlvl_from=1, 
nlvl_to=2
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Before avformat_find_stream_info() 
pos: 14936 bytes read:14936 seeks:0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Could not find codec parameters 
for stream 0 (Video: dvvideo, 1 reference frame (dvcp / 0x70637664), 
none(topleft), 720x576, 1/600, 28800 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' 
options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] After avformat_find_stream_info() 
pos: 14936 bytes read:14936 seeks:0 frames:0

Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BNC123914.mov':
  Metadata:
creation_time   : 2015-06-16 12:10:52
encoder : Omneon OmMedia.dll 4.7.0 05-18-2007 
18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
encoder-eng : Omneon OmMedia.dll 4.7.0 05-18-2007 
18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre

  Duration: 00:00:30.00, bitrate: 3 kb/s
Stream #0:0(eng), 0, 1/600: Video: dvvideo, 1 reference frame (dvcp 
/ 0x70637664), none(topleft), 720x576, 1/600, 28800 kb/s, 25 fps, 25 
tbr, 600 tbn, 600 tbc (default)

Metadata:
  creation_time   : 2015-06-16 12:11:12
  handler_name: Apple Alia

[FFmpeg-devel] GSoC Weekly Report (libswscale refactor)

2015-06-24 Thread Pedro Arthur
Hi,

I'm working on the libswscale refactoring and Michael advised me to send
the changes to the
mailing list so that I can get more feedback about it. Thus I added the
references [1] - [7] which
are links to commits on my github fork of FFmpeg.

Last week I wrote the horizontal chroma scaling (patches [3]-[7]) code and
spent some time
ensuring it passes all tests.


As we are approaching the midterm I'll also present my scheduling plans.

   - Line pool allocator for SwsSlice
   - Implement ring buffer logic into SwsSlice
   - Implement horizontal scaling (refactor)
   - Implement vertical scaling (refactor)
   - Measure refactor performance/overhead
   - Document new code

The horizontal scaling is already working. I did some tests and initially
the overhead of the new
code is ~3% (measured only in the modified scaling code) which should be
almost 0% for total
program time execution.

For the next week (or 2) I plan to implement the line pool allocator and
the ring buffer logic.

Besides the scheduling list, with the new scaling design I think it is
possible to remove the need
for cascade SwsContexts and also work on some kind of parallelization of
the scaling code. These I should work after finishing the scheduling.

[1] 7efb0fae8ed52b6f841d70c4d8981399da42e7bd

[2] 0b955f28ab1cbba5188e0cbd44c250dc5b526d53

[3] b577b4d388743e6f90f54e65fdb8edddbeaf17de

[4] f83a83e8ab97e0fcab2248e828d4fb5433e8bcfe

[5] eaf6de8606b698baaeda1ecb9493a240d5b828e9

[6] b949d895da80979d44f6525de3a3f9a98118a0a6

[7] 353d20df59075d442e943f00c7fcb8bc7784089b

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [RFC] [WIP] [PATCH] lavfi: add drawgraph filter

2015-06-24 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
Example:

ffplay movie.webm -vf 
signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255:mode=0

---
 libavfilter/Makefile   |   1 +
 libavfilter/allfilters.c   |   1 +
 libavfilter/vf_drawgraph.c | 186 +
 3 files changed, 188 insertions(+)
 create mode 100644 libavfilter/vf_drawgraph.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 55cd055..54a8bbb 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -117,6 +117,7 @@ OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
 OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
 OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
+OBJS-$(CONFIG_DRAWGRAPH_FILTER)  += vf_drawgraph.o
 OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
 OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o
 OBJS-$(CONFIG_ELBG_FILTER)   += vf_elbg.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 3898498..b9508f5 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -133,6 +133,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(DESHAKE,deshake,vf);
 REGISTER_FILTER(DETELECINE, detelecine, vf);
 REGISTER_FILTER(DRAWBOX,drawbox,vf);
+REGISTER_FILTER(DRAWGRAPH,  drawgraph,  vf);
 REGISTER_FILTER(DRAWGRID,   drawgrid,   vf);
 REGISTER_FILTER(DRAWTEXT,   drawtext,   vf);
 REGISTER_FILTER(EDGEDETECT, edgedetect, vf);
diff --git a/libavfilter/vf_drawgraph.c b/libavfilter/vf_drawgraph.c
new file mode 100644
index 000..3c9eed8
--- /dev/null
+++ b/libavfilter/vf_drawgraph.c
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "float.h"
+
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct DrawGraphContext {
+const AVClass *class;
+
+char  *key;
+float min;
+float max;
+uint8_t   bg[4];
+uint8_t   fg[4];
+int   mode;
+int   slide;
+
+AVFrame   *out;
+int   x;
+} DrawGraphContext;
+
+#define OFFSET(x) offsetof(DrawGraphContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption drawgraph_options[] = {
+{ "metadata", "set metadata key", OFFSET(key), AV_OPT_TYPE_STRING, 
{.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
+{ "min", "set minimal value", OFFSET(min), AV_OPT_TYPE_FLOAT, {.dbl=-1.}, 
INT_MIN, INT_MAX, FLAGS },
+{ "max", "set maximal value", OFFSET(max), AV_OPT_TYPE_FLOAT, {.dbl=1.},  
INT_MIN, INT_MAX, FLAGS },
+{ "background", "set background color", OFFSET(bg), AV_OPT_TYPE_COLOR, 
{.str="white"},  CHAR_MIN, CHAR_MAX, FLAGS },
+{ "foreground", "set foreground color", OFFSET(fg), AV_OPT_TYPE_COLOR, 
{.str="blue"},   CHAR_MIN, CHAR_MAX, FLAGS },
+{ "mode", "set graph mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, 
FLAGS },
+{ "slide", "set slide mode", OFFSET(slide), AV_OPT_TYPE_INT, {.i64=0}, 0, 
1, FLAGS },
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(drawgraph);
+
+static int query_formats(AVFilterContext *ctx)
+{
+static const enum AVPixelFormat pix_fmts[] = {
+AV_PIX_FMT_GBRP,
+AV_PIX_FMT_NONE
+};
+AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+if (!fmts_list)
+return AVERROR(ENOMEM);
+return ff_set_common_formats(ctx, fmts_list);
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+AVFilterContext *ctx = inlink->dst;
+DrawGraphContext *s = ctx->priv;
+AVFilterLink *outlink = ctx->outputs[0];
+AVDictionary *metadata;
+AVDictionaryEntry *e;
+AVFrame *out = s->out;
+int i, j;
+float vf;
+int vd;
+
+if (!s->out || s->out->width  != outlink->w ||
+   s->out->height != outlink->h) {
+av_frame_free(&s->out);
+s->out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+out = s->out;
+if (!s->out) {
+

Re: [FFmpeg-devel] [PATCH 2/2] libvpxdec: report colorspace

2015-06-24 Thread James Zern
On Tue, Jun 23, 2015 at 4:19 PM, Ronald S. Bultje  wrote:
> Hi,
>
> On Tue, Jun 23, 2015 at 6:21 PM, James Zern  wrote:
>
>> ---
>>  libavcodec/libvpxdec.c | 7 +++
>>  1 file changed, 7 insertions(+)
>
>
> sgtm.
>

applied
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] GSoC Weekly Report (libswscale refactor)

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 02:41:54PM -0300, Pedro Arthur wrote:
> Hi,
> 
> I'm working on the libswscale refactoring and Michael advised me to send
> the changes to the
> mailing list so that I can get more feedback about it. Thus I added the
> references [1] - [7] which
> are links to commits on my github fork of FFmpeg.
> 
> Last week I wrote the horizontal chroma scaling (patches [3]-[7]) code and
> spent some time
> ensuring it passes all tests.

it passes fate but seems to crash for example with:
./ffmpeg -i lena.pnm  -vf format=gbrp test.avi


> 
> 
> As we are approaching the midterm I'll also present my scheduling plans.
> 
>- Line pool allocator for SwsSlice
>- Implement ring buffer logic into SwsSlice
>- Implement horizontal scaling (refactor)
>- Implement vertical scaling (refactor)
>- Measure refactor performance/overhead
>- Document new code
> 

> The horizontal scaling is already working. I did some tests and initially
> the overhead of the new
> code is ~3% (measured only in the modified scaling code) which should be
> almost 0% for total
> program time execution.

how /over what did you meassure the 3% exactly ?
iam asking, so i understand if this performance chnage is irrelevant
or not.
for init code that runs once some speed loss is irrelevant but for
example the horizontal scale code as a whole should not become 3%
slower.
but i do not suggest to do non trivial optimization on this yet.
better get it all working first.


> 
> For the next week (or 2) I plan to implement the line pool allocator and
> the ring buffer logic.
> 
> Besides the scheduling list, with the new scaling design I think it is
> possible to remove the need
> for cascade SwsContexts and also work on some kind of parallelization of
> the scaling code. These I should work after finishing the scheduling.
> 
> [1] 7efb0fae8ed52b6f841d70c4d8981399da42e7bd
> 
> [2] 0b955f28ab1cbba5188e0cbd44c250dc5b526d53
> 
> [3] b577b4d388743e6f90f54e65fdb8edddbeaf17de
> 
> [4] f83a83e8ab97e0fcab2248e828d4fb5433e8bcfe
> 
> [5] eaf6de8606b698baaeda1ecb9493a240d5b828e9
> 
> [6] b949d895da80979d44f6525de3a3f9a98118a0a6
> 
> [7] 353d20df59075d442e943f00c7fcb8bc7784089b
> 

please always attach patches, that makes reviewing them with with
MUAs easy and also keeps them together with any discussions about
them. who knows if the github links will still work in 10 years if
someone tries to debug something and tried to look up old discussions
and patches ...

Thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat: Add H264 API test

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 07:21:07PM +0300, Ludmila Glinskih wrote:
> Result differs in pkt_duration and time_base.den for some reason.
> Right now it tests only one example (adjusted to match the output).
> 
> Signed-off-by: Ludmila Glinskih 

[...]

> +printf("%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, 
> 0x%08lx\n", video_stream,
> +fr->pkt_pts, fr->pkt_dts, fr->pkt_duration,

minor nitpick, this should use av_frame_get_pkt_duration() instead
of directly acessing fr->pkt_duration

changed that
applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: Support for VDPAU accelerated HEVC decoding

2015-06-24 Thread Philip Langdale
Ping?

On Sat, 20 Jun 2015 11:45:01 -0700
Philip Langdale  wrote:

> This change introduces basic support for HEVC decoding through vdpau.
> Right now, there are problems with the nvidia driver/library
> implementation that mean that frames are incorrectly laid out in
> memory when they are returned from the decoder, and it is normally
> impossible to recover the complete decoded frame due to loss of data
> from alignment inconsistencies.
> 
> I obviously hope that nvidia will be fixing it in due course - I've
> verified the problems exist with their example application.
> 
> As such, this support is not useful for any real world application,
> but I believe that it is correct (with the caveat that the mangled
> frames may hide problems) and will work properly once the nvidia
> problem is fixed.
> 
> Right now it appears that any file encoded by x265 or nvenc is decoded
> correctly, but that's because these files don't use a bunch of HEVC
> features.
> 
> Quick summary:
> 
> Features that seem to work:
> 
> 1) Short Term References
> 2) Scaling Lists
> 3) Tiling
> 
> Features with known problems:
> 
> 1) Long Term References
> 
> It's hard to tell what's going on here. After I read the nvidia
> example app that does not set the IsLongTerm flag on LTRs, and
> changed my code, a bunch of frames using LTR started to display
> correctly, but there are still samples with glitches that are related
> to LTRs.
> 
> In terms of real world files, both x265 and nvenc only use short term
> refs from this list. The divx encoder seems similar.
> 
> Signed-off-by: Philip Langdale 
> ---
>  configure   |   4 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/hevc.c   |   5 +-
>  libavcodec/vdpau_hevc.c | 437
> 
> libavcodec/vdpau_internal.h |   3 + 6 files changed, 450
> insertions(+), 1 deletion(-) create mode 100644
> libavcodec/vdpau_hevc.c
> 
> diff --git a/configure b/configure
> index 3960b73..e79b7d2 100755
> --- a/configure
> +++ b/configure
> @@ -2365,6 +2365,8 @@ hevc_d3d11va_hwaccel_deps="d3d11va
> DXVA_PicParams_HEVC" hevc_d3d11va_hwaccel_select="hevc_decoder"
>  hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
>  hevc_dxva2_hwaccel_select="hevc_decoder"
> +hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
> +hevc_vdpau_hwaccep_select="hevc_decoder"
>  mpeg_vdpau_decoder_deps="vdpau"
>  mpeg_vdpau_decoder_select="mpeg2video_decoder"
>  mpeg_xvmc_hwaccel_deps="xvmc"
> @@ -5021,6 +5023,8 @@ check_type "windows.h dxva.h"
> "DXVA_PicParams_HEVC" check_type "windows.h d3d11.h"
> "ID3D11VideoDecoder" check_type "d3d9.h dxva2api.h"
> DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0600 
> +check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
> +
>  if ! disabled w32threads && ! enabled pthreads; then
>  check_func_headers "windows.h process.h" _beginthreadex &&
>  enable w32threads || disable w32threads
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 7a964ec..b1dfc8b 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -688,6 +688,7 @@ OBJS-$(CONFIG_H264_VDA_HWACCEL)   +=
> vda_h264.o OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
>  OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   += dxva2_hevc.o
>  OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
> +OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
>  OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
>  OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL) += mpegvideo_xvmc.o
>  OBJS-$(CONFIG_MPEG2_D3D11VA_HWACCEL)  += dxva2_mpeg2.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 25462a6..589c5ad 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -86,6 +86,7 @@ void avcodec_register_all(void)
>  REGISTER_HWACCEL(H264_VDPAU,h264_vdpau);
>  REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
>  REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
> +REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
>  REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
>  REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
>  REGISTER_HWACCEL(MPEG2_XVMC,mpeg2_xvmc);
> diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
> index 5237752..7eabc8d 100644
> --- a/libavcodec/hevc.c
> +++ b/libavcodec/hevc.c
> @@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext
> *avctx, 
>  static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum
> AVPixelFormat pix_fmt) {
> -#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
> CONFIG_HEVC_D3D11VA_HWACCEL)
> +#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
> CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL) enum
> AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; int ret, i;
>  
> @@ -346,6 +346,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS
> *sps, enum AVPixelFormat pix_fm #if CONFIG_HEVC_D3D11VA_HWACCEL
>  *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
> 

Re: [FFmpeg-devel] [PATCH] vp9: fix profile check for intraonly frames.

2015-06-24 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 02:21:15PM -0700, James Zern wrote:
> Hi,
> 
> On Wed, Jun 24, 2015 at 7:41 AM, Ronald S. Bultje  wrote:
> > ---
> >  libavcodec/vp9.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> 
> lgtm

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] GCC 5.1 warning: -Warray-bounds

2015-06-24 Thread James Almer
On 04/06/15 6:55 PM, Ganesh Ajjanagadde wrote:
> I have created a small test case which gets at the heart of one of
> these spurious
> warnings, namely the one for libavfilter/vf_swapuv.c.
> 
> Here is the ticket on the GCC Bugzilla:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66422
> 
> Note that as of the moment, -Warray-bounds appears quite broken on GCC
> (especially on -O3), and the bugzilla is full of bug reports on this.

For the record, these bogus warnings have been fixed on the gcc 5 branch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/3] electronicarts: move video stream properties into dedicated structure

2015-06-24 Thread Peter Ross
This is required for the alpha stream demux patch.

Signed-off-by: Peter Ross 
---
 libavformat/electronicarts.c | 123 +++
 1 file changed, 67 insertions(+), 56 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index d999a0b..6e53ae7 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -63,14 +63,18 @@
 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f')  /* CMV I-frame */
 #define AVP6_TAG MKTAG('A', 'V', 'P', '6')
 
-typedef struct EaDemuxContext {
-int big_endian;
-
-enum AVCodecID video_codec;
+typedef struct VideoProperties {
+enum AVCodecID codec;
 AVRational time_base;
 int width, height;
 int nb_frames;
-int video_stream_index;
+int stream_index;
+} VideoProperties;
+
+typedef struct EaDemuxContext {
+int big_endian;
+
+VideoProperties video;
 
 enum AVCodecID audio_codec;
 int audio_stream_index;
@@ -302,46 +306,43 @@ static void process_audio_header_sead(AVFormatContext *s)
 ea->audio_codec  = AV_CODEC_ID_ADPCM_IMA_EA_SEAD;
 }
 
-static void process_video_header_mdec(AVFormatContext *s)
+static void process_video_header_mdec(AVFormatContext *s, VideoProperties 
*video)
 {
-EaDemuxContext *ea = s->priv_data;
 AVIOContext *pb= s->pb;
 avio_skip(pb, 4);
-ea->width   = avio_rl16(pb);
-ea->height  = avio_rl16(pb);
-ea->time_base   = (AVRational) { 1, 15 };
-ea->video_codec = AV_CODEC_ID_MDEC;
+video->width   = avio_rl16(pb);
+video->height  = avio_rl16(pb);
+video->time_base   = (AVRational) { 1, 15 };
+video->codec = AV_CODEC_ID_MDEC;
 }
 
-static int process_video_header_vp6(AVFormatContext *s)
+static int process_video_header_vp6(AVFormatContext *s, VideoProperties *video)
 {
-EaDemuxContext *ea = s->priv_data;
-AVIOContext *pb= s->pb;
+AVIOContext *pb = s->pb;
 
 avio_skip(pb, 8);
-ea->nb_frames = avio_rl32(pb);
+video->nb_frames = avio_rl32(pb);
 avio_skip(pb, 4);
-ea->time_base.den = avio_rl32(pb);
-ea->time_base.num = avio_rl32(pb);
-if (ea->time_base.den <= 0 || ea->time_base.num <= 0) {
+video->time_base.den = avio_rl32(pb);
+video->time_base.num = avio_rl32(pb);
+if (video->time_base.den <= 0 || video->time_base.num <= 0) {
 av_log(s, AV_LOG_ERROR, "Timebase is invalid\n");
 return AVERROR_INVALIDDATA;
 }
-ea->video_codec   = AV_CODEC_ID_VP6;
+video->codec   = AV_CODEC_ID_VP6;
 
 return 1;
 }
 
-static void process_video_header_cmv(AVFormatContext *s)
+static void process_video_header_cmv(AVFormatContext *s, VideoProperties 
*video)
 {
-EaDemuxContext *ea = s->priv_data;
 int fps;
 
 avio_skip(s->pb, 10);
 fps = avio_rl16(s->pb);
 if (fps)
-ea->time_base = (AVRational) { 1, fps };
-ea->video_codec = AV_CODEC_ID_CMV;
+video->time_base = (AVRational) { 1, fps };
+video->codec = AV_CODEC_ID_CMV;
 }
 
 /* Process EA file header.
@@ -353,7 +354,7 @@ static int process_ea_header(AVFormatContext *s)
 AVIOContext *pb= s->pb;
 int i;
 
-for (i = 0; i < 5 && (!ea->audio_codec || !ea->video_codec); i++) {
+for (i = 0; i < 5 && (!ea->audio_codec || !ea->video.codec); i++) {
 uint64_t startpos = avio_tell(pb);
 int err   = 0;
 
@@ -395,40 +396,40 @@ static int process_ea_header(AVFormatContext *s)
 break;
 
 case MVIh_TAG:
-process_video_header_cmv(s);
+process_video_header_cmv(s, &ea->video);
 break;
 
 case kVGT_TAG:
-ea->video_codec = AV_CODEC_ID_TGV;
+ea->video.codec = AV_CODEC_ID_TGV;
 break;
 
 case mTCD_TAG:
-process_video_header_mdec(s);
+process_video_header_mdec(s, &ea->video);
 break;
 
 case MPCh_TAG:
-ea->video_codec = AV_CODEC_ID_MPEG2VIDEO;
+ea->video.codec = AV_CODEC_ID_MPEG2VIDEO;
 break;
 
 case pQGT_TAG:
 case TGQs_TAG:
-ea->video_codec = AV_CODEC_ID_TGQ;
-ea->time_base   = (AVRational) { 1, 15 };
+ea->video.codec = AV_CODEC_ID_TGQ;
+ea->video.time_base   = (AVRational) { 1, 15 };
 break;
 
 case pIQT_TAG:
-ea->video_codec = AV_CODEC_ID_TQI;
-ea->time_base   = (AVRational) { 1, 15 };
+ea->video.codec = AV_CODEC_ID_TQI;
+ea->video.time_base   = (AVRational) { 1, 15 };
 break;
 
 case MADk_TAG:
-ea->video_codec = AV_CODEC_ID_MAD;
+ea->video.codec = AV_CODEC_ID_MAD;
 avio_skip(pb, 6);
-ea->time_base = (AVRational) { avio_rl16(pb), 1000 };
+ea->video.time_base = (AVRational) { avio_rl16(pb), 1000 };
 break;
 
 case MVhd_TAG:
-err = process_video_header_vp6(s);
+err =

[FFmpeg-devel] [PATCH 2/3] electronicarts: demux alpha stream

2015-06-24 Thread Peter Ross
Electronic Arts VP6 files may contain two video streams: one for the
primary video stream and another for the alpha mask. The file format
uses identical data structures for both streams.

Signed-off-by: Peter Ross 
---
 libavformat/electronicarts.c | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 6e53ae7..5d21d49 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -59,6 +59,9 @@
 #define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
 #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
 #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
+#define AVhd_TAG MKTAG('A', 'V', 'h', 'd')
+#define AV0K_TAG MKTAG('A', 'V', '0', 'K')
+#define AV0F_TAG MKTAG('A', 'V', '0', 'F')
 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')  /* CMV header */
 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f')  /* CMV I-frame */
 #define AVP6_TAG MKTAG('A', 'V', 'P', '6')
@@ -74,7 +77,7 @@ typedef struct VideoProperties {
 typedef struct EaDemuxContext {
 int big_endian;
 
-VideoProperties video;
+VideoProperties video, alpha;
 
 enum AVCodecID audio_codec;
 int audio_stream_index;
@@ -431,6 +434,10 @@ static int process_ea_header(AVFormatContext *s)
 case MVhd_TAG:
 err = process_video_header_vp6(s, &ea->video);
 break;
+
+case AVhd_TAG:
+err = process_video_header_vp6(s, &ea->alpha);
+break;
 }
 
 if (err < 0) {
@@ -511,7 +518,7 @@ static int ea_read_header(AVFormatContext *s)
 if (process_ea_header(s)<=0)
 return AVERROR(EIO);
 
-if (init_video_stream(s, &ea->video))
+if (init_video_stream(s, &ea->video) || init_video_stream(s, &ea->alpha))
 return AVERROR(ENOMEM);
 
 if (ea->audio_codec) {
@@ -672,10 +679,12 @@ static int ea_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 goto get_video_packet;
 
 case MV0K_TAG:
+case AV0K_TAG:
 case MPCh_TAG:
 case pIQT_TAG:
 key = AV_PKT_FLAG_KEY;
 case MV0F_TAG:
+case AV0F_TAG:
 get_video_packet:
 if (!chunk_size)
 continue;
@@ -689,7 +698,10 @@ get_video_packet:
 break;
 }
 partial_packet = chunk_type == MVIh_TAG;
-pkt->stream_index = ea->video.stream_index;
+if (chunk_type == AV0K_TAG || chunk_type == AV0F_TAG)
+pkt->stream_index = ea->alpha.stream_index;
+else
+pkt->stream_index = ea->video.stream_index;
 pkt->flags   |= key;
 packet_read   = 1;
 break;
-- 
2.1.4

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/3] fate: test ea vp6 with alpha stream

2015-06-24 Thread Peter Ross
Signed-off-by: Peter Ross 
---

The binary file is in /incoming/fate-ea-vp6 (64kb)
-map 0 required because there are two video streams in this file.


 tests/fate/demux.mak |  3 ++
 tests/ref/fate/d-eavp6-demux | 98 
 2 files changed, 101 insertions(+)
 create mode 100644 tests/ref/fate/d-eavp6-demux

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index 05ce4bf..e48d398 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -32,6 +32,9 @@ fate-cine-demux: CMD = crc -i 
$(TARGET_SAMPLES)/cine/bayer_gbrg8.cine -c copy
 FATE_SAMPLES_DEMUX-$(CONFIG_DAUD_DEMUXER) += fate-d-cinema-demux
 fate-d-cinema-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/d-cinema/THX_Science_FLT_1920-partial.302 -acodec copy
 
+FATE_SAMPLES_DEMUX-$(CONFIG_EA_DEMUXER) += fate-d-eavp6-demux
+fate-d-eavp6-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ea-vp6/SmallRing.vp6 
-map 0 -vcodec copy
+
 FATE_SAMPLES_DEMUX-$(CONFIG_GIF_DEMUXER) += fate-gif-demux
 fate-gif-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/gif/Newtons_cradle_animation_book_2.gif -vcodec copy
 
diff --git a/tests/ref/fate/d-eavp6-demux b/tests/ref/fate/d-eavp6-demux
new file mode 100644
index 000..3587a08
--- /dev/null
+++ b/tests/ref/fate/d-eavp6-demux
@@ -0,0 +1,98 @@
+#tb 0: 32767/982027
+#tb 1: 32767/982027
+0,  0,  0,1, 1860, 0xbd548c4c
+1,  0,  0,1, 1748, 0x96046284
+0,  1,  1,1, 1044, 0x814efc86, F=0x0
+1,  1,  1,1,  204, 0x0ea1573a, F=0x0
+0,  2,  2,1, 1036, 0xf672f905, F=0x0
+1,  2,  2,1,  240, 0x634e7448, F=0x0
+0,  3,  3,1, 1048, 0xe0f80ee7, F=0x0
+1,  3,  3,1,  260, 0xc35b8521, F=0x0
+0,  4,  4,1, 1072, 0x980918e9, F=0x0
+1,  4,  4,1,  376, 0x6e5cb85e, F=0x0
+0,  5,  5,1, 1052, 0x73e6fd33, F=0x0
+1,  5,  5,1,  344, 0xaacdad6b, F=0x0
+0,  6,  6,1, 1056, 0x5242fb20, F=0x0
+1,  6,  6,1,  404, 0x7498be1f, F=0x0
+0,  7,  7,1, 1092, 0x8b7111c2, F=0x0
+1,  7,  7,1,  368, 0xe2b8afd2, F=0x0
+0,  8,  8,1, 1144, 0xc1003410, F=0x0
+1,  8,  8,1,  412, 0x3615c893, F=0x0
+0,  9,  9,1, 1152, 0x6b9234f9, F=0x0
+1,  9,  9,1,  424, 0x04a5cdb7, F=0x0
+0, 10, 10,1, 1132, 0x7d45384b, F=0x0
+1, 10, 10,1,  356, 0x4ad5a9d5, F=0x0
+0, 11, 11,1, 1164, 0x47d637a1, F=0x0
+1, 11, 11,1,  448, 0x2811d959, F=0x0
+0, 12, 12,1, 1152, 0xede932ad, F=0x0
+1, 12, 12,1,  316, 0x911a9c11, F=0x0
+0, 13, 13,1, 1112, 0x49f31a9e, F=0x0
+1, 13, 13,1,  312, 0x1bb08de2, F=0x0
+0, 14, 14,1, 1112, 0x7f022bc7, F=0x0
+1, 14, 14,1,  308, 0x2c3698bb, F=0x0
+0, 15, 15,1, 1128, 0x2a7a4381, F=0x0
+1, 15, 15,1,  424, 0xec77c694, F=0x0
+0, 16, 16,1, 1012, 0x22a3f64b, F=0x0
+1, 16, 16,1,  220, 0x7506677f, F=0x0
+0, 17, 17,1, 1012, 0x0ea3f03b, F=0x0
+1, 17, 17,1,  204, 0xbf3f607e, F=0x0
+0, 18, 18,1, 1072, 0xdf860cc2, F=0x0
+1, 18, 18,1,  416, 0x5f08ca69, F=0x0
+0, 19, 19,1, 1052, 0x29a9116a, F=0x0
+1, 19, 19,1,  244, 0x8d1a7c05, F=0x0
+0, 20, 20,1, 1048, 0xfeb1107d, F=0x0
+1, 20, 20,1,  260, 0xd0b27b40, F=0x0
+0, 21, 21,1, 1084, 0xeed50a32, F=0x0
+1, 21, 21,1,  304, 0x5e5e8f10, F=0x0
+0, 22, 22,1,  992, 0xabd4e695, F=0x0
+1, 22, 22,1,  304, 0x2c839490, F=0x0
+0, 23, 23,1, 1016, 0x7396e5a4, F=0x0
+1, 23, 23,1,  264, 0x5bac855a, F=0x0
+0, 24, 24,1, 1000, 0x1d91ef45, F=0x0
+1, 24, 24,1,  220, 0xcda465a8, F=0x0
+0, 25, 25,1,  960, 0x1c99da31, F=0x0
+1, 25, 25,1,  280, 0xc1d08783, F=0x0
+0, 26, 26,1,  948, 0x48a4c938, F=0x0
+1, 26, 26,1,  440, 0xe2ebd578, F=0x0
+0, 27, 27,1,  952, 0xea12d081, F=0x0
+1, 27, 27,1,  188, 0x

Re: [FFmpeg-devel] patch: log when hard exiting from too many signals.

2015-06-24 Thread Roger Pack
On 6/24/15, wm4  wrote:
> On Wed, 24 Jun 2015 13:04:27 +0200
> Michael Niedermayer  wrote:
>
>> On Wed, Jun 24, 2015 at 04:28:22AM -0600, Roger Pack wrote:
>> > If it looks worth anything, see attached (there's only one file).
>> > Thanks!
>>
>> >  ffmpeg.c |4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> > 76e781dafd7324903c7cc08dbf297bd95841126c
>> > 0002-log-error-message-when-shutting-down-from-too-many-s.patch
>> > From dad4f89ec0dc5bdeaeb1923e159fa12655bdde7a Mon Sep 17 00:00:00 2001
>> > From: rogerdpack 
>> > Date: Wed, 24 Jun 2015 04:26:26 -0600
>> > Subject: [PATCH 2/2] log error message when shutting down from too many
>> >  signals
>> >
>> > Signed-off-by: rogerdpack 
>> > ---
>> >  ffmpeg.c | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/ffmpeg.c b/ffmpeg.c
>> > index 720e105..6aa5d1b 100644
>> > --- a/ffmpeg.c
>> > +++ b/ffmpeg.c
>> > @@ -324,8 +324,10 @@ sigterm_handler(int sig)
>> >  received_sigterm = sig;
>> >  received_nb_signals++;
>> >  term_exit_sigsafe();
>> > -if(received_nb_signals > 3)
>> > +if(received_nb_signals > 3){
>>
>> > +av_log(NULL, AV_LOG_ERROR, "Received %d shutdown signals, hard
>> > exiting.", received_nb_signals);
>>
>> i think its better to use fprintf(stderr,...
>> here instead of av_log()
>>
>> when things are already stuck for some reason staying with the
>> simpler, lower level code seems more robust to me
>>
>> [...]
>>
>
> Neither av_log not printf() are safe in a signal handler.
>
> You could use write().

I'm not as familiar with write, unfortunately.  Here's a printf
version FWIW, feel free to rewrite it as desired.


0002-log-error-message-when-shutting-down-from-too-many.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Support Ctrl+Break in ffmpeg.exe on Windows as if it was Ctrl+C

2015-06-24 Thread Roger Pack
On 6/24/15, Michael Niedermayer  wrote:
> On Wed, Jun 24, 2015 at 04:19:38AM -0600, Roger Pack wrote:
>> On 7/5/12, Michael Niedermayer  wrote:
>> > On Mon, Jun 25, 2012 at 02:21:21PM +0200, Michael Niedermayer wrote:
>> >> On Tue, Jun 19, 2012 at 07:10:04PM +0200, Reimar Döffinger wrote:
>> >> > On 19 Jun 2012, at 11:31, Joe Wreschnig 
>> >> > wrote:
>> >> > > On Windows, the Ctrl+Break key combination usually does what
>> >> > > Ctrl+C
>> >> > > does. It is more common for processes to send other processes
>> >> > > Ctrl+Break rather than Ctrl+C, because sending Ctrl+C / SIGINT
>> >> > > doesn't
>> >> > > work if you started a child in a new process group.
>> >> > >
>> >> > > This patch makes ffmpeg.exe register what Windows calls a console
>> >> > > control event handler, which allows it to intercept Ctrl+Break. It
>> >> > > hands it off directly to the usual SIGINT/SIGTERM handler. The
>> >> > > same
>> >> > > function also processes closing the console window, mapping it to
>> >> > > SIGTERM.
>> >> > >
>> >> > > Obviously, this is only enabled if compiling for a platform where
>> >> > > SetConsoleCtrlHandler is available (i.e. modern Windows).
>> >> >
>> >> > What is "modern"? Also it is rather unusual to recompile for
>> >> > different
>> >> > Windows versions, couldn't you with about the same effort just use
>> >> > GetProcAddress (more complex code, but in exchange you'd save on all
>> >> > the
>> >> > configure changes and #ifs).
>> >>
>> >> It seems versions that dont support this are no longer supported
>> >> by microsoft. IMHO we shouldnt bother too much with such old windows
>> >> versions unless someone wants to / volunteers to do it.
>> >>
>> >> thus, if there are no objections i will apply this patch once a few
>> >> minor issues are fixed (ifdef breaking compile to be precisse)
>> >
>> > iam waiting for a working patch
>> > i could try to fix it before applying myself but with patches for
>> > non linux platforms i prefer to avoid changing as the changes would
>> > be untested ,..
>>
>> Sorry I dropped the ball on this one.
>> See attached.  The major gains we get out of this (in my head at
>> least) is hopefully better shutdown if somebody logs out (which has
>> bitten me before).  Or if someone closes a console window which also
>> shuts down FFmpeg.
>>
>> I noticed that even with handling notifications of "logout" that
>> ffmpeg can still easily leave behind corrupted mp4 files (it gets
>> killed quickly after).
>
>> Makes me wonder if there's some way to make it shutdown more quickly,
>> but I'm not sure if it's a problem yet or not.
>
> iam not sure i understand ?
> does windows kill the process immedeatly after CtrlHandler() returns?
> if so CtrlHandler() should wait for the main loop to exit and cleanup
> finishing before it returns

Thanks for the pointer, you were exactly right.  Appears I can
basically "Sleep" in that method and thus allow FFmpeg to cleanup (in
vista+ I believe it gives a max of 5 seconds which is enough).  If
there's some other easy way to know the main loop has exited I could
use that I suppose, but it should have the same effect.

See attached revision (it now writes finalizes files appropriately for
the logoff/close messages).
Thanks!


0001-windows-respond-to-logoff-and-ctrl-break-messages.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Support Ctrl+Break in ffmpeg.exe on Windows as if it was Ctrl+C

2015-06-24 Thread James Almer
On 24/06/15 7:19 AM, Roger Pack wrote:
> +#ifdef HAVE_SETCONSOLECTRLHANDLER
> +static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
> +{
> +av_log(NULL, AV_LOG_DEBUG, "\nReceived windows signal %d\n", 
> fdwCtrlType);
> +
> +switch (fdwCtrlType)
> +{
> +case CTRL_C_EVENT:
> +case CTRL_BREAK_EVENT:
> +sigterm_handler(SIGINT);
> +return TRUE;
> +
> +case CTRL_CLOSE_EVENT:
> +case CTRL_LOGOFF_EVENT:
> +case CTRL_SHUTDOWN_EVENT:
> +sigterm_handler(SIGTERM);
> +return TRUE;
> +
> +default:
> +av_log(NULL, AV_LOG_ERROR, "Received unknown windows signal %d\n", 
> fdwCtrlType);
> +return FALSE;
> +}
> +}
> +#endif
> +
>  void term_init(void)
>  {
>  #if HAVE_TERMIOS_H
> @@ -358,6 +386,9 @@ void term_init(void)
>  #ifdef SIGXCPU
>  signal(SIGXCPU, sigterm_handler);
>  #endif
> +#ifdef HAVE_SETCONSOLECTRLHANDLER
> +SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE);
> +#endif

Why ffmpeg only? Can't this be in cmdutils.c to also work with the other tools?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] verbiage

2015-06-24 Thread Roger Pack
On 6/24/15, compn  wrote:
> On Wed, 24 Jun 2015 04:30:10 -0600
> Roger Pack  wrote:
>
>> Received signal %d: terminating.
>>
>> Today sounds as if the process is "hard exiting" (like SIGKILL or some
>> odd) when it might be as benign as a ctrl+c that is used as a normal
>> shutdown process.
>>
>> Perhaps it could be made to be something like:
>>
>> Shutting down because received signal %d
>
> ffmpeg exiting normally, received signal %d
>
> ?

I like it. Attached is an example FWIW.
-roger-


0003-modify-exit-message-when-signaled.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Support Ctrl+Break in ffmpeg.exe on Windows as if it was Ctrl+C

2015-06-24 Thread Roger Pack
On 6/25/15, James Almer  wrote:
> On 24/06/15 7:19 AM, Roger Pack wrote:
>> +#ifdef HAVE_SETCONSOLECTRLHANDLER
>> +static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
>> +{
>> +av_log(NULL, AV_LOG_DEBUG, "\nReceived windows signal %d\n",
>> fdwCtrlType);
>> +
>> +switch (fdwCtrlType)
>> +{
>> +case CTRL_C_EVENT:
>> +case CTRL_BREAK_EVENT:
>> +sigterm_handler(SIGINT);
>> +return TRUE;
>> +
>> +case CTRL_CLOSE_EVENT:
>> +case CTRL_LOGOFF_EVENT:
>> +case CTRL_SHUTDOWN_EVENT:
>> +sigterm_handler(SIGTERM);
>> +return TRUE;
>> +
>> +default:
>> +av_log(NULL, AV_LOG_ERROR, "Received unknown windows signal
>> %d\n", fdwCtrlType);
>> +return FALSE;
>> +}
>> +}
>> +#endif
>> +
>>  void term_init(void)
>>  {
>>  #if HAVE_TERMIOS_H
>> @@ -358,6 +386,9 @@ void term_init(void)
>>  #ifdef SIGXCPU
>>  signal(SIGXCPU, sigterm_handler);
>>  #endif
>> +#ifdef HAVE_SETCONSOLECTRLHANDLER
>> +SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE);
>> +#endif
>
> Why ffmpeg only? Can't this be in cmdutils.c to also work with the other
> tools?

It basically piggy backs on the existing signal handling code, which I
guess is FFmpeg only (probably each process needs to setup their own
signal handling).  At least it'll be a nice example for people to use
if they need to :)

-roger-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel