[FFmpeg-devel] Encode2() function in libavcodec/avcodec.h
Hi, the attributes has been changed to (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); what is the exact change made in the function. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] OPW Qualification Task: Enable daemon mode for FFserver
I see your point. Changing the ffserver_config.c would help in addressing config files having NoDaemon option. You were right! Thanks. From 476c8605fab4d6c575c38796dd9dccaf854cf536 Mon Sep 17 00:00:00 2001 From: Binathi Bingi binti...@gmail.com Date: Thu, 30 Oct 2014 13:43:13 +0530 Subject: [PATCH] Restoring back NoDaemon option in ffserver.conf --- ffserver_config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ffserver_config.c b/ffserver_config.c index e2c78d8..ab33ec5 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -358,6 +358,8 @@ static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd, ffserver_get_arg(arg, sizeof(arg), p); if (resolve_host(config-http_addr.sin_addr, arg) != 0) ERROR(%s:%d: Invalid host/IP address: %s\n, arg); +} else if (!av_strcasecmp(cmd, NoDaemon)) { +WARNING(NoDaemon option has no effect, you should remove it\n); } else if (!av_strcasecmp(cmd, RTSPPort)) { ffserver_get_arg(arg, sizeof(arg), p); val = atoi(arg); -- 1.9.1 Binathi On Thu, Oct 30, 2014 at 8:04 AM, Michael Niedermayer michae...@gmx.at wrote: On Thu, Oct 30, 2014 at 07:49:10AM +0530, Binathi Bingi wrote: If you check the latest ffserver.conf file on GIT [ http://git.videolan.org/?p=ffmpeg.git http://www.google.com/url?q=http%3A%2F%2Fgit.videolan.org%2F%3Fp%3Dffmpeg.gitsa=Dsntz=1usg=AFQjCNEA5QH18TtMxcLhGx4b04pMUwSgYA ], there is NoDaemon option in it. So the patch is written as per latest version. But if desired can include NoDameon option in ffserver.conf and make futher changes. ffserver must work with any config file it worked with previously not only the ffserver.conf file from git [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong. ___ 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] [PATCH] libavformat/assenc: Add ignore_gaps option
This patch lets the user ignore ReadOrder when writing ASS subtitles, which is useful when e.g. streaming output. From d3d4cb4da2382a1d762fa1e9bfafbaf3d18cf5c5 Mon Sep 17 00:00:00 2001 From: Rodger Combs rodger.co...@gmail.com Date: Thu, 30 Oct 2014 04:33:17 -0500 Subject: [PATCH] libavformat/assenc: Add ignore_gaps option --- libavformat/assenc.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 8225967..c7a1d1e 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -23,6 +23,8 @@ #include avformat.h #include internal.h +#include libavutil/opt.h + typedef struct DialogueLine { int readorder; char *line; @@ -30,12 +32,14 @@ typedef struct DialogueLine { } DialogueLine; typedef struct ASSContext{ +const AVClass *class; int write_ts; // 0: ssa (timing in payload), 1: ass (matroska like) int expected_readorder; DialogueLine *dialogue_cache; DialogueLine *last_added_dialogue; int cache_size; int ssa_mode; +int ignore_gaps; }ASSContext; static int write_header(AVFormatContext *s) @@ -178,7 +182,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(ENOMEM); } insert_dialogue(ass, dialogue); -purge_dialogues(s, 0); +purge_dialogues(s, ass-ignore_gaps); } else { avio_write(s-pb, pkt-data, pkt-size); } @@ -192,6 +196,20 @@ static int write_trailer(AVFormatContext *s) return 0; } +#define OFFSET(x) offsetof(ASSContext, x) +#define E AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { +{ ignore_gaps, write events immediately, even if they're out-of-order, OFFSET(ignore_gaps), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E }, +{ NULL }, +}; + +static const AVClass ass_class = { +.class_name = ass muxer, +.item_name = av_default_item_name, +.option = options, +.version= LIBAVUTIL_VERSION_INT, +}; + AVOutputFormat ff_ass_muxer = { .name = ass, .long_name = NULL_IF_CONFIG_SMALL(SSA (SubStation Alpha) subtitle), @@ -203,4 +221,5 @@ AVOutputFormat ff_ass_muxer = { .write_packet = write_packet, .write_trailer = write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT, +.priv_class = ass_class, }; -- 2.1.0.rc1.4.g764c739 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Evolution of lavfi's design and API
Sorry for the slow reply. On date Wednesday 2014-10-22 23:45:42 +0200, Nicolas George encoded: [ CCing Anton, as most that is written here also apply to libav too, and this would be a good occasion to try a cross-fork cooperation; if that is not wanted, please let us know so we can drop the cc. ] 1. Problems with the current design 1.1. Mixed input-/output-driven model Currently, lavfi is designed to work in a mixed input-driven and output-driven model. That means the application needs sometimes to add input to buffersources and sometimes request output to buffersinks. This is a bit of a nuisance, because it requires the application to do it properly: adding input on the wrong input or requesting a frame on the wrong output will cause extra memory consumption or latency. With the libav API, it can not work at all since there is no mechanism to determine which input needs a frame in order to proceed. The libav API is clearly designed for a more output-driven implementation, with FIFOs anywhere to prevent input-driven frames to reach unready filters. Unfortunately, since it is impossible from the outside to guess what output will get a frame next, that can cause frames to accumulate anywhere in the filter graph, eating a lot of memory unnecessarily. FFmpeg's API has eliminated FIFOs in favour of queues in filters that need it, but these queues can not be controlled for unusual filter graphs with extreme needs. Also, there still is an implicit FIFO inside buffersink. 1.2. Recursive implementation All work in a filter graph is triggered by recursive invocations of the filters' methods. It makes debugging harder. It also can lead to large stack usage and makes frame- and filter-level multithreading harder to implement. It also prevents some diagnosis from working reliably. 1.3. EOF handling Currently, EOF is propagated only through the return value of the request_frame() method. That means it only works in an output-driven scheme. It also means that it has no timestamp attached to it; this is an issue for filters where the duration of the last frame is relevant, like vf_fps. 1.4. Latency Some filters need to know the timestamp of the next frame in order to know when the current frame will stop and be able to process it: overlay, fps are two examples. These filters will introduce a latency of one input frame that could otherwise be avoided. 1.5. Timestamps Some filters do not care about timestamps at all. Some check and have a proper handling of NOPTS values. Some filters just assume the frames will have timestamps, and possibly make extra assumptions on that: monotony, consistency, etc. That is an inconsistent mess. 1.6. Sparse streams There is a more severe instance of the latency issue when the input comes from an interleaved sparse stream: in that case, waiting for the next frame in order to find the end of the current one may require demuxing a large chunk of input, in turn provoking a lot of activity on other inputs of the graph. Other issues. S1. the filtergraph can't properly readapt to mid-stream changes involving assumed invariants (aspect ratio, size, timebase, pixel format, sample_rate). Indeed the framework was designed as though some of these properties (the ones defined by query_formats) were not allowed to change. S2. Another problem is that we initialize the filter before the filtergraph, so for example the single filter can't readapt to the filtergraph topology. For example it would be useful to have the split filter to change the number of outputs depending on the number of outputs specified, but this can't be easily achieved. (That's in my opinion a minor problem though). S3. It is not possible to direct commands towards a specific filter. For this we can add an ID to each filter instance. We could have something has: color:left_color=c=red [left] color:right_color=c=blue [right] then you can send commands (e.g. with zmq) with: echo left_color c yellow | tools/zmqsend S4. We should support output encoding movie. We got stuck designing the interface for that. ... About fifos and queues, we could add some options to control fifo filters to limit their size. For example we could specify the maximum number of allowed queued frames, or the total allowed size, and the dropping policy (drop last, drop first, drop random frame in the midst). 2. Proposed API changes To fix/enhance all these issues, I believe a complete rethink of the scheduling design of the library is necessary. I propose the following changes. Note: some of these changes are not 100% related to the issues I raised, but looked like a good idea while thinking on an API rework. 2.1. AVFrame.duration Add a duration field to AVFrame; if set,
Re: [FFmpeg-devel] [PATCH] avformat/subtitles: reduce log level of UTF-16 warning
L'octidi 8 brumaire, an CCXXIII, wm4 a écrit : Would a patch adding a this is UTF-8 flag to the subtitle codec headers be accepted? No. What should it be named? sub_charenc Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffprobe.xsd: Add packets_and_frames element definition
On date Thursday 2014-10-23 15:17:55 +0200, Tobias Rapp encoded: Attached patch allows validation of ffprobe XML output if -show_packets and -show_frames are both set. From 0c10cf28993f61cbb8365caf8d06f5d5b6111a80 Mon Sep 17 00:00:00 2001 From: Tobias Rapp t.r...@noa-audio.com Date: Thu, 23 Oct 2014 15:10:28 +0200 Subject: [PATCH] ffprobe.xsd: Add packets_and_frames element definition This allows validation of ffprobe XML output if -show_packets and -show_frames are both set. --- doc/ffprobe.xsd | 11 +++ 1 file changed, 11 insertions(+) Applied, thanks. -- FFmpeg = Fast and Fanciful Mastering Peaceless Ecumenical Gigant ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavformat/assenc: Add ignore_gaps option
On Thu, 30 Oct 2014 04:36:28 -0500 Rodger Combs rodger.co...@gmail.com wrote: This patch lets the user ignore ReadOrder when writing ASS subtitles, which is useful when e.g. streaming output. From d3d4cb4da2382a1d762fa1e9bfafbaf3d18cf5c5 Mon Sep 17 00:00:00 2001 From: Rodger Combs rodger.co...@gmail.com Date: Thu, 30 Oct 2014 04:33:17 -0500 Subject: [PATCH] libavformat/assenc: Add ignore_gaps option --- libavformat/assenc.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 8225967..c7a1d1e 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -23,6 +23,8 @@ #include avformat.h #include internal.h +#include libavutil/opt.h + typedef struct DialogueLine { int readorder; char *line; @@ -30,12 +32,14 @@ typedef struct DialogueLine { } DialogueLine; typedef struct ASSContext{ +const AVClass *class; int write_ts; // 0: ssa (timing in payload), 1: ass (matroska like) int expected_readorder; DialogueLine *dialogue_cache; DialogueLine *last_added_dialogue; int cache_size; int ssa_mode; +int ignore_gaps; }ASSContext; static int write_header(AVFormatContext *s) @@ -178,7 +182,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(ENOMEM); } insert_dialogue(ass, dialogue); -purge_dialogues(s, 0); +purge_dialogues(s, ass-ignore_gaps); } else { avio_write(s-pb, pkt-data, pkt-size); } @@ -192,6 +196,20 @@ static int write_trailer(AVFormatContext *s) return 0; } +#define OFFSET(x) offsetof(ASSContext, x) +#define E AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { +{ ignore_gaps, write events immediately, even if they're out-of-order, OFFSET(ignore_gaps), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E }, +{ NULL }, +}; + +static const AVClass ass_class = { +.class_name = ass muxer, +.item_name = av_default_item_name, +.option = options, +.version= LIBAVUTIL_VERSION_INT, +}; + AVOutputFormat ff_ass_muxer = { .name = ass, .long_name = NULL_IF_CONFIG_SMALL(SSA (SubStation Alpha) subtitle), @@ -203,4 +221,5 @@ AVOutputFormat ff_ass_muxer = { .write_packet = write_packet, .write_trailer = write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT, +.priv_class = ass_class, }; The option name is a bit unspecific - how about ignore_readorder? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi: add xbr filter
On Wed, Oct 29, 2014 at 3:36 AM, Clément Bœsch u...@pkh.me wrote: On Tue, Oct 28, 2014 at 10:51:27PM +0100, Michael Niedermayer wrote: On Tue, Oct 28, 2014 at 07:16:45PM +0100, Clément Bœsch wrote: On Tue, Oct 28, 2014 at 06:30:34PM +0100, Stefano Sabatini wrote: [...] How much effort would it take to implement the remaining scaling modes? According to https://ffmpeg.org/pipermail/ffmpeg-devel/2014-October/164574.html I think 4x can be done fast enough, but 3x will take time. [...] +typedef struct { +uint32_t rgbtoyuv[124]; We should avoid this 64MiB. Also the table should be possibly static, so you don't have to fill it per each xBR instance. So, I requested to do it exactly the same as HQx because this part is common according to the specifications. This should be kept the same vf_hqx, and then factorized. Now about removing this allocation, I did benchmark this LUT vs computation (see attached patch for comp. version). And the problem is that it's slightly slower, probably due to the /1000. why do you divide at all ? cant you do the computations with full precission ? I wasn't able to... but I was probably doing it wrong. And anyway, so far I observed this: lut: 127fps nolut+div: 119fps nolut+nodiv: 123fps So even with fast computation, it's still slower than the LUT. It probably doesn't matter that much in practice, and dropping that huge table might be worth the performance impact (feel free to discuss). Note that looking at the original code (which was working on rgb565 only), it was bitexact. The rgb 24-bit was added in the modern hqx with float point. So we can probably tolerate the inaccuracy. Still, if you find a way of keeping full accuracy with the modern implementation... Typically, I tried stuff like this: const uint32_t y = (uint32_t)((1225*r + 2404*g + 467*b + (111)) 12); const uint32_t u = (uint32_t)((-692*r - 1356*g + 2048*b + (111)) 12) + 128; const uint32_t v = (uint32_t)((2048*r - 1716*g - 332*b + (111)) 12) + 128; ...but I'm probably doing it very wrong somewhere (sign issue maybe?), haven't looked deeper. I went up to 15 bits, still didn't match, so I was probably doing something stupid. also instead of doing 2 rgb2yuv and then taking their difference you can do the difference in rgb space and convert the rgb difference to a yuv difference its just aM - bM = (a-b)M Ah, sounds like a good idea, I guess I'll try that. [...] -- Clément B. Updated the patch. How should I finally go about converting rgb to yuv? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 905fb0f15033e447fc344097dd649ca671fa1074 Mon Sep 17 00:00:00 2001 From: Arwa Arif arwaarif1...@gmail.com Date: Thu, 30 Oct 2014 18:05:45 +0530 Subject: [PATCH] [PATCH]lvafi: add xbr filter --- doc/filters.texi | 81 ++-- libavfilter/Makefile |1 + libavfilter/allfilters.c |1 + libavfilter/vf_xbr.c | 319 ++ 4 files changed, 335 insertions(+), 67 deletions(-) create mode 100644 libavfilter/vf_xbr.c diff --git a/doc/filters.texi b/doc/filters.texi index 7be29de..253384b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi +@section xbr +Apply high-quality magnification filter which is designed for pixel art. It follows a set +of edge-detection rules @url{http://www.libretro.com/forums/viewtopic.php?f=6t=134}. +This filter was originally created by Hyllian. + @anchor{yadif} @section yadif diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 6d868e7..2c56e38 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -198,6 +198,7 @@ OBJS-$(CONFIG_VIDSTABDETECT_FILTER) += vidstabutils.o vf_vidstabdetect. OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER) += vidstabutils.o vf_vidstabtransform.o OBJS-$(CONFIG_VIGNETTE_FILTER) += vf_vignette.o OBJS-$(CONFIG_W3FDIF_FILTER) += vf_w3fdif.o +OBJS-$(CONFIG_XBR_FILTER)+= vf_xbr.o OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o OBJS-$(CONFIG_ZMQ_FILTER)+= f_zmq.o OBJS-$(CONFIG_ZOOMPAN_FILTER)+= vf_zoompan.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index d88a9ad..2352d44 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -213,6 +213,7 @@ void avfilter_register_all(void) REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf); REGISTER_FILTER(VIGNETTE, vignette, vf); REGISTER_FILTER(W3FDIF, w3fdif, vf); +REGISTER_FILTER(XBR,xbr,vf); REGISTER_FILTER(YADIF, yadif, vf); REGISTER_FILTER(ZMQ,zmq,vf); REGISTER_FILTER(ZOOMPAN,zoompan,
Re: [FFmpeg-devel] Evolution of lavfi's design and API
On Thu, Oct 30, 2014 at 11:50:46AM +0100, Stefano Sabatini wrote: Sorry for the slow reply. On date Wednesday 2014-10-22 23:45:42 +0200, Nicolas George encoded: [ CCing Anton, as most that is written here also apply to libav too, and this would be a good occasion to try a cross-fork cooperation; if that is not wanted, please let us know so we can drop the cc. ] 1. Problems with the current design 1.1. Mixed input-/output-driven model Currently, lavfi is designed to work in a mixed input-driven and output-driven model. That means the application needs sometimes to add input to buffersources and sometimes request output to buffersinks. This is a bit of a nuisance, because it requires the application to do it properly: adding input on the wrong input or requesting a frame on the wrong output will cause extra memory consumption or latency. With the libav API, it can not work at all since there is no mechanism to determine which input needs a frame in order to proceed. The libav API is clearly designed for a more output-driven implementation, with FIFOs anywhere to prevent input-driven frames to reach unready filters. Unfortunately, since it is impossible from the outside to guess what output will get a frame next, that can cause frames to accumulate anywhere in the filter graph, eating a lot of memory unnecessarily. FFmpeg's API has eliminated FIFOs in favour of queues in filters that need it, but these queues can not be controlled for unusual filter graphs with extreme needs. Also, there still is an implicit FIFO inside buffersink. 1.2. Recursive implementation All work in a filter graph is triggered by recursive invocations of the filters' methods. It makes debugging harder. It also can lead to large stack usage and makes frame- and filter-level multithreading harder to implement. It also prevents some diagnosis from working reliably. 1.3. EOF handling Currently, EOF is propagated only through the return value of the request_frame() method. That means it only works in an output-driven scheme. It also means that it has no timestamp attached to it; this is an issue for filters where the duration of the last frame is relevant, like vf_fps. 1.4. Latency Some filters need to know the timestamp of the next frame in order to know when the current frame will stop and be able to process it: overlay, fps are two examples. These filters will introduce a latency of one input frame that could otherwise be avoided. 1.5. Timestamps Some filters do not care about timestamps at all. Some check and have a proper handling of NOPTS values. Some filters just assume the frames will have timestamps, and possibly make extra assumptions on that: monotony, consistency, etc. That is an inconsistent mess. 1.6. Sparse streams There is a more severe instance of the latency issue when the input comes from an interleaved sparse stream: in that case, waiting for the next frame in order to find the end of the current one may require demuxing a large chunk of input, in turn provoking a lot of activity on other inputs of the graph. Other issues. S1. the filtergraph can't properly readapt to mid-stream changes involving assumed invariants (aspect ratio, size, timebase, pixel format, sample_rate). Indeed the framework was designed as though some of these properties (the ones defined by query_formats) were not allowed to change. no, no and no :) the filtergraph should be able adapt to some changes like aspect, resolution and pixel / sample format. These are not invariants, some of this definitly worked when i tried it long ago i posted a (incomplete) patchset that fixes bugs in this relation long ago There are filters that can perfectly well handle changes in resolution, aspect, formats, ... and there are filters which are buggy but could when they are fixed also equally well support such changes and there are filters which fundamentally do not support some changes, these need to either be reinited and loose state/history or a scale/aresample be inserted before them when changes on their input occur for some filters reinit is not appropriate, examples are things that are intended to collect global statistics Also scale / aresample filters can serve as parameter change barriers, filters afterwards do not need to deal with such changes S2. Another problem is that we initialize the filter before the filtergraph, so for example the single filter can't readapt to the filtergraph topology. For example it would be useful to have the split filter to change the number of outputs depending on the number of outputs specified, but this can't be easily achieved. (That's in my opinion a minor problem though). S3.
Re: [FFmpeg-devel] OPW Qualification Task: Enable daemon mode for FFserver
Le nonidi 9 brumaire, an CCXXIII, Binathi Bingi a écrit : From 0fb7dcf1f126bd137e2b2025c5cd6cff4af65801 Mon Sep 17 00:00:00 2001 From: Binathi Bingi binti...@gmail.com Date: Thu, 30 Oct 2014 01:14:08 +0530 Subject: [PATCH] ffserver: enable back deamon mode --- ffserver.c| 34 ++ ffserver_config.c | 2 -- 2 files changed, 30 insertions(+), 6 deletions(-) Thanks for the submission. I believe you forgot to update the docs (doc/ffserver.texi). diff --git a/ffserver.c b/ffserver.c index ea2a2ae..96e312e 100644 --- a/ffserver.c +++ b/ffserver.c @@ -236,7 +236,7 @@ static int rtp_new_av_stream(HTTPContext *c, HTTPContext *rtsp_c); static const char *my_program_name; - I think the empty line could stay. +static int ffserver_daemon; static int no_launch; static int need_to_start_children; @@ -3671,6 +3671,7 @@ static void handle_child_exit(int sig) static void opt_debug(void) { config.debug = 1; +ffserver_daemon = 1; This is strange: debugging is precisely when you do not want ffserver to fork into background. If daemon mode is enabled by default, debug mode should probably disable it, but not the other way around. snprintf(config.logfilename, sizeof(config.logfilename), -); } @@ -3694,7 +3695,7 @@ int main(int argc, char **argv) { struct sigaction sigact = { { 0 } }; int ret = 0; - The empty line can stay. +ffserver_daemon = 1; This is changing the default behaviour again, I am not sure this is a good idea nowadays. We can probably leave that line out for the time being. config.filename = av_strdup(/etc/ffserver.conf); parse_loglevel(argc, argv, options); @@ -3736,10 +3737,35 @@ int main(int argc, char **argv) build_feed_streams(); compute_bandwidth(); - Ditto for the empty line. +if(ffserver_daemon){ Style nitpick: space between if/for/while/switch and parentheses and before the brace. +int ffserver_id = 0; +pid_t sid = 0; + +ffserver_id = fork(); // Create child process Small nitpick: the comment seems useless. + +if (ffserver_id 0){ +printf(fork failed!\n); //Indication of failure This kind of message should go to stderr, never stdout. In FFmpeg code, use av_log() for that. Also, please include the error reason, using errno (probably through AVERROR and av_err2str()). And the comment seems useless too. +exit(1); +} + +if(ffserver_id 0){ //Parent process need to kill I do not understand the comment. And ditto for spacing. +exit(0); +} + +sid = setsid(); //set new session +if(sid 0){ +exit(1); //return failure Ditto for spacing and comment. +} + +open (/dev/null, O_RDWR); + +if (strcmp(config.logfilename, -) != 0) { +close(1); +} This looks strange. If the purpose is to sanitize stdio after detaching, there are some bits missing. +} /* signal init */ signal(SIGPIPE, SIG_IGN); - + I have no idea why Git proposes to replace an empty line with an identical empty line, but that does not matter. if (http_server() 0) { http_log(Could not start server\n); exit(1); diff --git a/ffserver_config.c b/ffserver_config.c index e44cdf7..e2c78d8 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -358,8 +358,6 @@ static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd, ffserver_get_arg(arg, sizeof(arg), p); if (resolve_host(config-http_addr.sin_addr, arg) != 0) ERROR(%s:%d: Invalid host/IP address: %s\n, arg); -} else if (!av_strcasecmp(cmd, NoDaemon)) { -WARNING(NoDaemon option has no effect, you should remove it\n); Superseded by: +} else if (!av_strcasecmp(cmd, NoDaemon)) { +WARNING(NoDaemon option has no effect, you should remove it\n); First, you may notice that your mail user agent has mangled the patch by adding a line break before the end of the last line. That happens when pasting a patch directly in the body of a mail with a bad mail user agent. This is of no matter here because of the next point. Second, this patch needs to be squashed with the previous one, so that they are a single commit. If you had not yet committed, you could do that using the --amend option to git commit. Since you have already committed, you must use git rebase -i master (assuming you created a branch from the branch called master). Third, I do not think this exact version is correct. If you make the daemon mode the default, then NoDaemon must not be ignored, it must have its specified effect: turn daemon off; if you do not make the daemon mode the default, then there must be an option to turn it on. IMHO, the best is to have both Daemon and NoDaemon mode. } else if (!av_strcasecmp(cmd, RTSPPort)) { ffserver_get_arg(arg,
Re: [FFmpeg-devel] OPW Qualification Task: Enable daemon mode for FFserver
Hello On 10/30/2014 10:50 AM, Nicolas George wrote: [..] Third, I do not think this exact version is correct. If you make the daemon mode the default, then NoDaemon must not be ignored, it must have its specified effect: turn daemon off; if you do not make the daemon mode the default, then there must be an option to turn it on. IMHO, the best is to have both Daemon and NoDaemon mode. [..] I would prefer no-deamon mode been the default to not break current behavior till deamon-mode has had a good deal of production testing. I also think having a single Daemonize yes/no toggle should be enough but I'm OK either way in the context of this patch. Binathi: As an added bonus, try adding an -s to your commit command line so you get the Signed-off-by: line added, this is customary. Bests, -- Reynaldo H. Verdejo Pinochet Open Source Group Samsung Research America / Silicon Valley ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/6] dv: fix weight table for 2x4x8 transform
On Thu, Oct 30, 2014 at 02:49:30PM +0100, Christophe Gisquet wrote: Hi, 2014-10-26 19:20 GMT+01:00 Michael Niedermayer michae...@gmx.at: I took the liberty to apply the patch and fix the bug instead of leaving it open until someone succeeds writing a fate test for it Hi, I wonder whether this should be reverted for now (and ticket #2970 reopened at the same time). The patch fixes decoder artifacts, i dont think we should just revert it unless it causes artifacts in some other (known to be good) file I have been checking how to produce interlaced content through the encoder, and the current table produces worse results (PSNR-wise, but it was big enough to not bother checking visually). I don't know if that's an encoder issue yet or if the decoder table is still incorrect. did you try to decode with a known to be correct decoder ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi: add xbr filter
On date Thursday 2014-10-30 18:23:35 +0530, arwa arif encoded: On Wed, Oct 29, 2014 at 3:36 AM, Clément Bœsch u...@pkh.me wrote: On Tue, Oct 28, 2014 at 10:51:27PM +0100, Michael Niedermayer wrote: On Tue, Oct 28, 2014 at 07:16:45PM +0100, Clément Bœsch wrote: On Tue, Oct 28, 2014 at 06:30:34PM +0100, Stefano Sabatini wrote: [...] How much effort would it take to implement the remaining scaling modes? According to https://ffmpeg.org/pipermail/ffmpeg-devel/2014-October/164574.html I think 4x can be done fast enough, but 3x will take time. [...] +typedef struct { +uint32_t rgbtoyuv[124]; We should avoid this 64MiB. Also the table should be possibly static, so you don't have to fill it per each xBR instance. So, I requested to do it exactly the same as HQx because this part is common according to the specifications. This should be kept the same vf_hqx, and then factorized. Now about removing this allocation, I did benchmark this LUT vs computation (see attached patch for comp. version). And the problem is that it's slightly slower, probably due to the /1000. why do you divide at all ? cant you do the computations with full precission ? I wasn't able to... but I was probably doing it wrong. And anyway, so far I observed this: lut: 127fps nolut+div: 119fps nolut+nodiv: 123fps So even with fast computation, it's still slower than the LUT. It probably doesn't matter that much in practice, and dropping that huge table might be worth the performance impact (feel free to discuss). Note that looking at the original code (which was working on rgb565 only), it was bitexact. The rgb 24-bit was added in the modern hqx with float point. So we can probably tolerate the inaccuracy. Still, if you find a way of keeping full accuracy with the modern implementation... Typically, I tried stuff like this: const uint32_t y = (uint32_t)((1225*r + 2404*g + 467*b + (111)) 12); const uint32_t u = (uint32_t)((-692*r - 1356*g + 2048*b + (111)) 12) + 128; const uint32_t v = (uint32_t)((2048*r - 1716*g - 332*b + (111)) 12) + 128; ...but I'm probably doing it very wrong somewhere (sign issue maybe?), haven't looked deeper. I went up to 15 bits, still didn't match, so I was probably doing something stupid. also instead of doing 2 rgb2yuv and then taking their difference you can do the difference in rgb space and convert the rgb difference to a yuv difference its just aM - bM = (a-b)M Ah, sounds like a good idea, I guess I'll try that. [...] -- Clément B. Updated the patch. How should I finally go about converting rgb to yuv? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 905fb0f15033e447fc344097dd649ca671fa1074 Mon Sep 17 00:00:00 2001 From: Arwa Arif arwaarif1...@gmail.com Date: Thu, 30 Oct 2014 18:05:45 +0530 Subject: [PATCH] [PATCH]lvafi: add xbr filter lavfi: add xbr filter --- doc/filters.texi | 81 ++-- what happened with this? Did you edit the patch by hand? I can't apply the patch... libavfilter/Makefile |1 + libavfilter/allfilters.c |1 + libavfilter/vf_xbr.c | 319 ++ 4 files changed, 335 insertions(+), 67 deletions(-) create mode 100644 libavfilter/vf_xbr.c [...] -- FFmpeg = Fostering Fundamental Minimal Plastic Enhanced Geisha ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] psy_snr:Psychoacoustic SNR for audio files
Implemented an SNR for audio files which takes into a account the psychoacoustic masking. This results in an SNR which is closer to how humans percieve sound, compared to tiny_psnr which directly compares audio signals Signed-off-by: Senjuti Kundu senjutikund...@gmail.com --- tests/psy_snr.c | 421 1 file changed, 421 insertions(+) create mode 100644 tests/psy_snr.c diff --git a/tests/psy_snr.c b/tests/psy_snr.c new file mode 100644 index 000..94041ed --- /dev/null +++ b/tests/psy_snr.c @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2003 Michael Niedermayer michae...@gmx.at + * + * 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 + */ + +/* + * Psy-SNR - Psychoacoustic SNR for audio files. + * Author - Senjuti Kundu senjutikund...@gmail.com + * Input format - tiny_psysnr file1 file2 + * [elem size|u8|s16|f32|f64 [shift [skip bytes [shift search range + * WAV headers are skipped automatically. + * SIZE can be changed to adjust window size as need be. + * compile using gcc psysnr.c $(pkg-config --cflags --libs libavformat libavcodec) + * -I /usr/local/include/libavcodec/ + */ + +#include stdio.h +#include stdlib.h +#include string.h +#include inttypes.h +#include math.h +#include float.h +#include limits.h + +#include libavutil/intfloat.h +#include libavutil/intreadwrite.h +#include libavcodec/avfft.h +#include libavutil/mem.h + +#define FFMIN(a, b) ((a) (b) ? (b) : (a)) +#define FFMAX(a, b) ((a) (b) ? (a) : (b)) +#define F 100 +//size should be close to 20k +#define SIZE 1024 +#define db_fw_rollof 4 +#define db_bw_rollof 4 +#define db_attenuation 0.1 + +uint64_t exp16_table[21] = { + 65537, + 65538, + 65540, + 65544, + 65552, + 65568, + 65600, + 65664, + 65793, + 66050, + 66568, + 67616, + 69763, + 74262, + 84150, + 108051, + 178145, + 484249, + 3578144, + 195360063, +582360139072LL, +}; + +#if 0 +// 16.16 fixpoint exp() +static unsigned int exp16(unsigned int a){ +int i; +int out= 116; + +for(i=19;i=0;i--){ +if(a(1i)) +out= (out*exp16_table[i] + (115))16; +} + +return out; +} +#endif + +// 16.16 fixpoint log() +static int64_t log16(uint64_t a) +{ +int i; +int out = 0; + +if (a 1 16) +return -log16((1LL 32) / a); +a = 16; + +for (i = 20; i = 0; i--) { +int64_t b = exp16_table[i]; +if (a (b 16)) +continue; +out |= 1 i; +a= ((a / b) 16) + (((a % b) 16) + b / 2) / b; +} +return out; +} + +static uint64_t int_sqrt(uint64_t a) +{ +uint64_t ret= 0; +uint64_t ret_sq = 0; +int s; + +for (s = 31; s = 0; s--) { +uint64_t b = ret_sq + (1ULL (s * 2)) + (ret s) * 2; +if (b = a) { +ret_sq = b; +ret += 1ULL s; +} +} +return ret; +} + +static int16_t get_s16l(uint8_t *p) +{ +union { +uint16_t u; +int16_t s; +} v; +v.u = p[0] | p[1] 8; +return v.s; +} + +static float get_f32l(uint8_t *p) +{ +union av_intfloat32 v; +v.i = p[0] | p[1] 8 | p[2] 16 | p[3] 24; +return v.f; +} + +static double get_f64l(uint8_t *p) +{ +return av_int2double(AV_RL64(p)); +} + +static float* get_mask_array(int tempsize){ +//modelling the mask function as a parabole. Others can be +//explored as need be. y=(-(x-mid)2+c)/c +int i = 0; +float* maskingfunc = malloc(tempsize*sizeof(float)); +maskingfunc[tempsize/2] = exp(-db_attenuation*log(10)); +for (i = (tempsize/2)+1; itempsize; i++){ +maskingfunc[i] = maskingfunc[i-1]*exp(-(db_fw_rollof*log(10))/(20*(i-(tempsize/2;; +} +for(i = (tempsize/2)-1; i = 0; i--){ +maskingfunc[i] = maskingfunc[i+1]*exp(-(2*db_bw_rollof*log(10))/(20*((tempsize/2)-i))); +} +return maskingfunc; +} + +static float* get_mask(FFTComplex* a, int tempsize, float* maskingfunc){ +int i = 0; +int j = 0; +float* mask = malloc(tempsize*sizeof(float)); +float self = 0; +float next = 0; +float prev = 0; + +for (i =
Re: [FFmpeg-devel] Encode2() function in libavcodec/avcodec.h
On Thu, Oct 30, 2014 at 11:31:25AM +0530, greeshma wrote: Hi, the attributes has been changed to (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); what is the exact change made in the function. if you want to know which commit introduced a change there is git blame and git log -S / -G [...] -- 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
Re: [FFmpeg-devel] Use ffmpeg as an Android stagefright plugin
Also after adding new ffmpeg codecs to I still get a crash on H264 (avc) playback. Added ffmpeg codecs to device/renesas/emev/media_codecs.xml Rebuilt... test... still crashing: V/AwesomePlayer( 758): track of type 'video/avc' does not publish bitrate V/AwesomePlayer( 758): mBitrate = -1 bits/sec V/AwesomePlayer( 758): haveAudio:1, haveVideo:1 V/AwesomePlayer( 758): initVideoDecoder flags=0x0 I/EV2OMXPlugin( 758): ***run OMFPlugin --- makeComponentInstance I/OMXCodec( 758): [OMX.RENESAS.VIDEO.DECODER.H264] AVC profile = 66 (Baseline), level = 30 I/OMXCodec( 758): [OMX.RENESAS.VIDEO.DECODER.H264] video dimensions are 640 x 344 E/OMXNodeInstance( 758): OMX_GetExtensionIndex (index:'7fff') failed I/EV2OMXPlugin( 758): ***run OMFPlugin --- destroyComponentInstance E/OMXMaster( 758): Invalid OMX component name 'OMX.ffmpeg.h264.decoder' E/MediaPlayer( 996): error (1, -2147483648) E/MediaPlayer( 996): Error (1,-2147483648) W/YouTube ( 996): (unknown) MediaPlayer error during prepare [what=1, extra=-2147483648] W/YouTube ( 996): (unknown) Retrying MediaPlayer error [retry=1, max=3] F/libc( 758): @@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x2a023ad0 F/libc( 758): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 794 (Binder_2) ... I/DEBUG ( 70): #00 pc 000137b8 /system/lib/libc.so I/DEBUG ( 70): #01 pc 00015b95 /system/lib/libc.so (dlfree+1628) I/DEBUG ( 70): #02 pc 00016d43 /system/lib/libc.so (free+10) I/DEBUG ( 70): #03 pc 0007a853 /system/lib/libstagefright.so I/DEBUG ( 70): #04 pc 0007ac0d /system/lib/libstagefright.so (android::TimedEventQueue::~TimedEventQueue()+36) I/DEBUG ( 70): #05 pc 000538ad /system/lib/libstagefright.so (android::AwesomePlayer::~AwesomePlayer()+288) On Thursday, 30 October 2014 03:09:35 UTC-7, Fabio Fumi wrote: Hi Chih, I've completed the merge of frameworks/av and framewroks/native and added the stagefright-plugins and ffmpeg to my project. I enabld the USES_NAM and built new system. Startup wnet fine, but on YouTube test playback (which went just fine before), I get a crash (below). Note how I haven't enabled he new ffmpeg codecs in media_codecs.xml and I'm using Google SW codec for h264: MediaCodec name=OMX.google.h264.decoder type=video/avc/ Suggestions? thanks Fabio ... D/H264Dec ( 707): H264SwDecInit# D/H264Dec ( 707): H264SwDecInit# decInst 0x2a055c08 noOutputReordering 0 D/H264Dec ( 707): H264SwDecInit# OK: return 0x2a0b1238 I/OMXCodec( 707): [OMX.google.h264.decoder] AVC profile = 66 (Baseline), level = 30 I/OMXCodec( 707): [OMX.google.h264.decoder] video dimensions are 320 x 240 I/OMXCodec( 707): [OMX.google.h264.decoder] Crop rect is 320 x 240 @ (0, 0) ... D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): Access unit boundary D/H264_decoder( 707): SEQ PARAM SET D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 1 D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): Access unit boundary D/H264_decoder( 707): PIC PARAM SET D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 1 D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): Access unit boundary D/H264_decoder( 707): IDR D/H264_decoder( 707): SLICE HEADER D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 4 D/H264Dec ( 707): H264SwDecGetInfo# D/H264Dec ( 707): H264SwDecGetInfo# decInst 0x2a0b1238 pDecInfo 0x4201eda8 D/H264Dec ( 707): H264SwDecGetInfo# OK D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): IDR D/H264_decoder( 707): SLICE HEADER D/H264_decoder( 707): (null) D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 2 D/H264Dec ( 707): H264SwDecNextPicture# D/H264Dec ( 707): H264SwDecNextPicture# decInst 0x2a0b1238 pOutput 0x4201ed98 flushBuffer 0 D/H264Dec ( 707): H264SwDecNextPicture# OK: return H264SWDEC_PIC_RDY F/libc( 707): Fatal signal 11 (SIGSEGV) at 0x0008 (code=1), thread 1818 (le.h264.decoder) ... I/DEBUG ( 70): #00 pc 00011ed0 /system/lib/libc.so I/DEBUG ( 70): #01 pc ad6b /system/lib/libstagefright_omx.so (android::OMX::CallbackDispatcher::post(android::omx_message const)+14) I/DEBUG ( 70): #02 pc b5e5 /system/lib/libstagefright_omx.so (android::OMX::OnEmptyBufferDone(void*, OMX_BUFFERHEADERTYPE*)+30) I/DEBUG ( 70): #03 pc ebd9 /system/lib/libstagefright_omx.so (android::SoftOMXComponent::notifyEmptyBufferDone(OMX_BUFFERHEADERTYPE*)+16) I/DEBUG ( 70): #04 pc 9f60
Re: [FFmpeg-devel] Use ffmpeg as an Android stagefright plugin
Hi Chih, I've completed the merge of frameworks/av and framewroks/native and added the stagefright-plugins and ffmpeg to my project. I enabld the USES_NAM and built new system. Startup wnet fine, but on YouTube test playback (which went just fine before), I get a crash (below). Note how I haven't enabled he new ffmpeg codecs in media_codecs.xml and I'm using Google SW codec for h264: MediaCodec name=OMX.google.h264.decoder type=video/avc/ Suggestions? thanks Fabio ... D/H264Dec ( 707): H264SwDecInit# D/H264Dec ( 707): H264SwDecInit# decInst 0x2a055c08 noOutputReordering 0 D/H264Dec ( 707): H264SwDecInit# OK: return 0x2a0b1238 I/OMXCodec( 707): [OMX.google.h264.decoder] AVC profile = 66 (Baseline), level = 30 I/OMXCodec( 707): [OMX.google.h264.decoder] video dimensions are 320 x 240 I/OMXCodec( 707): [OMX.google.h264.decoder] Crop rect is 320 x 240 @ (0, 0) ... D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): Access unit boundary D/H264_decoder( 707): SEQ PARAM SET D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 1 D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): Access unit boundary D/H264_decoder( 707): PIC PARAM SET D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 1 D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): Access unit boundary D/H264_decoder( 707): IDR D/H264_decoder( 707): SLICE HEADER D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 4 D/H264Dec ( 707): H264SwDecGetInfo# D/H264Dec ( 707): H264SwDecGetInfo# decInst 0x2a0b1238 pDecInfo 0x4201eda8 D/H264Dec ( 707): H264SwDecGetInfo# OK D/H264Dec ( 707): H264SwDecDecode# D/H264Dec ( 707): H264SwDecDecode# decInst 0x2a0b1238 pInput 0x4201ed88 pOutput 0x4201ed7c D/H264_decoder( 707): IDR D/H264_decoder( 707): SLICE HEADER D/H264_decoder( 707): (null) D/H264Dec ( 707): H264SwDecDecode# OK: DecResult 2 D/H264Dec ( 707): H264SwDecNextPicture# D/H264Dec ( 707): H264SwDecNextPicture# decInst 0x2a0b1238 pOutput 0x4201ed98 flushBuffer 0 D/H264Dec ( 707): H264SwDecNextPicture# OK: return H264SWDEC_PIC_RDY F/libc( 707): Fatal signal 11 (SIGSEGV) at 0x0008 (code=1), thread 1818 (le.h264.decoder) ... I/DEBUG ( 70): #00 pc 00011ed0 /system/lib/libc.so I/DEBUG ( 70): #01 pc ad6b /system/lib/libstagefright_omx.so (android::OMX::CallbackDispatcher::post(android::omx_message const)+14) I/DEBUG ( 70): #02 pc b5e5 /system/lib/libstagefright_omx.so (android::OMX::OnEmptyBufferDone(void*, OMX_BUFFERHEADERTYPE*)+30) I/DEBUG ( 70): #03 pc ebd9 /system/lib/libstagefright_omx.so (android::SoftOMXComponent::notifyEmptyBufferDone(OMX_BUFFERHEADERTYPE*)+16) I/DEBUG ( 70): #04 pc 9f60 /system/lib/libstagefright_soft_h264dec.so (android::SoftAVC::onQueueFilled(unsigned long)+508) On Sunday, 11 August 2013 01:25:25 UTC-7, Chih-Wei Huang wrote: Hello ffmpeg list, I'm planning to integrate the latest ffmpeg as a stagefright OMXPlugin with Android-x86 4.3. I found the stagefright-plugins developed by Michael Chen is a good start. (repo: https://github.com/omxcodec/stagefright-plugins.git) But it's based on android 4.0 (ICS). My plan is: * Update stagefright-plugins to work with stagefright of android 4.3. * Make it to be a libstagefrighthw.so plugin. * Create Android.mk to build ffmpeg libs. Before I go ahead, I'd like to know if anyone is doing a similar project to avoid duplicate work. Thanks a lot! -- Chih-Wei Android-x86 project http://www.android-x86.org ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] psy_snr:Psychoacoustic SNR for audio files
On Thu, Oct 30, 2014 at 11:33:51PM +0530, Senjuti Kundu wrote: Implemented an SNR for audio files which takes into a account the psychoacoustic masking. This results in an SNR which is closer to how humans percieve sound, compared to tiny_psnr which directly compares audio signals Signed-off-by: Senjuti Kundu senjutikund...@gmail.com --- tests/psy_snr.c | 421 1 file changed, 421 insertions(+) create mode 100644 tests/psy_snr.c diff --git a/tests/psy_snr.c b/tests/psy_snr.c new file mode 100644 index 000..94041ed --- /dev/null +++ b/tests/psy_snr.c @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2003 Michael Niedermayer michae...@gmx.at + * + * 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 + */ + +/* + * Psy-SNR - Psychoacoustic SNR for audio files. + * Author - Senjuti Kundu senjutikund...@gmail.com + * Input format - tiny_psysnr file1 file2 + * [elem size|u8|s16|f32|f64 [shift [skip bytes [shift search range + * WAV headers are skipped automatically. + * SIZE can be changed to adjust window size as need be. + * compile using gcc psysnr.c $(pkg-config --cflags --libs libavformat libavcodec) + * -I /usr/local/include/libavcodec/ + */ + +#include stdio.h +#include stdlib.h +#include string.h +#include inttypes.h +#include math.h +#include float.h +#include limits.h + +#include libavutil/intfloat.h +#include libavutil/intreadwrite.h +#include libavcodec/avfft.h +#include libavutil/mem.h + +#define FFMIN(a, b) ((a) (b) ? (b) : (a)) +#define FFMAX(a, b) ((a) (b) ? (a) : (b)) +#define F 100 +//size should be close to 20k +#define SIZE 1024 +#define db_fw_rollof 4 +#define db_bw_rollof 4 +#define db_attenuation 0.1 #defines should be all uppercase + +uint64_t exp16_table[21] = { + 65537, + 65538, + 65540, + 65544, + 65552, + 65568, + 65600, + 65664, + 65793, + 66050, + 66568, + 67616, + 69763, + 74262, + 84150, + 108051, + 178145, + 484249, + 3578144, + 195360063, +582360139072LL, +}; + +#if 0 +// 16.16 fixpoint exp() +static unsigned int exp16(unsigned int a){ +int i; +int out= 116; + +for(i=19;i=0;i--){ +if(a(1i)) +out= (out*exp16_table[i] + (115))16; +} + +return out; +} +#endif + +// 16.16 fixpoint log() +static int64_t log16(uint64_t a) +{ +int i; +int out = 0; + +if (a 1 16) +return -log16((1LL 32) / a); +a = 16; + +for (i = 20; i = 0; i--) { +int64_t b = exp16_table[i]; +if (a (b 16)) +continue; +out |= 1 i; +a= ((a / b) 16) + (((a % b) 16) + b / 2) / b; +} +return out; +} + +static uint64_t int_sqrt(uint64_t a) +{ +uint64_t ret= 0; +uint64_t ret_sq = 0; +int s; + +for (s = 31; s = 0; s--) { +uint64_t b = ret_sq + (1ULL (s * 2)) + (ret s) * 2; +if (b = a) { +ret_sq = b; +ret += 1ULL s; +} +} +return ret; +} + these functions look duplicated from tiny_psnr, it would be better to share them +static int16_t get_s16l(uint8_t *p) +{ +union { +uint16_t u; +int16_t s; +} v; +v.u = p[0] | p[1] 8; +return v.s; +} + +static float get_f32l(uint8_t *p) +{ +union av_intfloat32 v; +v.i = p[0] | p[1] 8 | p[2] 16 | p[3] 24; +return v.f; +} + +static double get_f64l(uint8_t *p) +{ +return av_int2double(AV_RL64(p)); +} + +static float* get_mask_array(int tempsize){ +//modelling the mask function as a parabole. Others can be +//explored as need be. y=(-(x-mid)2+c)/c +int i = 0; +float* maskingfunc = malloc(tempsize*sizeof(float)); +maskingfunc[tempsize/2] = exp(-db_attenuation*log(10)); +for (i = (tempsize/2)+1; itempsize; i++){ +maskingfunc[i] = maskingfunc[i-1]*exp(-(db_fw_rollof*log(10))/(20*(i-(tempsize/2;; double ; +} +for(i = (tempsize/2)-1;
Re: [FFmpeg-devel] [PATCH] lavfi: add xbr filter
On Thu, Oct 30, 2014 at 9:34 PM, Stefano Sabatini stefa...@gmail.com wrote: On date Thursday 2014-10-30 18:23:35 +0530, arwa arif encoded: On Wed, Oct 29, 2014 at 3:36 AM, Clément Bœsch u...@pkh.me wrote: On Tue, Oct 28, 2014 at 10:51:27PM +0100, Michael Niedermayer wrote: On Tue, Oct 28, 2014 at 07:16:45PM +0100, Clément Bœsch wrote: On Tue, Oct 28, 2014 at 06:30:34PM +0100, Stefano Sabatini wrote: [...] How much effort would it take to implement the remaining scaling modes? According to https://ffmpeg.org/pipermail/ffmpeg-devel/2014-October/164574.html I think 4x can be done fast enough, but 3x will take time. [...] +typedef struct { +uint32_t rgbtoyuv[124]; We should avoid this 64MiB. Also the table should be possibly static, so you don't have to fill it per each xBR instance. So, I requested to do it exactly the same as HQx because this part is common according to the specifications. This should be kept the same vf_hqx, and then factorized. Now about removing this allocation, I did benchmark this LUT vs computation (see attached patch for comp. version). And the problem is that it's slightly slower, probably due to the /1000. why do you divide at all ? cant you do the computations with full precission ? I wasn't able to... but I was probably doing it wrong. And anyway, so far I observed this: lut: 127fps nolut+div: 119fps nolut+nodiv: 123fps So even with fast computation, it's still slower than the LUT. It probably doesn't matter that much in practice, and dropping that huge table might be worth the performance impact (feel free to discuss). Note that looking at the original code (which was working on rgb565 only), it was bitexact. The rgb 24-bit was added in the modern hqx with float point. So we can probably tolerate the inaccuracy. Still, if you find a way of keeping full accuracy with the modern implementation... Typically, I tried stuff like this: const uint32_t y = (uint32_t)((1225*r + 2404*g + 467*b + (111)) 12); const uint32_t u = (uint32_t)((-692*r - 1356*g + 2048*b + (111)) 12) + 128; const uint32_t v = (uint32_t)((2048*r - 1716*g - 332*b + (111)) 12) + 128; ...but I'm probably doing it very wrong somewhere (sign issue maybe?), haven't looked deeper. I went up to 15 bits, still didn't match, so I was probably doing something stupid. also instead of doing 2 rgb2yuv and then taking their difference you can do the difference in rgb space and convert the rgb difference to a yuv difference its just aM - bM = (a-b)M Ah, sounds like a good idea, I guess I'll try that. [...] -- Clément B. Updated the patch. How should I finally go about converting rgb to yuv? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 905fb0f15033e447fc344097dd649ca671fa1074 Mon Sep 17 00:00:00 2001 From: Arwa Arif arwaarif1...@gmail.com Date: Thu, 30 Oct 2014 18:05:45 +0530 Subject: [PATCH] [PATCH]lvafi: add xbr filter lavfi: add xbr filter --- doc/filters.texi | 81 ++-- what happened with this? Did you edit the patch by hand? I can't apply the patch... libavfilter/Makefile |1 + libavfilter/allfilters.c |1 + libavfilter/vf_xbr.c | 319 ++ 4 files changed, 335 insertions(+), 67 deletions(-) create mode 100644 libavfilter/vf_xbr.c [...] -- FFmpeg = Fostering Fundamental Minimal Plastic Enhanced Geisha ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From b9b56b594f856fef8b113b283df2d2045e8357f7 Mon Sep 17 00:00:00 2001 From: Arwa Arif arwaarif1...@gmail.com Date: Thu, 30 Oct 2014 22:06:20 +0530 Subject: [PATCH] [PATCH]lvafi: add xbr filter --- doc/filters.texi |5 + libavfilter/Makefile |1 + libavfilter/allfilters.c |1 + libavfilter/vf_xbr.c | 319 ++ 4 files changed, 326 insertions(+) create mode 100644 libavfilter/vf_xbr.c diff --git a/doc/filters.texi b/doc/filters.texi index 7be29de..2905e5d 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -9163,6 +9163,11 @@ Only deinterlace frames marked as interlaced. Default value is @samp{all}. @end table +@section xbr +Apply high-quality magnification filter which is designed for pixel art. It follows a set +of edge-detection rules @url{http://www.libretro.com/forums/viewtopic.php?f=6t=134}. +This filter was originally created by Hyllian. + @anchor{yadif} @section yadif diff --git a/libavfilter/Makefile
[FFmpeg-devel] [PATCH] libxcb-xshape in configure.
This is my attempt at fixing the broken build because xcbgrab uses xcb_shape_rectangles, but doesn't link xcb-shape. Signed-off-by: Horváth Balázs q...@qroa.ch --- configure | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e6e3de3..49feee3 100755 --- a/configure +++ b/configure @@ -254,6 +254,7 @@ External library support: --enable-libxcb enable X11 grabbing using XCB [auto] --enable-libxcb-shm enable X11 grabbing shm communication [auto] --enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto] + --enable-libxcb-xshape enable X11 grabbing shape rendering [auto] --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-libzmq enable message passing via libzmq [no] @@ -1387,6 +1388,7 @@ EXTERNAL_LIBRARY_LIST= libxcb libxcb_shm libxcb_xfixes +libxcb_shape libxvid libzmq libzvbi @@ -5040,8 +5042,13 @@ if enabled libxcb; then enabled libxcb_xfixes die ERROR: libxcb_xfixes not found; } enable libxcb_xfixes; } -add_cflags $xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags -add_extralibs $xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs +disabled libxcb_shape || { +check_pkg_config xcb-shape xcb/shape.h xcb_shape_rectangles || { +enabled libxcb_shape die ERROR: libxcb_shape not found; +} enable libxcb_shape; } + +add_cflags $xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags +add_extralibs $xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_cflags fi fi -- 2.1.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libxcb-xhsape in configure
This is my attempt at fixing the broken build because xcbgrab uses xcb_shape_rectangles, but doesn't link xcb-shape. Horváth Balázs (1): libxcb-xshape in configure. configure | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.1.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libxcb-xshape in configure.
On Thu, Oct 30, 2014 at 09:26:17PM +0100, Horváth Balázs wrote: This is my attempt at fixing the broken build because xcbgrab uses xcb_shape_rectangles, but doesn't link xcb-shape. Signed-off-by: Horváth Balázs q...@qroa.ch --- configure | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e6e3de3..49feee3 100755 --- a/configure +++ b/configure @@ -254,6 +254,7 @@ External library support: --enable-libxcb enable X11 grabbing using XCB [auto] --enable-libxcb-shm enable X11 grabbing shm communication [auto] --enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto] + --enable-libxcb-xshape enable X11 grabbing shape rendering [auto] --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-libzmq enable message passing via libzmq [no] @@ -1387,6 +1388,7 @@ EXTERNAL_LIBRARY_LIST= libxcb libxcb_shm libxcb_xfixes +libxcb_shape libxvid libzmq libzvbi @@ -5040,8 +5042,13 @@ if enabled libxcb; then enabled libxcb_xfixes die ERROR: libxcb_xfixes not found; } enable libxcb_xfixes; } -add_cflags $xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags -add_extralibs $xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs +disabled libxcb_shape || { +check_pkg_config xcb-shape xcb/shape.h xcb_shape_rectangles || { +enabled libxcb_shape die ERROR: libxcb_shape not found; +} enable libxcb_shape; } + +add_cflags $xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags +add_extralibs $xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_cflags doesnt this still break build if someone uses --disable-libxcb-xshape ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User questions about the command line tools should be sent to the ffmpeg-user ML. And questions about how to use libav* should be sent to the libav-user ML. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] ffplay: implement separete audio decoder thread
On Thu, 30 Oct 2014, wm4 wrote: On Thu, 30 Oct 2014 00:31:25 +0100 Marton Balint c...@passwd.hu wrote: Signed-off-by: Marton Balint c...@passwd.hu --- ffplay.c | 265 --- 1 file changed, 153 insertions(+), 112 deletions(-) diff --git a/ffplay.c b/ffplay.c index a979164..24bcae2 100644 --- a/ffplay.c +++ b/ffplay.c @@ -121,7 +121,8 @@ typedef struct PacketQueue { #define VIDEO_PICTURE_QUEUE_SIZE 3 #define SUBPICTURE_QUEUE_SIZE 16 -#define FRAME_QUEUE_SIZE FFMAX(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE) +#define SAMPLE_QUEUE_SIZE 9 +#define FRAME_QUEUE_SIZE FFMAX(SAMPLE_QUEUE_SIZE, FFMAX(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE)) typedef struct AudioParams { int freq; @@ -196,6 +197,7 @@ typedef struct Decoder { typedef struct VideoState { SDL_Thread *read_tid; SDL_Thread *video_tid; +SDL_Thread *audio_tid; AVInputFormat *iformat; int no_background; int abort_request; @@ -217,6 +219,7 @@ typedef struct VideoState { FrameQueue pictq; FrameQueue subpq; +FrameQueue sampq; Decoder auddec; Decoder viddec; @@ -242,8 +245,6 @@ typedef struct VideoState { unsigned int audio_buf1_size; int audio_buf_index; /* in bytes */ int audio_write_buf_size; -int audio_buf_frames_pending; -int audio_last_serial; struct AudioParams audio_src; #if CONFIG_AVFILTER struct AudioParams audio_filter_src; @@ -252,7 +253,6 @@ typedef struct VideoState { struct SwrContext *swr_ctx; int frame_drops_early; int frame_drops_late; -AVFrame *frame; enum ShowMode { SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB @@ -712,12 +712,29 @@ static Frame *frame_queue_peek_writable(FrameQueue *f) return f-queue[f-windex]; } +static Frame *frame_queue_peek_readable(FrameQueue *f) +{ +/* wait until we have a readable a new frame */ +SDL_LockMutex(f-mutex); +while (f-size - f-rindex_shown = 0 + !f-pktq-abort_request) { +SDL_CondWait(f-cond, f-mutex); +} +SDL_UnlockMutex(f-mutex); + +if (f-pktq-abort_request) +return NULL; + +return f-queue[(f-rindex + f-rindex_shown) % f-max_size]; +} + static void frame_queue_push(FrameQueue *f) { if (++f-windex == f-max_size) f-windex = 0; SDL_LockMutex(f-mutex); f-size++; +SDL_CondSignal(f-cond); SDL_UnlockMutex(f-mutex); } @@ -1280,6 +1297,7 @@ static void stream_close(VideoState *is) /* free all pictures */ frame_queue_destory(is-pictq); +frame_queue_destory(is-sampq); frame_queue_destory(is-subpq); SDL_DestroyCond(is-continue_read_thread); #if !CONFIG_AVFILTER @@ -2100,6 +2118,93 @@ end: } #endif /* CONFIG_AVFILTER */ +static int audio_thread(void *arg) +{ +VideoState *is = arg; +AVFrame *frame = av_frame_alloc(); +Frame *af; +#if CONFIG_AVFILTER +int last_serial = -1; +int64_t dec_channel_layout; +int reconfigure; +#endif +int got_frame = 0; +AVRational tb; +int ret = 0; + +if (!frame) +return AVERROR(ENOMEM); + +do { +if ((got_frame = decoder_decode_frame(is-auddec, frame, NULL)) 0) +goto the_end; + +if (got_frame) { +tb = (AVRational){1, frame-sample_rate}; + +#if CONFIG_AVFILTER +dec_channel_layout = get_valid_channel_layout(frame-channel_layout, av_frame_get_channels(frame)); + +reconfigure = +cmp_audio_fmts(is-audio_filter_src.fmt, is-audio_filter_src.channels, + frame-format, av_frame_get_channels(frame))|| +is-audio_filter_src.channel_layout != dec_channel_layout || +is-audio_filter_src.freq != frame-sample_rate || +is-auddec.pkt_serial != last_serial; + +if (reconfigure) { +char buf1[1024], buf2[1024]; +av_get_channel_layout_string(buf1, sizeof(buf1), -1, is-audio_filter_src.channel_layout); +av_get_channel_layout_string(buf2, sizeof(buf2), -1, dec_channel_layout); +av_log(NULL, AV_LOG_DEBUG, + Audio frame changed from rate:%d ch:%d fmt:%s layout:%s serial:%d to rate:%d ch:%d fmt:%s layout:%s serial:%d\n, + is-audio_filter_src.freq, is-audio_filter_src.channels, av_get_sample_fmt_name(is-audio_filter_src.fmt), buf1, last_serial, + frame-sample_rate, av_frame_get_channels(frame), av_get_sample_fmt_name(frame-format), buf2, is-auddec.pkt_serial); + +is-audio_filter_src.fmt= frame-format; +is-audio_filter_src.channels = av_frame_get_channels(frame); +is-audio_filter_src.channel_layout = dec_channel_layout;
Re: [FFmpeg-devel] FFserver bug?
On Fri, Oct 31, 2014 at 02:14:29AM +0100, Sevan Gelici wrote: Hi, Two days ago i updated my linux system and also ffmpeg was updated. When i started to stream it was not working anymore. I am using ffserver. i determined the problem which causes the problem thats the bitrate it makes like 50mb of it. i reinstalled the system a couple times because of some tests and still i don't get it work. Can someone help me with this pls. do you know which commit / revission has caused the regression ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB DNS cache poisoning attacks, popular search engine, Google internet authority dont be evil, please signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel