Re: [FFmpeg-devel] [PATCH v15] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread 刘歧

> 在 2017年8月30日,14:38,samsamsam  写道:
> 
> But you do not added this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
What will happen when $Number%02s%08d$ 
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
>   format_len = end - start - marker_len - 1 + strlen(PRId64);
>   *o_format = av_mallocz(format_len+1);
>   strncpy(*o_format, start + marker_len, end - start - marker_len -1);
>   strcat(*o_format, PRId64);
> …
> }
> 
> modification. Right?
> 
> Dnia 30 sierpnia 2017 00:04 Liu Steven  napisał(a):
> 
> 在 2017年8月30日,上午3:30,samsamsam  写道:
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> What? With my solution this is not problem.
> Why you think %s%d%d%d%d or %02c%lld give any problem?
> 
> localhost:dash StevenLiu$ ./ffmpeg -i /tmp/dash.mpd
> ffmpeg version N-87079-g257f0d09f7 Copyright (c) 2000-2017 the FFmpeg 
> developers
> built with Apple LLVM version 8.1.0 (clang-802.0.42)
> configuration: --enable-libass --enable-opengl --enable-libx264 
> --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local 
> --enable-libopencv --enable-libtesseract --enable-libspeex 
> --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac 
> --enable-videotoolbox --enable-libxml2
> libavutil  55. 74.100 / 55. 74.100
> libavcodec 57.103.101 / 57.103.101
> libavformat57. 78.100 / 57. 78.100
> libavdevice57.  7.101 / 57.  7.101
> libavfilter 6.100.100 /  6.100.100
> libswscale  4.  7.103 /  4.  7.103
> libswresample   2.  8.100 /  2.  8.100
> libpostproc54.  6.100 / 54.  6.100
> [dash @ 0x7ffb76802a00] 11
> Segmentation fault: 11ted 1 times
> localhost:dash StevenLiu$ grep -r "%s%05d" /tmp/dash.mpd
> /tmp/dash.mpd: initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1">
> localhost:dash StevenLiu$
> 
> reproduce:
> ffmpeg -i input -c copy -f dash /tmp/dash.mpd
> vim /tmp/dash.mpd
> seek to `media="chunk-stream$RepresentationID`
> the context is `  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1”>`
> modify to:
>  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1”>
> 
> use your solution:
> ./ffmpeg -i /tmp/dash.mpd
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 12:27 刘歧  napisał(a):
> 
> 在 2017年8月28日,18:12,samsamsam  写道:
> 
> Validation will be very simple. I am talking about something like this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
>   format_len = end - start - marker_len - 1 + strlen(PRId64);
>   *o_format = av_mallocz(format_len+1);
>   strncpy(*o_format, start + marker_len, end - start - marker_len -1);
>   strcat(*o_format, PRId64);
> …
> }
> maybe more complex than this way, for example:
> %d
> %lld
> %04lld
> %PRId64
> %PRId32
> %PRId16
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> and so on,blablabla.
> 
> maybe we need to think a perfect solution.
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 11:30 Rodger Combs  napisał(a):
> 
> I would expect parsing the number internally and using the additional arg to 
> be simpler and easier to verify than format string validation.
> 
> On Aug 28, 2017, at 04:28, samsamsam  wrote:
> 
> OK. I will.
> What about adding validation of format instead of adding "something like 
> `"%0*"PRId64`"?
> 
> Dnia 28 sierpnia 2017 03:30 Rodger Combs  napisał(a):
> 
> If you know of such a vulnerability, report it to ffmpeg-secur...@ffmpeg.org. 
> New code with known vulnerabilities will not be accepted.
> 
> Sent from my iPhone
> 
> On Aug 27, 2017, at 14:04, samsamsam  wrote:
> get_repl_pattern_and_format, you should have a fixed value of something like 
> `"%0*"PRId64`
> 
> If you afraid about safety then the only thing which need to be added to 
> get_repl_pattern_and_format is validation of format.
> Simple loop to validate format will be enough. Do you agree?
> 
> Anyway we are talking about safety but parser for mp4 atoms missing checking 
> and there is quite easy to make segfault of the libavformat when try to 
> prepared mp4 file.
> 
> I understand that you want to have maximum safety with new code but I hope 
> you know that ffmpeg at all is not safety.
> 
> Regards,
> SSS
> 
> Dnia 27 sierpnia 2017 16:34 Rodger 

Re: [FFmpeg-devel] [PATCH v15] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread 刘歧

> 在 2017年8月30日,15:32,刘歧  写道:
> 
> 
>> 在 2017年8月30日,14:38,samsamsam  写道:
>> 
>> But you do not added this:
>> static int get_repl_pattern_and_format(const char *i_url, const char 
>> *i_marker, char **o_pattern, char **o_format)
>> {
>> ...
>> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
>> need to check this condition :P */
>> +if (*ptr != '0') {
> What will happen when $Number%02s%08d$ 

Test passed, now i have use a new function named get_segment_filename and the 
get_current_fragment,
that would check the file name ok or not.
>> +   // Unknown format add log here
>> +goto finish;
>> +}
>> +}
>>  format_len = end - start - marker_len - 1 + strlen(PRId64);
>>  *o_format = av_mallocz(format_len+1);
>>  strncpy(*o_format, start + marker_len, end - start - marker_len -1);
>>  strcat(*o_format, PRId64);
>> …
>> }
>> 
>> modification. Right?
>> 
>> Dnia 30 sierpnia 2017 00:04 Liu Steven  napisał(a):
>> 
>> 在 2017年8月30日,上午3:30,samsamsam  写道:
>> 
>> and think about the safety :
>> %02c%lld
>> %s%d%d%d%d
>> 
>> What? With my solution this is not problem.
>> Why you think %s%d%d%d%d or %02c%lld give any problem?
>> 
>> localhost:dash StevenLiu$ ./ffmpeg -i /tmp/dash.mpd
>> ffmpeg version N-87079-g257f0d09f7 Copyright (c) 2000-2017 the FFmpeg 
>> developers
>> built with Apple LLVM version 8.1.0 (clang-802.0.42)
>> configuration: --enable-libass --enable-opengl --enable-libx264 
>> --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local 
>> --enable-libopencv --enable-libtesseract --enable-libspeex 
>> --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac 
>> --enable-videotoolbox --enable-libxml2
>> libavutil  55. 74.100 / 55. 74.100
>> libavcodec 57.103.101 / 57.103.101
>> libavformat57. 78.100 / 57. 78.100
>> libavdevice57.  7.101 / 57.  7.101
>> libavfilter 6.100.100 /  6.100.100
>> libswscale  4.  7.103 /  4.  7.103
>> libswresample   2.  8.100 /  2.  8.100
>> libpostproc54.  6.100 / 54.  6.100
>> [dash @ 0x7ffb76802a00] 11
>> Segmentation fault: 11ted 1 times
>> localhost:dash StevenLiu$ grep -r "%s%05d" /tmp/dash.mpd
>> /tmp/dash.mpd:   > initialization="init-stream$RepresentationID$.m4s" 
>> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1">
>> localhost:dash StevenLiu$
>> 
>> reproduce:
>> ffmpeg -i input -c copy -f dash /tmp/dash.mpd
>> vim /tmp/dash.mpd
>> seek to `media="chunk-stream$RepresentationID`
>> the context is ` > initialization="init-stream$RepresentationID$.m4s" 
>> media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1”>`
>> modify to:
>> > initialization="init-stream$RepresentationID$.m4s" 
>> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1”>
>> 
>> use your solution:
>> ./ffmpeg -i /tmp/dash.mpd
>> 
>> 
>> 
>> 
>> Dnia 28 sierpnia 2017 12:27 刘歧  napisał(a):
>> 
>> 在 2017年8月28日,18:12,samsamsam  写道:
>> 
>> Validation will be very simple. I am talking about something like this:
>> static int get_repl_pattern_and_format(const char *i_url, const char 
>> *i_marker, char **o_pattern, char **o_format)
>> {
>> ...
>> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
>> need to check this condition :P */
>> +if (*ptr != '0') {
>> +   // Unknown format add log here
>> +goto finish;
>> +}
>> +}
>>  format_len = end - start - marker_len - 1 + strlen(PRId64);
>>  *o_format = av_mallocz(format_len+1);
>>  strncpy(*o_format, start + marker_len, end - start - marker_len -1);
>>  strcat(*o_format, PRId64);
>> …
>> }
>> maybe more complex than this way, for example:
>> %d
>> %lld
>> %04lld
>> %PRId64
>> %PRId32
>> %PRId16
>> 
>> and think about the safety :
>> %02c%lld
>> %s%d%d%d%d
>> 
>> and so on,blablabla.
>> 
>> maybe we need to think a perfect solution.
>> 
>> 
>> 
>> 
>> Dnia 28 sierpnia 2017 11:30 Rodger Combs  napisał(a):
>> 
>> I would expect parsing the number internally and using the additional arg to 
>> be simpler and easier to verify than format string validation.
>> 
>> On Aug 28, 2017, at 04:28, samsamsam  wrote:
>> 
>> OK. I will.
>> What about adding validation of format instead of adding "something like 
>> `"%0*"PRId64`"?
>> 
>> Dnia 28 sierpnia 2017 03:30 Rodger Combs  napisał(a):
>> 
>> If you know of such a vulnerability, report it to 
>> ffmpeg-secur...@ffmpeg.org. New code with known vulnerabilities will not be 
>> accepted.
>> 
>> Sent from my iPhone
>> 
>> On Aug 27, 2017, at 14:04, samsamsam  wrote:
>> get_repl_pattern_and_format, you should have a fixed value of something like 
>> `"%0*"PRId64`
>> 
>> If you afraid about safety then the only thing which need to be added to 
>> get_repl_pattern_and_format is validation of format.
>> Simple loop to validate format will be enough. Do you agree?
>> 
>> Anyway we are talking about safety but 

Re: [FFmpeg-devel] [PATCH v15] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread 刘歧

> 在 2017年8月30日,15:52,samsamsam  写道:
> 
> What will happen when $Number%02s%08d$
> 
> Exacly. Such format is not allowed by dash specification. So, such validation 
> is sufficient.
> 
> Please check DASH specification format like that $Number%02s%08d$ is not 
> allowed. 
> So what for you want to allow it?
No, you have not get the point.
The hackers won’t refer to specification and just broke the rule to get root 
shell.

Anyway, merge your code and will update a new version patch later.

> 
> Dnia 30 sierpnia 2017 09:32 刘歧  napisał(a):
> 
> 在 2017年8月30日,14:38,samsamsam  写道:
> 
> But you do not added this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> What will happen when $Number%02s%08d$
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
>  format_len = end - start - marker_len - 1 + strlen(PRId64);
>  *o_format = av_mallocz(format_len+1);
>  strncpy(*o_format, start + marker_len, end - start - marker_len -1);
>  strcat(*o_format, PRId64);
> …
> }
> 
> modification. Right?
> 
> Dnia 30 sierpnia 2017 00:04 Liu Steven  napisał(a):
> 
> 在 2017年8月30日,上午3:30,samsamsam  写道:
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> What? With my solution this is not problem.
> Why you think %s%d%d%d%d or %02c%lld give any problem?
> 
> localhost:dash StevenLiu$ ./ffmpeg -i /tmp/dash.mpd
> ffmpeg version N-87079-g257f0d09f7 Copyright (c) 2000-2017 the FFmpeg 
> developers
> built with Apple LLVM version 8.1.0 (clang-802.0.42)
> configuration: --enable-libass --enable-opengl --enable-libx264 
> --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local 
> --enable-libopencv --enable-libtesseract --enable-libspeex 
> --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac 
> --enable-videotoolbox --enable-libxml2
> libavutil  55. 74.100 / 55. 74.100
> libavcodec 57.103.101 / 57.103.101
> libavformat57. 78.100 / 57. 78.100
> libavdevice57.  7.101 / 57.  7.101
> libavfilter 6.100.100 /  6.100.100
> libswscale  4.  7.103 /  4.  7.103
> libswresample   2.  8.100 /  2.  8.100
> libpostproc54.  6.100 / 54.  6.100
> [dash @ 0x7ffb76802a00] 11
> Segmentation fault: 11ted 1 times
> localhost:dash StevenLiu$ grep -r "%s%05d" /tmp/dash.mpd
> /tmp/dash.mpd: initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1">
> localhost:dash StevenLiu$
> 
> reproduce:
> ffmpeg -i input -c copy -f dash /tmp/dash.mpd
> vim /tmp/dash.mpd
> seek to `media="chunk-stream$RepresentationID`
> the context is `  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1”>`
> modify to:
>  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1”>
> 
> use your solution:
> ./ffmpeg -i /tmp/dash.mpd
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 12:27 刘歧  napisał(a):
> 
> 在 2017年8月28日,18:12,samsamsam  写道:
> 
> Validation will be very simple. I am talking about something like this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
>  format_len = end - start - marker_len - 1 + strlen(PRId64);
>  *o_format = av_mallocz(format_len+1);
>  strncpy(*o_format, start + marker_len, end - start - marker_len -1);
>  strcat(*o_format, PRId64);
> …
> }
> maybe more complex than this way, for example:
> %d
> %lld
> %04lld
> %PRId64
> %PRId32
> %PRId16
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> and so on,blablabla.
> 
> maybe we need to think a perfect solution.
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 11:30 Rodger Combs  napisał(a):
> 
> I would expect parsing the number internally and using the additional arg to 
> be simpler and easier to verify than format string validation.
> 
> On Aug 28, 2017, at 04:28, samsamsam  wrote:
> 
> OK. I will.
> What about adding validation of format instead of adding "something like 
> `"%0*"PRId64`"?
> 
> Dnia 28 sierpnia 2017 03:30 Rodger Combs  napisał(a):
> 
> If you know of such a vulnerability, report it to ffmpeg-secur...@ffmpeg.org. 
> New code with known vulnerabilities will not be accepted.
> 
> Sent from my iPhone
> 
> On Aug 27, 2017, at 14:04, samsamsam  wrote:
> get_repl_pattern_and_format, you should have a fixed value of something like 
> `"%0*"PRId64`
> 
> If you afraid abou

[FFmpeg-devel] [PATCH v19] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
ffmpeg need a dash demuxer for demux the dash formats base on
https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch

TODO:
1. support multi bitrate dash

v2 fixed:
1. from autodetect to disabled
2. from camelCase code style to ffmpeg code style
3. from RepType to AVMediaType
4. fix variable typo
5. change time value from uint32_t to uint64_t
6. removed be used once API
7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and av_timegm
8. merge complex free operation to free_fragment
9. use API from snprintf to av_asprintf

v3 fixed:
1. fix typo from --enabled-xml2 to --enable-xml2

v4 fixed:
1. from --enable-xml2 to --enable-libxml2
2. move system includes to top
3. remove nouse includes
4. rename enum name
5. add a trailing comma for the last entry enum
6. fix comment typo
7. add const to DASHContext class front
8. check sscanf if return arguments and give warning message when error
9. check validity before free seg->url and seg
10. check if the val is null, before use atoll

v5 fixed:
1. fix typo from mainifest to manifest

v6 fixed:
1. from realloc to av_realloc
2. from free to av_free

v7 fixed:
1. remove the -lxml2 from configure when require_pkg_config

v8 fixed:
1. fix replace filename template by av_asprintf secure problem

v9 modified:
1. make manifest parser clearly

v10 fixed:
1. fix function API name code style
2. remove redundant strreplace call
3. remove redundant memory operation and check return value from 
get_content_url()
4. add space between ) and {
5. remove no need to log the value for print

v11 fixed:
1. from atoll to strtoll
Suggested-by: Michael Niedermayer 

v12 fixed:
1. remove strreplace and instead by av_strreplace
Suggested-by: Nicolas George 

v13 fixed:
1. fix bug: cannot play:
http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd
Reported-by: Andy Furniss 

v14 fixed:
1. fix bug: TLS connection was non-properly terminated
2. fix bug: No trailing CRLF found in HTTP header
Reported-by: Andy Furniss 

v15 fixed:
1. play youtube link: ffmpeg -i $(youtube-dl -J 
"https://www.youtube.com/watch?v=XmL19DOP_Ls"; | jq -r 
".requested_formats[0].manifest_url")
2. code refine for timeline living stream
Reported-by: Ricardo Constantino 

v16 fixed:
1. remove the snprintf and instead by get_segment_filename make safety
2. remove unnecessary loops
3. updated xmlStrcmp and xmlFree to av_* functions
4. merge code repeat into one function
5. add memory alloc faild check
6. update update_init_section and open_url
7. output safety error message when filename template not safe
Suggested-by : wm4 

v17 fixed:
1. add memory alloc faild check
2. fix resource space error at free_representation

v18 add condition of template format

Signed-off-by: Steven Liu 
Signed-off-by: samsamsam 
---
 configure|4 +
 libavformat/Makefile |1 +
 libavformat/allformats.c |2 +-
 libavformat/dashdec.c| 2032 ++
 4 files changed, 2038 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/dashdec.c

diff --git a/configure b/configure
index 61d8160491..c03ff02297 100755
--- a/configure
+++ b/configure
@@ -272,6 +272,7 @@ External library support:
   --enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect]
   --enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
+  --enable-libxml2 enable XML parsing using the C library libxml2 [no]
   --enable-libzimg enable z.lib, needed for zscale filter [no]
   --enable-libzmq  enable message passing via libzmq [no]
   --enable-libzvbi enable teletext support via libzvbi [no]
@@ -1578,6 +1579,7 @@ EXTERNAL_LIBRARY_LIST="
 libvpx
 libwavpack
 libwebp
+libxml2
 libzimg
 libzmq
 libzvbi
@@ -2939,6 +2941,7 @@ avi_muxer_select="riffenc"
 caf_demuxer_select="iso_media riffdec"
 caf_muxer_select="iso_media"
 dash_muxer_select="mp4_muxer"
+dash_demuxer_deps="libxml2"
 dirac_demuxer_select="dirac_parser"
 dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
@@ -6005,6 +6008,7 @@ enabled openssl   && { use_pkg_config openssl 
openssl/ssl.h OPENSSL_init
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
 enabled qtkit_indev  && { check_header_objcc QTKit/QTKit.h || disable 
qtkit_indev; }
+enabled libxml2  && require_pkg_config libxml-2.0 
libxml2/libxml/xmlversion.h xmlCheckVersion
 
 if enabled gcrypt; then
 GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index f2b465cfa2..3d478749d0 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -133,6 +133,7 @@ OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
 OBJS-$(CONFIG_DATA_DEMUXER)  +=

Re: [FFmpeg-devel] [PATCH v15] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread 刘歧

> 在 2017年8月30日,16:15,samsamsam  写道:
> 
> Sorry, my fault. Such simple check proposed by me is incorrect.
> It not handle basic "%05d" format.
That’s no matter samsamsam, if the string is not standard as specification 
describe, the result maybe need give an error.
So that is not a generic template, so fix it later :P
> 
> Dnia 30 sierpnia 2017 09:56 samsamsam  napisał(a):
> 
> What will happen when $Number%02s%08d$
> 
> Error will be returned because this format is not valid in the sense of dash 
> spec.
> 
> Dnia 30 sierpnia 2017 09:39 刘歧  napisał(a):
> 
> 在 2017年8月30日,15:32,刘歧  写道:
> 
> 
> 在 2017年8月30日,14:38,samsamsam  写道:
> 
> But you do not added this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> What will happen when $Number%02s%08d$
> 
> Test passed, now i have use a new function named get_segment_filename and the 
> get_current_fragment,
> that would check the file name ok or not.
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
> format_len = end - start - marker_len - 1 + strlen(PRId64);
> *o_format = av_mallocz(format_len+1);
> strncpy(*o_format, start + marker_len, end - start - marker_len -1);
> strcat(*o_format, PRId64);
> …
> }
> 
> modification. Right?
> 
> Dnia 30 sierpnia 2017 00:04 Liu Steven  napisał(a):
> 
> 在 2017年8月30日,上午3:30,samsamsam  写道:
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> What? With my solution this is not problem.
> Why you think %s%d%d%d%d or %02c%lld give any problem?
> 
> localhost:dash StevenLiu$ ./ffmpeg -i /tmp/dash.mpd
> ffmpeg version N-87079-g257f0d09f7 Copyright (c) 2000-2017 the FFmpeg 
> developers
> built with Apple LLVM version 8.1.0 (clang-802.0.42)
> configuration: --enable-libass --enable-opengl --enable-libx264 
> --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local 
> --enable-libopencv --enable-libtesseract --enable-libspeex 
> --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac 
> --enable-videotoolbox --enable-libxml2
> libavutil  55. 74.100 / 55. 74.100
> libavcodec 57.103.101 / 57.103.101
> libavformat57. 78.100 / 57. 78.100
> libavdevice57.  7.101 / 57.  7.101
> libavfilter 6.100.100 /  6.100.100
> libswscale  4.  7.103 /  4.  7.103
> libswresample   2.  8.100 /  2.  8.100
> libpostproc54.  6.100 / 54.  6.100
> [dash @ 0x7ffb76802a00] 11
> Segmentation fault: 11ted 1 times
> localhost:dash StevenLiu$ grep -r "%s%05d" /tmp/dash.mpd
> /tmp/dash.mpd: initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1">
> localhost:dash StevenLiu$
> 
> reproduce:
> ffmpeg -i input -c copy -f dash /tmp/dash.mpd
> vim /tmp/dash.mpd
> seek to `media="chunk-stream$RepresentationID`
> the context is `  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1”>`
> modify to:
>  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1”>
> 
> use your solution:
> ./ffmpeg -i /tmp/dash.mpd
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 12:27 刘歧  napisał(a):
> 
> 在 2017年8月28日,18:12,samsamsam  写道:
> 
> Validation will be very simple. I am talking about something like this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
> format_len = end - start - marker_len - 1 + strlen(PRId64);
> *o_format = av_mallocz(format_len+1);
> strncpy(*o_format, start + marker_len, end - start - marker_len -1);
> strcat(*o_format, PRId64);
> …
> }
> maybe more complex than this way, for example:
> %d
> %lld
> %04lld
> %PRId64
> %PRId32
> %PRId16
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> and so on,blablabla.
> 
> maybe we need to think a perfect solution.
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 11:30 Rodger Combs  napisał(a):
> 
> I would expect parsing the number internally and using the additional arg to 
> be simpler and easier to verify than format string validation.
> 
> On Aug 28, 2017, at 04:28, samsamsam  wrote:
> 
> OK. I will.
> What about adding validation of format instead of adding "something like 
> `"%0*"PRId64`"?
> 
> Dnia 28 sierpnia 2017 03:30 Rodger Combs  napisał(a):
> 
> If you know of such a vulnerability, report it to ffmpeg-secur...@ffmpeg.org. 
> New code with known vulnerabilities will not be accepted.

Re: [FFmpeg-devel] [PATCH v10] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Dan Shamir
-ד-דדש---

On Mar 29, 2017 3:42 PM, "Steven Liu"  wrote:

v2 fixed:
1. from autodetect to disabled
2. from camelCase code style to ffmpeg code style
3. from RepType to AVMediaType
4. fix variable typo
5. change time value from uint32_t to uint64_t
6. removed be used once API
7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and
av_timegm
8. merge complex free operation to free_fragment
9. use API from snprintf to av_asprintf

v3 fixed:
1. fix typo from --enabled-xml2 to --enable-xml2

v4 fixed:
1. from --enable-xml2 to --enable-libxml2
2. move system includes to top
3. remove nouse includes
4. rename enum name
5. add a trailing comma for the last entry enum
6. fix comment typo
7. add const to DASHContext class front
8. check sscanf if return arguments and give warning message when error
9. check validity before free seg->url and seg
10. check if the val is null, before use atoll

v5 fixed:
1. fix typo from mainifest to manifest

v6 fixed:
1. from realloc to av_realloc
2. from free to av_free

v7 fixed:
1. remove the -lxml2 from configure when require_pkg_config

v8 fixed:
1. fix replace filename template by av_asprintf secure problem

v9 modified:
1. make manifest parser clearly

v10 fixed:
1. fix function API name code style
2. remove redundant strreplace call
3. remove redundant memory operation and check return value from
get_content_url()
4. add space between ) and {
5. remove no need to log the value for print

Reviewed-by: Clément Bœsch 
Reviewed-by: Michael Niedermayer 
Reviewed-by: Carl Eugen Hoyos 
Reviewed-by: Rodger Combs 
Reviewed-by: Moritz Barsnick 
Reviewed-by: Nicolas George 
Reviewed-by: Ricardo Constantino 
Signed-off-by: Steven Liu 
---
 configure|4 +
 libavformat/Makefile |1 +
 libavformat/allformats.c |2 +-
 libavformat/dashdec.c| 1851 ++

 4 files changed, 1857 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/dashdec.c

diff --git a/configure b/configure
index 9cc7e7d..4a6fe8a 100755
--- a/configure
+++ b/configure
@@ -273,6 +273,7 @@ External library support:
   --enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect]
   --enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
+  --enable-libxml2enable XML parsing using the C library
libxml2 [no]
   --enable-libzimg enable z.lib, needed for zscale filter [no]
   --enable-libzmq  enable message passing via libzmq [no]
   --enable-libzvbi enable teletext support via libzvbi [no]
@@ -1574,6 +1575,7 @@ EXTERNAL_LIBRARY_LIST="
 libvpx
 libwavpack
 libwebp
+libxml2
 libzimg
 libzmq
 libzvbi
@@ -2906,6 +2908,7 @@ avi_muxer_select="riffenc"
 caf_demuxer_select="iso_media riffdec"
 caf_muxer_select="iso_media"
 dash_muxer_select="mp4_muxer"
+dash_demuxer_deps="libxml2"
 dirac_demuxer_select="dirac_parser"
 dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
@@ -5908,6 +5911,7 @@ enabled openssl   && { use_pkg_config openssl
openssl/ssl.h OPENSSL_init
check_lib openssl/ssl.h SSL_library_init
-lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
 enabled qtkit_indev  && { check_header_objcc QTKit/QTKit.h || disable
qtkit_indev; }
+enabled libxml2 && require_pkg_config libxml-2.0
libxml2/libxml/xmlversion.h xmlCheckVersion

 # libdc1394 check
 if enabled libdc1394; then
diff --git a/libavformat/Makefile b/libavformat/Makefile
index f56ef16..d77ffaa 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -134,6 +134,7 @@ OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
 OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
 OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
 OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
+OBJS-$(CONFIG_DASH_DEMUXER)  += dashdec.o
 OBJS-$(CONFIG_DAUD_DEMUXER)  += dauddec.o
 OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o
 OBJS-$(CONFIG_DCSTR_DEMUXER) += dcstr.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 09e62c3..d57314b 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -96,7 +96,7 @@ static void register_all(void)
 REGISTER_DEMUXER (CINE, cine);
 REGISTER_DEMUXER (CONCAT,   concat);
 REGISTER_MUXER   (CRC,  crc);
-REGISTER_MUXER   (DASH, dash);
+REGISTER_MUXDEMUX(DASH, dash);
 REGISTER_MUXDEMUX(DATA, data);
 REGISTER_MUXDEMUX(DAUD, daud);
 REGISTER_DEMUXER (DCSTR,dcstr);
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
new file mode 100644
index 000..6081bd9
--- /dev/null
+++ b/libavformat/dashdec.c
@@ -0,0 +1,1851 @@
+/*
+ * Dynamic Adaptive Streaming over HTTP demux
+ * Copyright (c) 2017 samsam.

Re: [FFmpeg-devel] [Patch] CUDA Thumbnail Filter

2017-08-30 Thread Timo Rothenpieler

Am 30.08.2017 um 06:19 schrieb Yogender Gupta:

Attached is a CUDA version of the thumbnail filter, this helps accelerate 
thumbnails generations significantly, when using the GPU pipeline.


Without having done a full review on the code yet:
A new filter needs a libavfilter version bump(not 100% sure if minor or 
micro, but I think it was a minor bump).

Also, the filter is missing documentation in doc/filters.texi.
Which, as I just realized, is also true for scale_cuda.

Will have a closer look at the code later.
If someone else could also have a look, that would be greatly appreciated.



Regards,
Timo



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_overlay: Restore shorthand option order

2017-08-30 Thread Marton Balint


On Wed, 30 Aug 2017, Michael Niedermayer wrote:


Signed-off-by: Michael Niedermayer 
---
libavfilter/framesync2.c | 6 --
libavfilter/framesync2.h | 6 ++
libavfilter/vf_overlay.c | 8 
3 files changed, 14 insertions(+), 6 deletions(-)


If this is really this simple then maybe I was wrong to afraid of it. The 
docs need restoring as well, the text for the options should reference the 
common framesync options section.


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


Re: [FFmpeg-devel] [PATCH v10] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
2017-08-30 16:18 GMT+08:00 Dan Shamir :
> -ד-דדש---
What?

>
> On Mar 29, 2017 3:42 PM, "Steven Liu"  wrote:
>
> v2 fixed:
> 1. from autodetect to disabled
> 2. from camelCase code style to ffmpeg code style
> 3. from RepType to AVMediaType
> 4. fix variable typo
> 5. change time value from uint32_t to uint64_t
> 6. removed be used once API
> 7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and
> av_timegm
> 8. merge complex free operation to free_fragment
> 9. use API from snprintf to av_asprintf
>
> v3 fixed:
> 1. fix typo from --enabled-xml2 to --enable-xml2
>
> v4 fixed:
> 1. from --enable-xml2 to --enable-libxml2
> 2. move system includes to top
> 3. remove nouse includes
> 4. rename enum name
> 5. add a trailing comma for the last entry enum
> 6. fix comment typo
> 7. add const to DASHContext class front
> 8. check sscanf if return arguments and give warning message when error
> 9. check validity before free seg->url and seg
> 10. check if the val is null, before use atoll
>
> v5 fixed:
> 1. fix typo from mainifest to manifest
>
> v6 fixed:
> 1. from realloc to av_realloc
> 2. from free to av_free
>
> v7 fixed:
> 1. remove the -lxml2 from configure when require_pkg_config
>
> v8 fixed:
> 1. fix replace filename template by av_asprintf secure problem
>
> v9 modified:
> 1. make manifest parser clearly
>
> v10 fixed:
> 1. fix function API name code style
> 2. remove redundant strreplace call
> 3. remove redundant memory operation and check return value from
> get_content_url()
> 4. add space between ) and {
> 5. remove no need to log the value for print
>
> Reviewed-by: Clément Bœsch 
> Reviewed-by: Michael Niedermayer 
> Reviewed-by: Carl Eugen Hoyos 
> Reviewed-by: Rodger Combs 
> Reviewed-by: Moritz Barsnick 
> Reviewed-by: Nicolas George 
> Reviewed-by: Ricardo Constantino 
> Signed-off-by: Steven Liu 
> ---
>  configure|4 +
>  libavformat/Makefile |1 +
>  libavformat/allformats.c |2 +-
>  libavformat/dashdec.c| 1851 ++
> 
>  4 files changed, 1857 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/dashdec.c
>
> diff --git a/configure b/configure
> index 9cc7e7d..4a6fe8a 100755
> --- a/configure
> +++ b/configure
> @@ -273,6 +273,7 @@ External library support:
>--enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect]
>--enable-libxvid enable Xvid encoding via xvidcore,
> native MPEG-4/Xvid encoder exists [no]
> +  --enable-libxml2enable XML parsing using the C library
> libxml2 [no]
>--enable-libzimg enable z.lib, needed for zscale filter [no]
>--enable-libzmq  enable message passing via libzmq [no]
>--enable-libzvbi enable teletext support via libzvbi [no]
> @@ -1574,6 +1575,7 @@ EXTERNAL_LIBRARY_LIST="
>  libvpx
>  libwavpack
>  libwebp
> +libxml2
>  libzimg
>  libzmq
>  libzvbi
> @@ -2906,6 +2908,7 @@ avi_muxer_select="riffenc"
>  caf_demuxer_select="iso_media riffdec"
>  caf_muxer_select="iso_media"
>  dash_muxer_select="mp4_muxer"
> +dash_demuxer_deps="libxml2"
>  dirac_demuxer_select="dirac_parser"
>  dts_demuxer_select="dca_parser"
>  dtshd_demuxer_select="dca_parser"
> @@ -5908,6 +5911,7 @@ enabled openssl   && { use_pkg_config openssl
> openssl/ssl.h OPENSSL_init
> check_lib openssl/ssl.h SSL_library_init
> -lssl -lcrypto -lws2_32 -lgdi32 ||
> die "ERROR: openssl not found"; }
>  enabled qtkit_indev  && { check_header_objcc QTKit/QTKit.h || disable
> qtkit_indev; }
> +enabled libxml2 && require_pkg_config libxml-2.0
> libxml2/libxml/xmlversion.h xmlCheckVersion
>
>  # libdc1394 check
>  if enabled libdc1394; then
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index f56ef16..d77ffaa 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -134,6 +134,7 @@ OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
>  OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
>  OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
> +OBJS-$(CONFIG_DASH_DEMUXER)  += dashdec.o
>  OBJS-$(CONFIG_DAUD_DEMUXER)  += dauddec.o
>  OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o
>  OBJS-$(CONFIG_DCSTR_DEMUXER) += dcstr.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 09e62c3..d57314b 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -96,7 +96,7 @@ static void register_all(void)
>  REGISTER_DEMUXER (CINE, cine);
>  REGISTER_DEMUXER (CONCAT,   concat);
>  REGISTER_MUXER   (CRC,  crc);
> -REGISTER_MUXER   (DASH, dash);
> +REGISTER_MUXDEMUX(DASH, dash);
>  REGISTER_MUXDEMUX(DATA, data);
>  REGISTER_MUXDEMUX(DAUD,  

Re: [FFmpeg-devel] [PATCH 3/3] avformat/mxfenc: Replace literal numbers by named enum values.

2017-08-30 Thread Александр Слободенюк
Piece of code:

cid = header_cid[0] << 24 | header_cid[1] << 16 | header_cid[2] << 8 | 
header_cid[3];
..
switch (cid) {
case 1235:

.. is platform related, isn't it? It seems to me, that it shouldn't work on BE 
machine.

> On Tue, Aug 29, 2017 at 02:13:21AM +0200, Michael Niedermayer wrote:
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  libavformat/mxfenc.c | 83 
>> ++--
>>  1 file changed, 61 insertions(+), 22 deletions(-)

> applied

> [...]



-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

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


Re: [FFmpeg-devel] [PATCH] compat/cuda/ptx2c: strip CR from each line

2017-08-30 Thread Timo Rothenpieler

applied



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: add support for libnpp* from cuda sdk 9

2017-08-30 Thread Timo Rothenpieler

applied



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avformat/mxfenc: Replace literal numbers by named enum values.

2017-08-30 Thread Александр Слободенюк
Well, sorry, that's not about this patch..

> Piece of code:

> cid = header_cid[0] << 24 | header_cid[1] << 16 | header_cid[2] << 8 | 
> header_cid[3];
> ..
> switch (cid) {
> case 1235:

> .. is platform related, isn't it? It seems to me, that it shouldn't work on 
> BE machine.

>> On Tue, Aug 29, 2017 at 02:13:21AM +0200, Michael Niedermayer wrote:
>>> Signed-off-by: Michael Niedermayer 
>>> ---
>>>  libavformat/mxfenc.c | 83 
>>> ++--
>>>  1 file changed, 61 insertions(+), 22 deletions(-)

>> applied

>> [...]






-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

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


Re: [FFmpeg-devel] [PATCH 07/16] lavfi/framesync2: add common options.

2017-08-30 Thread Paul B Mahol
On 8/10/17, Nicolas George  wrote:
> Also add functions and macros to help filters chaining these
> options to their own.
>
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/framesync2.c | 55
> ++--
>  libavfilter/framesync2.h | 44 +-
>  2 files changed, 96 insertions(+), 3 deletions(-)
>
>
> Unchanged.
>
>
> diff --git a/libavfilter/framesync2.c b/libavfilter/framesync2.c
> index 0f78a1733b..fae06aa1f5 100644
> --- a/libavfilter/framesync2.c
> +++ b/libavfilter/framesync2.c
> @@ -19,24 +19,43 @@
>   */
>
>  #include "libavutil/avassert.h"
> +#include "libavutil/opt.h"
>  #include "avfilter.h"
>  #include "filters.h"
>  #include "framesync2.h"
>  #include "internal.h"
>
>  #define OFFSET(member) offsetof(FFFrameSync, member)
> +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
> +
> +enum EOFAction {
> +EOF_ACTION_REPEAT,
> +EOF_ACTION_ENDALL,
> +EOF_ACTION_PASS
> +};
>
>  static const char *framesync_name(void *ptr)
>  {
>  return "framesync";
>  }
>
> +static const AVOption framesync_options[] = {
> +{ "eof_action", "Action to take when encountering EOF from secondary
> input ",
> +OFFSET(opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT
> },
> +EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
> +{ "repeat", "Repeat the previous frame.",   0, AV_OPT_TYPE_CONST, {
> .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
> +{ "endall", "End both streams.",0, AV_OPT_TYPE_CONST, {
> .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
> +{ "pass",   "Pass through the main input.", 0, AV_OPT_TYPE_CONST, {
> .i64 = EOF_ACTION_PASS },   .flags = FLAGS, "eof_action" },
> +{ "shortest", "force termination when the shortest input terminates",
> OFFSET(opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
> +{ "repeatlast", "repeat overlay of the last overlay frame",
> OFFSET(opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },

Overlay means something for overlay filter only for others its source
of confusion.
So description need be changed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v10] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread wm4
On Wed, 30 Aug 2017 17:01:40 +0800
Steven Liu  wrote:

> 2017-08-30 16:18 GMT+08:00 Dan Shamir :

> What?

Indeed. Can you people please

1. Stop randomly reposting various versions of the patch in a chaotic
   manner,
2. Shorten your mails, and remove irrelevant quoted text from your
   replies.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v17] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Timo Rothenpieler

v16 fixed:
1. remove the snprintf and instead by get_segment_filename make safety
2. remove unnecessary loops
3. updated xmlStrcmp and xmlFree to av_* functions
4. merge code repeat into one function
5. add memory alloc faild check
6. update update_init_section and open_url
7. output safety error message when filename template not safe
Suggested-by : wm4 

v17 fixed:
1. add memory alloc faild check
2. fix resource space error at free_representation

Signed-off-by: Steven Liu 
Signed-off-by: samsamsam 


Just wanted to point out, as stated on IRC, that dashenc already has a 
function that seems to safely solve the filename template issue, and 
looks like it can be moved into a common file + header, and reused as is:


http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l314



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-08-30 Thread Александр Слободенюк
I'm  really  sorry for the waste of your time... very shameful, that I
didn't mind to run fate first..

The patch had 2 different bugs at the same time:
-  samples  were  restricted  to  one  byte  being taken from uint8_t
pointer
- 0x8000 magic was platform-related

Sending the fixed version.

P.S.  On  my system (bash subsystem for Windows 10) ffmpeg works fine,
but fate breaks on tests/data/fate/seek-extra-mp4

> 2017-08-29 11:31 GMT+02:00 Александр Слободенюк
> :
>> sending patch with bumped micro version.

> Your patch breaks fate, this has to be fixed in the same commit.

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



-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

0001-libavformat-dv-read-dv-audio-as-BE.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2] fate: add tests for psnr and ssim filter

2017-08-30 Thread Tobias Rapp
Metadata output is passed through an Awk script reducing precision of
floats to account for architecture differences (e.g x86-32 vs. x86-64).

Signed-off-by: Tobias Rapp 
---
v2:
 - removed CPUFLAGS work-around for ssim filter issue
 - added metadata float value post-processing script

 tests/fate-run.sh |  9 +++
 tests/fate/filter-video.mak   | 14 +++
 tests/ref/fate/filter-refcmp-psnr-rgb | 45 +++
 tests/ref/fate/filter-refcmp-psnr-yuv | 45 +++
 tests/ref/fate/filter-refcmp-ssim-rgb | 30 +++
 tests/ref/fate/filter-refcmp-ssim-yuv | 30 +++
 tests/refcmp-metadata.awk | 41 +++
 7 files changed, 214 insertions(+)
 create mode 100644 tests/ref/fate/filter-refcmp-psnr-rgb
 create mode 100644 tests/ref/fate/filter-refcmp-psnr-yuv
 create mode 100644 tests/ref/fate/filter-refcmp-ssim-rgb
 create mode 100644 tests/ref/fate/filter-refcmp-ssim-yuv
 create mode 100644 tests/refcmp-metadata.awk

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 9aa9a22..5af9a36 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -234,6 +234,15 @@ lavftest(){
 ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" 
"$target_path" "$threads" "$thread_type" "$cpuflags" "$target_samples"
 }
 
+refcmp_metadata(){
+refcmp=$1
+pixfmt=$2
+fuzz=${3:-0.01}
+ffmpeg $FLAGS $ENC_OPTS \
+-lavfi 
"testsrc2=size=300x200:rate=1:duration=5,format=${pixfmt},split[ref][tmp];[tmp]avgblur=4[enc];[enc][ref]${refcmp},metadata=print:file=-"
 \
+-f null /dev/null | awk -v fuzz=${fuzz} -f ${base}/refcmp-metadata.awk 
-
+}
+
 video_filter(){
 filters=$1
 shift
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 670d9de..9f2fca7 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -717,6 +717,20 @@ FATE_FILTER_SAMPLES-$(call ALLYES, MOV_DEMUXER 
H264_DECODER AAC_FIXED_DECODER PC
 fate-filter-meta-4560-rotate0: tests/data/file4560-override2rotate0.mov
 fate-filter-meta-4560-rotate0: CMD = framecrc -flags +bitexact -c:a aac_fixed 
-i $(TARGET_PATH)/tests/data/file4560-override2rotate0.mov
 
+REFCMP_DEPS = FFMPEG LAVFI_INDEV TESTSRC2_FILTER AVGBLUR_FILTER METADATA_FILTER
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) PSNR_FILTER) += 
fate-filter-refcmp-psnr-rgb
+fate-filter-refcmp-psnr-rgb: CMD = refcmp_metadata psnr rgb24
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) PSNR_FILTER) += 
fate-filter-refcmp-psnr-yuv
+fate-filter-refcmp-psnr-yuv: CMD = refcmp_metadata psnr yuv422p
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) SSIM_FILTER) += 
fate-filter-refcmp-ssim-rgb
+fate-filter-refcmp-ssim-rgb: CMD = refcmp_metadata ssim rgb24
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) SSIM_FILTER) += 
fate-filter-refcmp-ssim-yuv
+fate-filter-refcmp-ssim-yuv: CMD = refcmp_metadata ssim yuv422p
+
 FATE_SAMPLES_FFPROBE += $(FATE_METADATA_FILTER-yes)
 FATE_SAMPLES_FFMPEG += $(FATE_FILTER_SAMPLES-yes)
 FATE_FFMPEG += $(FATE_FILTER-yes)
diff --git a/tests/ref/fate/filter-refcmp-psnr-rgb 
b/tests/ref/fate/filter-refcmp-psnr-rgb
new file mode 100644
index 000..16b2208
--- /dev/null
+++ b/tests/ref/fate/filter-refcmp-psnr-rgb
@@ -0,0 +1,45 @@
+frame:0pts:0   pts_time:0  
+lavfi.psnr.mse.r=1380.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=896.00
+lavfi.psnr.psnr.g=18.60
+lavfi.psnr.mse.b=277.00
+lavfi.psnr.psnr.b=23.70
+lavfi.psnr.mse_avg=852.00
+lavfi.psnr.psnr_avg=18.80
+frame:1pts:1   pts_time:1  
+lavfi.psnr.mse.r=1380.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=976.00
+lavfi.psnr.psnr.g=18.20
+lavfi.psnr.mse.b=436.00
+lavfi.psnr.psnr.b=21.70
+lavfi.psnr.mse_avg=931.00
+lavfi.psnr.psnr_avg=18.40
+frame:2pts:2   pts_time:2  
+lavfi.psnr.mse.r=1400.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=954.00
+lavfi.psnr.psnr.g=18.30
+lavfi.psnr.mse.b=494.00
+lavfi.psnr.psnr.b=21.20
+lavfi.psnr.mse_avg=950.00
+lavfi.psnr.psnr_avg=18.40
+frame:3pts:3   pts_time:3  
+lavfi.psnr.mse.r=1450.00
+lavfi.psnr.psnr.r=16.50
+lavfi.psnr.mse.g=1000.00
+lavfi.psnr.psnr.g=18.10
+lavfi.psnr.mse.b=557.00
+lavfi.psnr.psnr.b=20.70
+lavfi.psnr.mse_avg=1000.00
+lavfi.psnr.psnr_avg=18.10
+frame:4pts:4   pts_time:4  
+lavfi.psnr.mse.r=1400.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=1010.00
+lavfi.psnr.psnr.g=18.10
+lavfi.psnr.mse.b=602.00
+lavfi.psnr.psnr.b=20.30
+lavfi.psnr.mse_avg=1000.00
+lavfi.psnr.psnr_avg=18.10
diff --git a/tests/ref/fate/filter-refcmp-psnr-yuv 
b/tests/ref/fate/filter-refcmp-psnr-yuv
new file mode 100644
index 000..b84c156
--- /dev/null
+++ b/tests/ref/fate/filter-refcmp-psnr-yuv
@@ -0,0 +1,45 @@
+frame:0pts:0   pts_time:0  
+lavfi.psnr.mse.y=222.00
+lavfi.psnr.psnr.y=24.70
+lavfi.psnr.mse.u=339.00
+lavfi.psnr.psnr.u=22.80
+lavfi.psnr.mse.v=705.00
+lavfi.psnr.psnr.v=19.60
+lavfi.psnr.mse

[FFmpeg-devel] [PATCH]lavc/hevc_ps: Be less strict on sps conformance by default.

2017-08-30 Thread Carl Eugen Hoyos
Hi!

Attached patch allows users to control the sps conformance
requirement: It allows to revert the fix for ticket #4035, so faulty
streams can be ignored.
Also fixes a user-provided sample.

Please comment, Carl Eugen
From d2a4241f52c7e5b4b5226f7aed237e7448815b77 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Wed, 30 Aug 2017 11:55:15 +0200
Subject: [PATCH] lavc/hevc_ps: Be less strict on sps conformance by default.

---
 libavcodec/hevc_ps.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 37eae22..6d12d90 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1187,7 +1187,8 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
 if (get_bits_left(gb) < 0) {
 av_log(avctx, AV_LOG_ERROR,
"Overread SPS by %d bits\n", -get_bits_left(gb));
-return AVERROR_INVALIDDATA;
+if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+return AVERROR_INVALIDDATA;
 }
 
 return 0;
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH v2] fate: add tests for psnr and ssim filter

2017-08-30 Thread Nicolas George
Le tridi 13 fructidor, an CCXXV, Tobias Rapp a écrit :
> Metadata output is passed through an Awk script reducing precision of
> floats to account for architecture differences (e.g x86-32 vs. x86-64).

I do not like that approach at all: it will miss small differences
introduced inadvertently by changes, making the test less useful, but
would detect falsely rounding differences that fall near the cutoff
(0.499 -> 0.501).

I had posted I script to make approximate comparisons of text files; I
still like this approach better.

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 v10] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
2017-08-30 17:35 GMT+08:00 wm4 :
> On Wed, 30 Aug 2017 17:01:40 +0800
> Steven Liu  wrote:
>
>> 2017-08-30 16:18 GMT+08:00 Dan Shamir :
>
>> What?
>
> Indeed. Can you people please
>
> 1. Stop randomly reposting various versions of the patch in a chaotic
>manner,
Just find some new details problem and want to fix it, so the patch
can reduce review times, and i don't know the small details problem
fix how to resent it,
> 2. Shorten your mails, and remove irrelevant quoted text from your
>replies.
ok, thanks for your advice
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] JPEG200 encoding : added option for changing default codeblock size

2017-08-30 Thread Francesco, Cuzzocrea

Hi Moritz
I check the code and it seems the error born from a previous version of 
ISO/IEC15444-1 I have
(I used a final draft not the final document and the definition was 
quite fuzzy).  Checking final

document I found that you are right.
According to this specification (Table A-18 Width or Height exponent of 
the code-blocks for the SPcod
and SPcoc parameters) code-block exponent width  xcb and height ycb are 
defined as:


xcb = value + 2   and  ycb = value+2

so xcb+ycb <=12 is the correct check. I will correct the patch.

Francesco


On 15/08/2017 23.57, Moritz Barsnick wrote:

On Mon, Aug 07, 2017 at 10:26:21 +0200, france...@bltitalia.com wrote:

Subject: [FFmpeg-devel] [PATCH] JPEG200 encoding : added option for changing 
default codeblock size

Is this your commit message? It's 2000, not 200. ;-) Actually, this
should read:
libavcodec/j2kenc: add option for changing codeblock size


+i = codsty->log2_cblk_width + codsty->log2_cblk_height -4;
+if ( i > 12 )
+{
+  av_log(avctx, AV_LOG_ERROR, "Invalid values for codeblocks size\n");
+  return -1;
+}

Bracket placement, indentation and whitespace all do not correspond to
ffmpeg style.

Apart from that: Isn't that a quite complicated way of saying
if (codsty->log2_cblk_width + codsty->log2_cblk_height > 16)
??


+{ "log2_cblk_width",   "Codeblock Width",   OFFSET(codsty.log2_cblk_width),
AV_OPT_TYPE_INT,   { .i64 = 4   }, 0, 1<<10,   VE, },
+{ "log2_cblk_height",  "Codeblock Height",  OFFSET(codsty.log2_cblk_height),   
AV_OPT_TYPE_INT,   { .i64 = 4   }, 0, 1<<10,   VE, },

I would suggest to drop the capital letters in the option descriptions,
but it appears to follow the style of the other options, so fine by me.

And what's with the upper limits? They don't seem sane. If you choose
either option at one of those limits, the check above will fail
(1<<10 + 0 - 4 is wy larger than 12).

Looking at the spec, you are mixing exponent and value. I read
"Dimension of the code-blocks is always a power of 2 with the minimum
height and width being 4 and and maximum height and width being 1024."
Furthermore the sum of the exponents needs to be less than or equal to
12.

So, the variable being log2, the limits are obviously 2 and 10, the
default 4 (as before). And your check actually needs to read
if (codsty->log2_cblk_width + codsty->log2_cblk_height > 12)
.

Or am I missing something?


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


--
/***\
*Ing. Francesco  Cuzzocrea
*company:BLT Italia srlweb:  http://www.blt.it
*address:via Rosselli, 91 city:  Lido di CAMAIORE
*country:ITALY zip:  55043-i
*  Tel. :+39 0584 904788   Fax:  +39 0584 904789
* e-mail:   france...@bltitalia.com
\***/
-- BLT will be at IBC (15~19 September 2017) - Hall 8, Stand 8.A69 --

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


Re: [FFmpeg-devel] [PATCH v10] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread wm4
On Wed, 30 Aug 2017 18:17:45 +0800
Steven Liu  wrote:

> 2017-08-30 17:35 GMT+08:00 wm4 :
> > On Wed, 30 Aug 2017 17:01:40 +0800
> > Steven Liu  wrote:
> >  
> >> 2017-08-30 16:18 GMT+08:00 Dan Shamir :  
> >  
> >> What?  
> >
> > Indeed. Can you people please
> >
> > 1. Stop randomly reposting various versions of the patch in a chaotic
> >manner,  
> Just find some new details problem and want to fix it, so the patch
> can reduce review times, and i don't know the small details problem
> fix how to resent it,

Sure, the problem is just that I'm seeing multiple of these patches pop
up posted by multiple persons...
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] fate: add tests for psnr and ssim filter

2017-08-30 Thread Tobias Rapp

On 30.08.2017 12:08, Nicolas George wrote:

Le tridi 13 fructidor, an CCXXV, Tobias Rapp a écrit :

Metadata output is passed through an Awk script reducing precision of
floats to account for architecture differences (e.g x86-32 vs. x86-64).


I do not like that approach at all: it will miss small differences
introduced inadvertently by changes, making the test less useful, but
would detect falsely rounding differences that fall near the cutoff
(0.499 -> 0.501).

I had posted I script to make approximate comparisons of text files; I
still like this approach better.


It is true that the "precision" parameter of your approach can be half 
the "fuzz" parameter of my approach. Also the "precision" parameter 
would be defined per float value while this patch uses a normalized 
"fuzz" parameter that is scaled depending on the float value's exponent.


There are three considerations that made me choose the current path of 
implementation:


a) With the proposed patch it is possible to generate/update a reference 
file simply by using "make fate GEN=1".


b) Adding a test with slightly more tolerance than needed is better than 
having no test at all.


c) As far as I can see Perl is currently not a dependency for "make 
fate" and I didn't want to add it.


Regards,
Tobias

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


Re: [FFmpeg-devel] [PATCH v17] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
2017-08-30 17:43 GMT+08:00 Timo Rothenpieler :
>> v16 fixed:
>> 1. remove the snprintf and instead by get_segment_filename make safety
>> 2. remove unnecessary loops
>> 3. updated xmlStrcmp and xmlFree to av_* functions
>> 4. merge code repeat into one function
>> 5. add memory alloc faild check
>> 6. update update_init_section and open_url
>> 7. output safety error message when filename template not safe
>> Suggested-by : wm4 
>>
>> v17 fixed:
>> 1. add memory alloc faild check
>> 2. fix resource space error at free_representation
>>
>> Signed-off-by: Steven Liu 
>> Signed-off-by: samsamsam 
>
>
> Just wanted to point out, as stated on IRC, that dashenc already has a
> function that seems to safely solve the filename template issue, and looks
> like it can be moved into a common file + header, and reused as is:
>
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l314
>
I have try to used that APIs, but it need some modify :
template $Number-%d$ will ok, but $Number$ will wrong, maybe mux
operation different to demux, or i misunderstand some thing?

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


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-08-30 Thread Александр Слободенюк
#include "libavutil/bswap.h" was not necessary for the compilation.

> I'm  really  sorry for the waste of your time... very shameful, that I
> didn't mind to run fate first..

> The patch had 2 different bugs at the same time:
> -  samples  were  restricted  to  one  byte  being taken from uint8_t
> pointer
> - 0x8000 magic was platform-related

> Sending the fixed version.

> P.S.  On  my system (bash subsystem for Windows 10) ffmpeg works fine,
> but fate breaks on tests/data/fate/seek-extra-mp4

>> 2017-08-29 11:31 GMT+02:00 Александр Слободенюк
>> :
>>> sending patch with bumped micro version.

>> Your patch breaks fate, this has to be fixed in the same commit.

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






-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

0001-libavformat-dv-read-dv-audio-as-BE.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-08-30 Thread Jorge Ramirez

On 08/28/2017 11:52 AM, wm4 wrote:

On Sun, 27 Aug 2017 18:26:32 +0200
Jorge Ramirez  wrote:


On 08/25/2017 05:35 PM, wm4 wrote:

That looks generally OK. Is there any chance a hwaccel approach would
be possible instead? If I've learned anything about hardware decoding,
then that hwaccel is vastly superior to vendor-implemented full stream
decoders.

could you help me understand what would that entitle and what how would
that be beneficial to the users?
I just dont feel I can answer that question properly...

With hwaccels, the hardware gets only the slice data (and a bunch of
API parameters with information about the bitstream etc.) instead of
the full bitstream. The advantage is that higher level bitstream
parsing, metadata retrieval, reference frame management, frame
reordering, etc. are all done by the already existing native codec
implementation.


v4l2 provides a generic API  which is what the patchset uses to perform
encoding/decoding on any v4l2 supported hardware (it is completely
vendor independent)

  From the layer above (libavcodec) all it needs is a way to get the
frame information and after processing to pass it back; so in principle,
if the hwaccel API provides that, I could just move it all to use those
calls if you think that fits better with ffmpeg.

but I dont think I understand the benefit of changing from the ffmpeg
encoding/decoding API to hwaccel API.


I don't think I like the attempt of sharing the v4l helper functions
between libavdevice and libavcodec, but I can't tell how much it helps.

ok. I am of course open to suggestions on this (I didnt see any issues
with what the patchset provides or I would have done it differently).

Just forget that libavdevice exists, and keep it correct and simple in
libavcodec.


[resending to the ML];

but I do need to use some of the functions supported in libavdevice for 
its v4l2 frame grabber support; ignoring that code means I will have to 
pretty much duplicate it with a couple of additions that said..

is this what you are suggesting or am I misunderstanding you?

I'll post v7 after this last bit (this dependency seemed to also be a 
source of concern for Paul Mahol)



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


Re: [FFmpeg-devel] [PATCH v17] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Timo Rothenpieler

Just wanted to point out, as stated on IRC, that dashenc already has a
function that seems to safely solve the filename template issue, and looks
like it can be moved into a common file + header, and reused as is:

http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l314


I have try to used that APIs, but it need some modify :
template $Number-%d$ will ok, but $Number$ will wrong, maybe mux
operation different to demux, or i misunderstand some thing?


This looks to me like just $Number$ should work fine as well.
It will expand to, basically, printf("%d", number);

http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l289

If there is some feature missing from it, it can most likely easily be 
added without breaking dashenc.




smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 02/16] build: treat crystalhd like other hwaccels

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 44e45791c2..a9932aeba6 100755
--- a/configure
+++ b/configure
@@ -1532,7 +1532,6 @@ EXTERNAL_LIBRARY_LIST="
 $EXTERNAL_LIBRARY_VERSION3_LIST
 $EXTERNAL_LIBRARY_GPLV3_LIST
 chromaprint
-crystalhd
 gcrypt
 gnutls
 jni
@@ -1589,6 +1588,7 @@ EXTERNAL_LIBRARY_LIST="
 "
 HWACCEL_AUTODETECT_LIBRARY_LIST="
 audiotoolbox
+crystalhd
 cuda
 cuvid
 d3d11va
@@ -3597,7 +3597,7 @@ done
 enable_weak audiotoolbox
 
 # Enable hwaccels by default.
-enable_weak d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
+enable_weak crystalhd d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
 enable_weak xlib
 
 enable_weak cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
@@ -5808,7 +5808,6 @@ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion 
   -lbz2
 enabled  lzma && check_lib lzma   lzma.h lzma_version_number -llzma
 
 check_lib libm math.h sin -lm && LIBM="-lm"
-disabled crystalhd || check_lib crystalhd "stdint.h 
libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
 
 atan2f_args=2
 copysign_args=2
@@ -6180,6 +6179,8 @@ enabled vdpau &&
 enabled vdpau &&
 check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" 
vdp_device_create_x11 -lvdpau -lX11
 
+enabled crystalhd && check_lib crystalhd "stdint.h 
libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
+
 if enabled x86; then
 case $target_os in
 mingw32*|mingw64*|win32|win64|linux|cygwin*)
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 01/16] build: group z libs with other autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 61d8160491..44e45791c2 100755
--- a/configure
+++ b/configure
@@ -3602,6 +3602,9 @@ enable_weak xlib
 
 enable_weak cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
 
+# Enable compression/decompression libraries by default
+enable_weak zlib bzlib lzma
+
 disabled logging && logfile=/dev/null
 
 die_license_disabled() {
@@ -5800,9 +5803,9 @@ fi
 enabled pthreads &&
 check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); 
sem_timedwait(s,0); sem_destroy(s)"
 
-disabled  zlib || check_lib zlib   zlib.h  zlibVersion-lz
-disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion-lbz2
-disabled  lzma || check_lib lzma   lzma.h lzma_version_number -llzma
+enabled  zlib && check_lib zlib   zlib.h  zlibVersion-lz
+enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion-lbz2
+enabled  lzma && check_lib lzma   lzma.h lzma_version_number -llzma
 
 check_lib libm math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib crystalhd "stdint.h 
libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
-- 
2.14.1

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


[FFmpeg-devel] Switching of automatically detected libraries [v2]

2017-08-30 Thread Clément Bœsch
This patchset includes the following changes from previously:

- The combination of --disable-autodetect and --enable- with 
  an automatically detected library now works
- Linking against libc's iconv is now supported with
  --disable-autodetect (issue raised by Nicolas)
- SDL detection should be fixed (issue raised by Michael), along with
  a bunch of related cleanups
- ALSA, Jack and sndio are now included in the autodetection code (they
  are already autodetected, but now --disable-autodetect disable those
  as well), along with a few cleanups

"libpthread" vs "pthread" is still not handled, but that's not blocking
for this patchset. Actually, I'd rather have it pushed before messing
around with something sensible like pthread.

Thanks to people who review the previous patchset and tested it. If
someone wants to test without messing with patches, the changes are
available on github/ubitux/FFmpeg#autodetect.

Regards,

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


[FFmpeg-devel] [PATCH 03/16] build: treat iconv like other autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index a9932aeba6..b4b1288722 100755
--- a/configure
+++ b/configure
@@ -3605,6 +3605,8 @@ enable_weak cuda cuvid nvenc vda_framework videotoolbox 
videotoolbox_encoder
 # Enable compression/decompression libraries by default
 enable_weak zlib bzlib lzma
 
+enable_weak iconv
+
 disabled logging && logfile=/dev/null
 
 die_license_disabled() {
@@ -6202,7 +6204,7 @@ int main(void) { return 0; }
 EOF
 
 # Funny iconv installations are not unusual, so check it after all flags have 
been set
-disabled iconv || check_func_headers iconv.h iconv || check_lib iconv iconv.h 
iconv -liconv
+enabled iconv && check_func_headers iconv.h iconv || check_lib iconv iconv.h 
iconv -liconv
 
 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 08/16] build: replace use of HAVE_SDL2 with existing CONFIG_SDL2

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

There is no need for duplication.
---
 configure|  1 -
 libavdevice/opengl_enc.c | 22 +++---
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 911b9ae569..42742c5842 100755
--- a/configure
+++ b/configure
@@ -2068,7 +2068,6 @@ HAVE_LIST="
 MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
 perl
 pod2man
-sdl2
 section_data_rel_ro
 sndio
 texi2html
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index 1fc7ddd003..bb6787c6f1 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -46,7 +46,7 @@
 #include 
 #endif
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 #include 
 #endif
 
@@ -174,7 +174,7 @@ static const GLushort g_index[6] =
 typedef struct OpenGLContext {
 AVClass *class;///< class for private options
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 SDL_Window *window;
 SDL_GLContext glcontext;
 #endif
@@ -343,7 +343,7 @@ static int opengl_control_message(AVFormatContext *h, int 
type, void *data, size
 return AVERROR(ENOSYS);
 }
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 static int opengl_sdl_process_events(AVFormatContext *h)
 {
 OpenGLContext *opengl = h->priv_data;
@@ -448,14 +448,14 @@ static int av_cold 
opengl_sdl_load_procedures(OpenGLContext *opengl)
 
 #undef LOAD_OPENGL_FUN
 }
-#endif /* HAVE_SDL2 */
+#endif /* CONFIG_SDL2 */
 
 #if defined(__APPLE__)
 static int av_cold opengl_load_procedures(OpenGLContext *opengl)
 {
 FFOpenGLFunctions *procs = &opengl->glprocs;
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 if (!opengl->no_window)
 return opengl_sdl_load_procedures(opengl);
 #endif
@@ -505,7 +505,7 @@ static int av_cold opengl_load_procedures(OpenGLContext 
*opengl)
 return AVERROR(ENOSYS); \
 }
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 if (!opengl->no_window)
 return opengl_sdl_load_procedures(opengl);
 #endif
@@ -931,7 +931,7 @@ static int opengl_create_window(AVFormatContext *h)
 int ret;
 
 if (!opengl->no_window) {
-#if HAVE_SDL2
+#if CONFIG_SDL2
 if ((ret = opengl_sdl_create_window(h)) < 0) {
 av_log(opengl, AV_LOG_ERROR, "Cannot create default SDL 
window.\n");
 return ret;
@@ -963,7 +963,7 @@ static int opengl_release_window(AVFormatContext *h)
 int ret;
 OpenGLContext *opengl = h->priv_data;
 if (!opengl->no_window) {
-#if HAVE_SDL2
+#if CONFIG_SDL2
 SDL_GL_DeleteContext(opengl->glcontext);
 SDL_DestroyWindow(opengl->window);
 SDL_Quit();
@@ -1099,7 +1099,7 @@ static av_cold int opengl_write_header(AVFormatContext *h)
 
 glClear(GL_COLOR_BUFFER_BIT);
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 if (!opengl->no_window)
 SDL_GL_SwapWindow(opengl->window);
 #endif
@@ -1194,7 +1194,7 @@ static int opengl_draw(AVFormatContext *h, void *input, 
int repaint, int is_pkt)
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 int ret;
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 if (!opengl->no_window && (ret = opengl_sdl_process_events(h)) < 0)
 goto fail;
 #endif
@@ -1235,7 +1235,7 @@ static int opengl_draw(AVFormatContext *h, void *input, 
int repaint, int is_pkt)
 ret = AVERROR_EXTERNAL;
 OPENGL_ERROR_CHECK(opengl);
 
-#if HAVE_SDL2
+#if CONFIG_SDL2
 if (!opengl->no_window)
 SDL_GL_SwapWindow(opengl->window);
 #endif
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 04/16] build: treat libxcb like other autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 24 +---
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/configure b/configure
index b4b1288722..e73773fb74 100755
--- a/configure
+++ b/configure
@@ -3598,7 +3598,7 @@ enable_weak audiotoolbox
 
 # Enable hwaccels by default.
 enable_weak crystalhd d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
-enable_weak xlib
+enable_weak xlib libxcb libxcb_shm libxcb_shape libxcb_xfixes
 
 enable_weak cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
 
@@ -6118,31 +6118,17 @@ if enabled libcdio; then
 die "ERROR: No usable libcdio/cdparanoia found"
 fi
 
-if ! disabled libxcb; then
-check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
-enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
-} && enable libxcb
+enabled libxcb && check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || 
disable libxcb
 
 if enabled libxcb; then
-disabled libxcb_shm || {
-check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
-enabled libxcb_shm && die "ERROR: libxcb_shm not found";
-} && check_header sys/shm.h && enable libxcb_shm; }
 
-disabled libxcb_xfixes || {
-check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image 
|| {
-enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
-} && enable libxcb_xfixes; }
-
-disabled libxcb_shape || {
-check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
-enabled libxcb_shape && die "ERROR: libxcb_shape not found";
-} && enable libxcb_shape; }
+enabled libxcb_shm&& check_pkg_config xcb-shmxcb/shm.h
xcb_shm_attach  || disable libxcb_shm
+enabled libxcb_shape  && check_pkg_config xcb-shape  xcb/shape.h  
xcb_shape_get_rectangles|| disable libxcb_shape
+enabled libxcb_xfixes && check_pkg_config xcb-xfixes xcb/xfixes.h 
xcb_xfixes_get_cursor_image || disable libxcb_xfixes
 
 add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
 add_extralibs $xcb_extralibs $xcb_shm_extralibs $xcb_xfixes_extralibs 
$xcb_shape_extralibs
 fi
-fi
 
 check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 05/16] build: treat securetransport and schannel like other autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index e73773fb74..5d416d97f4 100755
--- a/configure
+++ b/configure
@@ -3606,6 +3606,7 @@ enable_weak cuda cuvid nvenc vda_framework videotoolbox 
videotoolbox_encoder
 enable_weak zlib bzlib lzma
 
 enable_weak iconv
+enable_weak securetransport schannel
 
 disabled logging && logfile=/dev/null
 
@@ -6054,11 +6055,16 @@ if enabled decklink; then
 esac
 fi
 
-disabled securetransport || { check_func SecIdentityCreate 
"-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
-check_lib securetransport "Security/SecureTransport.h Security/Security.h" 
"SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation 
-Wl,-framework,Security"; }
+enabled securetransport &&
+check_func SecIdentityCreate "-Wl,-framework,CoreFoundation 
-Wl,-framework,Security" &&
+check_lib securetransport "Security/SecureTransport.h Security/Security.h" 
"SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation 
-Wl,-framework,Security" ||
+disable securetransport
 
-disabled schannel || { check_func_headers "windows.h security.h" 
InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
-   check_cpp_condition winerror.h 
"defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lsecur32; 
}
+enabled schannel &&
+check_func_headers "windows.h security.h" InitializeSecurityContext 
-DSECURITY_WIN32 -lsecur32 &&
+check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
+add_extralibs -lsecur32 ||
+disable schannel
 
 makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 enabled makeinfo \
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 09/16] build: remove vda_framework from enable_weak

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

vda_framework is already pulled by the weakly enabled vda and
videotoolbox.
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 42742c5842..7e80074686 100755
--- a/configure
+++ b/configure
@@ -3601,7 +3601,7 @@ enable_weak audiotoolbox
 enable_weak crystalhd d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
 enable_weak xlib libxcb libxcb_shm libxcb_shape libxcb_xfixes
 
-enable_weak cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
+enable_weak cuda cuvid nvenc videotoolbox videotoolbox_encoder
 
 # Enable compression/decompression libraries by default
 enable_weak zlib bzlib lzma
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 10/16] build: simplify weak-enabling of autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/configure b/configure
index 7e80074686..e376e9562b 100755
--- a/configure
+++ b/configure
@@ -3593,21 +3593,9 @@ done
 for lib in $AUTODETECT_LIBS; do
 enabled $lib && request $lib
 done
-
-# Enable platform codecs by default.
-enable_weak audiotoolbox
-
-# Enable hwaccels by default.
-enable_weak crystalhd d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
-enable_weak xlib libxcb libxcb_shm libxcb_shape libxcb_xfixes
-
-enable_weak cuda cuvid nvenc videotoolbox videotoolbox_encoder
-
-# Enable compression/decompression libraries by default
-enable_weak zlib bzlib lzma
-
-enable_weak iconv
-enable_weak securetransport schannel
+#TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
+enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
+enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
 
 disabled logging && logfile=/dev/null
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 11/16] build: add --disable-autodetect switch

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 Changelog | 1 +
 configure | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/Changelog b/Changelog
index b064328c3f..8b6057d6ae 100644
--- a/Changelog
+++ b/Changelog
@@ -38,6 +38,7 @@ version :
 - Some video filters with several inputs now use a common set of options:
   blend, libvmaf, lut3d, overlay, psnr, ssim.
   They must always be used by name.
+- add --disable-autodetect build switch
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/configure b/configure
index e376e9562b..a6bcee9466 100755
--- a/configure
+++ b/configure
@@ -109,6 +109,7 @@ Configuration options:
   --enable-grayenable full grayscale support (slower color)
   --disable-swscale-alpha  disable alpha channel support in swscale
   --disable-alldisable building components, libraries and programs
+  --disable-autodetect disable automatically detected external libraries 
[no]
 
 Program options:
   --disable-programs   do not build command line programs
@@ -1685,6 +1686,7 @@ CONFIG_LIST="
 $LIBRARY_LIST
 $PROGRAM_LIST
 $SUBSYSTEM_LIST
+autodetect
 fontconfig
 memory_poisoning
 neon_clobber_test
@@ -3589,6 +3591,10 @@ for e in $env; do
 eval "export $e"
 done
 
+if disabled autodetect; then
+disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
+disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
+fi
 # Mark specifically enabled, but normally autodetected libraries as requested.
 for lib in $AUTODETECT_LIBS; do
 enabled $lib && request $lib
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 14/16] build: make jack part of the autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

jack is already autodetected, this commit makes sure
--disable-autodetect actually disable it unless --enable-jack is
specified.
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index d378023c5d..bb7caef5d7 100755
--- a/configure
+++ b/configure
@@ -213,6 +213,7 @@ External library support:
   --enable-gnutls  enable gnutls, needed for https support
if openssl is not used [no]
   --disable-iconv  disable iconv [autodetect]
+  --disable-jack   disable libjack support [autodetect]
   --enable-jni enable JNI support [no]
   --enable-ladspa  enable LADSPA audio filtering [no]
   --enable-libass  enable libass subtitles rendering,
@@ -1485,6 +1486,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
 alsa
 bzlib
 iconv
+jack
 libxcb
 libxcb_shm
 libxcb_shape
@@ -2064,7 +2066,6 @@ HAVE_LIST="
 $TYPES_LIST
 atomics_native
 dos_paths
-jack
 libc_msvcrt
 makeinfo
 makeinfo_html
@@ -6114,7 +6115,7 @@ check_header soundcard.h
 
 enabled alsa && check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
 
-enabled jack_indev && check_lib jack jack/jack.h jack_client_open -ljack &&
+enabled jack && check_lib jack jack/jack.h jack_client_open -ljack &&
 check_func jack_port_get_latency_range -ljack
 
 enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open 
-lsndio
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 16/16] build: drop unused sndio_h and asoundlib_h

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configure b/configure
index f2af0711e3..6a50f40517 100755
--- a/configure
+++ b/configure
@@ -1854,7 +1854,6 @@ HAVE_LIST_PUB="
 "
 
 HEADERS_LIST="
-alsa_asoundlib_h
 altivec_h
 arpa_inet_h
 asm_types_h
@@ -1887,7 +1886,6 @@ HEADERS_LIST="
 openjpeg_1_5_openjpeg_h
 OpenGL_gl3_h
 poll_h
-sndio_h
 soundcard_h
 stdatomic_h
 sys_mman_h
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 12/16] build: make sure a disabled autodetect still pick the libc's iconv

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index a6bcee9466..0a961842df 100755
--- a/configure
+++ b/configure
@@ -3592,6 +3592,11 @@ for e in $env; do
 done
 
 if disabled autodetect; then
+
+# Unless iconv is explicitely disabled by the user, we still want to probe
+# for the iconv from the libc.
+disabled iconv || enable libc_iconv
+
 disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
 disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
 fi
@@ -6192,7 +6197,11 @@ int main(void) { return 0; }
 EOF
 
 # Funny iconv installations are not unusual, so check it after all flags have 
been set
-enabled iconv && check_func_headers iconv.h iconv || check_lib iconv iconv.h 
iconv -liconv
+if enabled libc_iconv; then
+check_func_headers iconv.h iconv
+elif enabled iconv; then
+check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
+fi
 
 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 15/16] build: make sndio part of the autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

sndio is already autodetected, this commit makes sure
--disable-autodetect actually disable it unless --enable-sndio is
specified.
---
 configure| 5 +++--
 libavdevice/Makefile | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index bb7caef5d7..f2af0711e3 100755
--- a/configure
+++ b/configure
@@ -288,6 +288,7 @@ External library support:
   --enable-opengl  enable OpenGL rendering [no]
   --enable-openssl enable openssl, needed for https support
if gnutls is not used [no]
+  --disable-sndio  disable sndio support [autodetect]
   --disable-schannel   disable SChannel SSP, needed for TLS support on
Windows if openssl and gnutls are not used 
[autodetect]
   --disable-sdl2   disable sdl2 [autodetect]
@@ -1495,6 +1496,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
 schannel
 sdl2
 securetransport
+sndio
 xlib
 zlib
 "
@@ -2073,7 +2075,6 @@ HAVE_LIST="
 perl
 pod2man
 section_data_rel_ro
-sndio
 texi2html
 threads
 uwp
@@ -6118,7 +6119,7 @@ enabled alsa && check_lib alsa alsa/asoundlib.h 
snd_pcm_htimestamp -lasound
 enabled jack && check_lib jack jack/jack.h jack_client_open -ljack &&
 check_func jack_port_get_latency_range -ljack
 
-enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open 
-lsndio
+enabled sndio && check_lib sndio sndio.h sio_open -lsndio
 
 if enabled libcdio; then
 check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open 
-lcdio_paranoia -lcdio_cdda -lcdio ||
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 58362e3f2d..cd077b292e 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -71,6 +71,6 @@ SKIPHEADERS-$(CONFIG_LIBPULSE)   += 
pulse_audio_common.h
 SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h
 SKIPHEADERS-$(CONFIG_V4L2_OUTDEV)+= v4l2-common.h
 SKIPHEADERS-$(CONFIG_ALSA)   += alsa.h
-SKIPHEADERS-$(HAVE_SNDIO)+= sndio.h
+SKIPHEADERS-$(CONFIG_SNDIO)  += sndio.h
 
 TESTPROGS-$(CONFIG_JACK_INDEV)   += timefilter
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 13/16] build: make alsa part of the autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

alsa libs are already autodetected, this commit makes sure
--disable-autodetect actually disable it unless --enable-alsa is
specified.
---
 configure| 6 +++---
 libavdevice/Makefile | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 0a961842df..d378023c5d 100755
--- a/configure
+++ b/configure
@@ -201,6 +201,7 @@ External library support:
   Also note that the following help text describes the purpose of the libraries
   themselves, not all their features will necessarily be usable by FFmpeg.
 
+  --disable-alsa   disable ALSA support [autodetect]
   --enable-avisynthenable reading of AviSynth script files [no]
   --disable-bzlib  disable bzlib [autodetect]
   --enable-chromaprint enable audio fingerprinting with chromaprint [no]
@@ -1481,6 +1482,7 @@ EXAMPLE_LIST="
 transcoding_example
 "
 EXTERNAL_AUTODETECT_LIBRARY_LIST="
+alsa
 bzlib
 iconv
 libxcb
@@ -2060,7 +2062,6 @@ HAVE_LIST="
 $THREADS_LIST
 $TOOLCHAIN_FEATURES
 $TYPES_LIST
-alsa
 atomics_native
 dos_paths
 jack
@@ -6111,8 +6112,7 @@ EOF
 fi
 check_header soundcard.h
 
-enabled_any alsa_indev alsa_outdev &&
-check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
+enabled alsa && check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
 
 enabled jack_indev && check_lib jack jack/jack.h jack_client_open -ljack &&
 check_func jack_port_get_latency_range -ljack
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 80afa61e36..58362e3f2d 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -70,7 +70,7 @@ SKIPHEADERS-$(CONFIG_FBDEV_OUTDEV)   += fbdev_common.h
 SKIPHEADERS-$(CONFIG_LIBPULSE)   += pulse_audio_common.h
 SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h
 SKIPHEADERS-$(CONFIG_V4L2_OUTDEV)+= v4l2-common.h
-SKIPHEADERS-$(HAVE_ALSA) += alsa.h
+SKIPHEADERS-$(CONFIG_ALSA)   += alsa.h
 SKIPHEADERS-$(HAVE_SNDIO)+= sndio.h
 
 TESTPROGS-$(CONFIG_JACK_INDEV)   += timefilter
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 06/16] build: isolate sdl-to-sdl2 aliasing

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

This simplifies incoming SDL related changes by removing potential
mismatching states of sdl and sdl2 variables. Since a component can have
all kind of states (such as unset, enabled, disabled or requested),
keeping these variables in sync manually in random places is not robust.
---
 configure | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 5d416d97f4..94b95f2df7 100755
--- a/configure
+++ b/configure
@@ -1488,7 +1488,6 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
 libxcb_xfixes
 lzma
 schannel
-sdl
 sdl2
 securetransport
 xlib
@@ -3524,6 +3523,9 @@ for opt do
 action=${opt%%-random=*}
 do_random ${action#--} $optval
 ;;
+--enable-sdl)
+enable sdl2
+;;
 --enable-*=*|--disable-*=*)
 eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
 is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
@@ -6024,7 +6026,6 @@ if enabled gcrypt; then
 fi
 fi
 
-disabled sdl && disable sdl2
 if ! disabled sdl2; then
 SDL2_CONFIG="${cross_prefix}sdl2-config"
 if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
@@ -6044,7 +6045,7 @@ if ! disabled sdl2; then
 sdl2_extralibs="$sdl2_extralibs -mconsole"
 fi
 fi
-enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs 
$sdl2_extralibs
+enabled sdl2 && add_cflags $sdl2_cflags && add_extralibs $sdl2_extralibs
 
 if enabled decklink; then
 case $target_os in
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 07/16] build: treat sdl2 like other autodetected libraries

2017-08-30 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 94b95f2df7..911b9ae569 100755
--- a/configure
+++ b/configure
@@ -6026,20 +6026,22 @@ if enabled gcrypt; then
 fi
 fi
 
-if ! disabled sdl2; then
+if enabled sdl2; then
 SDL2_CONFIG="${cross_prefix}sdl2-config"
 if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | 
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | 
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
-check_func SDL_Init $sdl2_extralibs $sdl2_cflags && enable sdl2
-else
-  if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
+check_func SDL_Init $sdl2_extralibs $sdl2_cflags ||
+disable sdl2
+elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
 sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
 sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | 
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | 
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
-check_func SDL_Init $sdl2_extralibs $sdl2_cflags && enable sdl2
-  fi
+check_func SDL_Init $sdl2_extralibs $sdl2_cflags ||
+disable sdl2
+else
+disable sdl2
 fi
 if test $target_os = "mingw32"; then
 sdl2_extralibs="$sdl2_extralibs -mconsole"
-- 
2.14.1

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


Re: [FFmpeg-devel] [PATCH v17] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
2017-08-30 19:50 GMT+08:00 Timo Rothenpieler :
>>> Just wanted to point out, as stated on IRC, that dashenc already has a
>>> function that seems to safely solve the filename template issue, and
>>> looks
>>> like it can be moved into a common file + header, and reused as is:
>>>
>>>
>>> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l314
>>>
>> I have try to used that APIs, but it need some modify :
>> template $Number-%d$ will ok, but $Number$ will wrong, maybe mux
>> operation different to demux, or i misunderstand some thing?
>
>
> This looks to me like just $Number$ should work fine as well.
> It will expand to, basically, printf("%d", number);
>
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l289
>
> If there is some feature missing from it, it can most likely easily be added
> without breaking dashenc.

modify to it later after this patch merged :D
That modify will be clear than this patch
This patch is too big now, full review is too hard work.
Now i have use get_repl_pattern_and_format + get_segment_filename fix it.
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Switching of automatically detected libraries [v2]

2017-08-30 Thread Clément Bœsch
On Wed, Aug 30, 2017 at 02:08:59PM +0200, Clément Bœsch wrote:
> This patchset includes the following changes from previously:
> 
> - The combination of --disable-autodetect and --enable- with 
>   an automatically detected library now works
> - Linking against libc's iconv is now supported with
>   --disable-autodetect (issue raised by Nicolas)
> - SDL detection should be fixed (issue raised by Michael), along with
>   a bunch of related cleanups
> - ALSA, Jack and sndio are now included in the autodetection code (they
>   are already autodetected, but now --disable-autodetect disable those
>   as well), along with a few cleanups
> 
> "libpthread" vs "pthread" is still not handled, but that's not blocking
> for this patchset. Actually, I'd rather have it pushed before messing
> around with something sensible like pthread.
> 
> Thanks to people who review the previous patchset and tested it. If
> someone wants to test without messing with patches, the changes are
> available on github/ubitux/FFmpeg#autodetect.
> 

Here is what `ldd ./ffmpeg` looks like after this patchset:

default (Linux, GCC):

linux-vdso.so.1 (0x7ffecf4ed000)
libXv.so.1 => /usr/lib/libXv.so.1 (0x7f804b0b2000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x7f804ad73000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x7f804ab61000)
libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0x7f804a845000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x7f804a641000)
libvdpau.so.1 => /usr/lib/libvdpau.so.1 (0x7f804a43d000)
libva.so.1 => /usr/lib/libva.so.1 (0x7f804a21d000)
libva-x11.so.1 => /usr/lib/libva-x11.so.1 (0x7f804a017000)
libva-drm.so.1 => /usr/lib/libva-drm.so.1 (0x7f8049e14000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7f8049beb000)
libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x7f80499e7000)
libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0x7f80497df000)
libxcb-shape.so.0 => /usr/lib/libxcb-shape.so.0 (0x7f80495db000)
libjack.so.0 => /usr/lib/libjack.so.0 (0x7f80493ba000)
libasound.so.2 => /usr/lib/libasound.so.2 (0x7f80490aa000)
libx264.so.148 => /usr/lib/libx264.so.148 (0x7f8048d34000)
libm.so.6 => /usr/lib/libm.so.6 (0x7f8048a22000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x7f80487fc000)
libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x7f80485ec000)
libz.so.1 => /usr/lib/libz.so.1 (0x7f80483d5000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x7f80481b7000)
libc.so.6 => /usr/lib/libc.so.6 (0x7f8047e11000)
librt.so.1 => /usr/lib/librt.so.1 (0x7f8047c09000)
/lib64/ld-linux-x86-64.so.2 (0x7f804b2b7000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7f8047a03000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0x7f80477f2000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x7f80475ee000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7f80473e8000)
libdb-5.3.so => /usr/lib/libdb-5.3.so (0x7f8047029000)

--disable-autodetect:

linux-vdso.so.1 (0x7fff5abd6000)
libm.so.6 => /usr/lib/libm.so.6 (0x7f817a4ab000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x7f817a28d000)
libc.so.6 => /usr/lib/libc.so.6 (0x7f8179ee7000)
/lib64/ld-linux-x86-64.so.2 (0x7f817a7bd000)

-- 
Clément B.


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


[FFmpeg-devel] [PATCH v20] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
ffmpeg need a dash demuxer for demux the dash formats base on
https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch

TODO:
1. make the safety APIs used same to dashenc.
2. support multi bitrate dash.

v2 fixed:
1. from autodetect to disabled
2. from camelCase code style to ffmpeg code style
3. from RepType to AVMediaType
4. fix variable typo
5. change time value from uint32_t to uint64_t
6. removed be used once API
7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and av_timegm
8. merge complex free operation to free_fragment
9. use API from snprintf to av_asprintf

v3 fixed:
1. fix typo from --enabled-xml2 to --enable-xml2

v4 fixed:
1. from --enable-xml2 to --enable-libxml2
2. move system includes to top
3. remove nouse includes
4. rename enum name
5. add a trailing comma for the last entry enum
6. fix comment typo
7. add const to DASHContext class front
8. check sscanf if return arguments and give warning message when error
9. check validity before free seg->url and seg
10. check if the val is null, before use atoll

v5 fixed:
1. fix typo from mainifest to manifest

v6 fixed:
1. from realloc to av_realloc
2. from free to av_free

v7 fixed:
1. remove the -lxml2 from configure when require_pkg_config

v8 fixed:
1. fix replace filename template by av_asprintf secure problem

v9 modified:
1. make manifest parser clearly

v10 fixed:
1. fix function API name code style
2. remove redundant strreplace call
3. remove redundant memory operation and check return value from 
get_content_url()
4. add space between ) and {
5. remove no need to log the value for print

v11 fixed:
1. from atoll to strtoll
Suggested-by: Michael Niedermayer 

v12 fixed:
1. remove strreplace and instead by av_strreplace
Suggested-by: Nicolas George 

v13 fixed:
1. fix bug: cannot play:
http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd
Reported-by: Andy Furniss 

v14 fixed:
1. fix bug: TLS connection was non-properly terminated
2. fix bug: No trailing CRLF found in HTTP header
Reported-by: Andy Furniss 

v15 fixed:
1. play youtube link: ffmpeg -i $(youtube-dl -J 
"https://www.youtube.com/watch?v=XmL19DOP_Ls"; | jq -r 
".requested_formats[0].manifest_url")
2. code refine for timeline living stream
Reported-by: Ricardo Constantino 

v16 fixed:
1. remove the snprintf and instead by get_segment_filename make safety
2. remove unnecessary loops
3. updated xmlStrcmp and xmlFree to av_* functions
4. merge code repeat into one function
5. add memory alloc faild check
6. update update_init_section and open_url
7. output safety error message when filename template not safe
Suggested-by : wm4 

v17 fixed:
1. add memory alloc faild check
2. fix resource space error at free_representation

v18 fixed:
1. add condition of template format

v19 fixed:
1. fix typo of the option describe

v20 fixed:
1. add the c->base_url alloc check
2. make the DASHTmplId same to dashenc

Signed-off-by: Steven Liu 
Signed-off-by: samsamsam 
---
 configure|4 +
 libavformat/Makefile |1 +
 libavformat/allformats.c |2 +-
 libavformat/dashdec.c| 2039 ++
 4 files changed, 2045 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/dashdec.c

diff --git a/configure b/configure
index 61d8160491..c03ff02297 100755
--- a/configure
+++ b/configure
@@ -272,6 +272,7 @@ External library support:
   --enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect]
   --enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
+  --enable-libxml2 enable XML parsing using the C library libxml2 [no]
   --enable-libzimg enable z.lib, needed for zscale filter [no]
   --enable-libzmq  enable message passing via libzmq [no]
   --enable-libzvbi enable teletext support via libzvbi [no]
@@ -1578,6 +1579,7 @@ EXTERNAL_LIBRARY_LIST="
 libvpx
 libwavpack
 libwebp
+libxml2
 libzimg
 libzmq
 libzvbi
@@ -2939,6 +2941,7 @@ avi_muxer_select="riffenc"
 caf_demuxer_select="iso_media riffdec"
 caf_muxer_select="iso_media"
 dash_muxer_select="mp4_muxer"
+dash_demuxer_deps="libxml2"
 dirac_demuxer_select="dirac_parser"
 dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
@@ -6005,6 +6008,7 @@ enabled openssl   && { use_pkg_config openssl 
openssl/ssl.h OPENSSL_init
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
 enabled qtkit_indev  && { check_header_objcc QTKit/QTKit.h || disable 
qtkit_indev; }
+enabled libxml2  && require_pkg_config libxml-2.0 
libxml2/libxml/xmlversion.h xmlCheckVersion
 
 if enabled gcrypt; then
 GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index f2b465cfa2.

Re: [FFmpeg-devel] [PATCH] configure: require pkg-config for libvmaf

2017-08-30 Thread Ronald S. Bultje
Hi,

On Tue, Aug 1, 2017 at 11:14 AM, Ashish Pratap Singh 
wrote:

> From: Ashish Singh 
>
> This patch makes the libvmaf filter use pkg-config to detect
> and link to libvmaf.
>
> Signed-off-by: Ashish Singh 
> ---
>  configure | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>

Pushed.

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_libvmaf: fix pre convert to framesync2 bugs

2017-08-30 Thread Ronald S. Bultje
Hi,

On Thu, Aug 3, 2017 at 1:34 AM, Ashish Pratap Singh 
wrote:

> From: Ashish Singh 
>
> Hi, it fixes the errors while converting to framesync2.
> libvmaf was changed recently, double *score variable is removed in the new
> version since it's not used anywhere. This patch fixes all the warnings and
> segmentation faults.
>
> Signed-off-by: Ashish Singh 
> ---
>  libavfilter/vf_libvmaf.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)


Pushed.

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


Re: [FFmpeg-devel] [PATCH 10/16] lavfi/vf_libvmaf: convert to framesync2.

2017-08-30 Thread Ronald S. Bultje
Hi,

On Sun, Aug 20, 2017 at 5:52 AM, Nicolas George  wrote:

> Le tridi 23 thermidor, an CCXXV, Nicolas George a écrit :
> > After this commit, the code compiles, but on my setup it
> > segfaults before and after. It also prints the very worrying
> > warning:
> >
> > src/libavfilter/vf_libvmaf.c:161:66: warning: passing argument 4 of
> ‘compute_vmaf’ from incompatible pointer type [-Wincompatible-pointer-types]
> > /tmp/i/include/libvmaf.h:26:8: note: expected ‘int (*)(float *, float *,
> float *, int,  void *)’ but argument is of type ‘int (*)(float *, float *,
> float *, int,  double *, void *)’
> >
> > ==12116== Thread 6:
> > ==12116== Conditional jump or move depends on uninitialised value(s)
> > ==12116==at 0x526D432: cons_ (ocval.h:1188)
> > ==12116==by 0x526D432: GenericIT (ocval.h:1119)
> > ==12116==by 0x526D432: OC::TranslateForNumPyClassesToArray(OC::Val&)
> (pickleloader.h:92)
> > ==12116==by 0x5211F5D: loads (pickleloader.h:566)
> > ==12116==by 0x5211F5D: LoadValFromArray (chooseser.h:290)
> > ==12116==by 0x5211F5D: LoadValFromFile (chooseser.h:405)
> > ==12116==by 0x5211F5D: _read_and_assert_model(char const*, OC::Val&,
> OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&) (vmaf.cpp:77)
> > ==12116==by 0x5212B0F: VmafRunner::run(Asset, int (*)(float*,
> float*, float*, int, void*), void*, bool, bool, bool, bool, bool)
> (vmaf.cpp:149)
> > ==12116==by 0x52165B6: RunVmaf(char const*, int, int, int
> (*)(float*, float*, float*, int, void*), void*, char const*, char const*,
> char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
> > ==12116==by 0x518AFFF: compute_vmaf_score (vf_libvmaf.c:161)
> > ==12116==by 0x518AFFF: call_vmaf (vf_libvmaf.c:170)
> > ==12116==by 0x7967493: start_thread (pthread_create.c:333)
> > ==12116==by 0x7F69A8E: clone (clone.S:97)
> 
>
> Without confirmation it is fixed, I will push as is, with the dump in
> the commit message. Please test and report.


Sorry, that was my fault, Ashish had submitted a patch and I had not merged
it. Fixed now, all works correctly. Thanks for the framesync2 conversion.

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


[FFmpeg-devel] [PATCH] h264: Make Truncating SPS/PPS message debug.

2017-08-30 Thread Kieran Kunhya
Padded SPS/PPS is perfectly legal.


0001-h264-Make-Truncating-SPS-PPS-message-debug.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_libvmaf: fix pre convert to framesync2 bugs

2017-08-30 Thread Derek Buitenhuis
On 8/30/2017 2:24 PM, Ronald S. Bultje wrote:
> Pushed.

Did libvmaf bump its version for this breaking change? (It should have...)

If so, bump the required version in configure, or other users will get
crashes.

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


Re: [FFmpeg-devel] [PATCH] avformat/concatdec: add fallback for calculating file duration

2017-08-30 Thread Paul B Mahol
On 8/29/17, Justin Ruggles  wrote:
> If a file does not have a known duration, this leads to the timestamps
> starting over for the next file, causing non-monotonic timestamps.
> To prevent this, track the duration during demuxing and use it to
> determine the current file duration before opening the next file.
> ---
>  libavformat/concatdec.c | 20 ++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
>

LGTM, but I'm not maintainer of that demuxer.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_libvmaf: fix pre convert to framesync2 bugs

2017-08-30 Thread Ashish Pratap Singh

Hi,

On 30-08-2017 19:43, Derek Buitenhuis wrote:

On 8/30/2017 2:24 PM, Ronald S. Bultje wrote:

Pushed.

Did libvmaf bump its version for this breaking change? (It should have...)

If so, bump the required version in configure, or other users will get
crashes.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
I didn't make a check for the libvmaf version in configure. I'll add 
that in the next patch. libvmaf is a new library and it's version is 
same as the old one (in the pkg-config). I'll inform vmaf developers to 
update the version after updating libvmaf in future to avoid crashes.

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


Re: [FFmpeg-devel] [PATCH] avformat/concatdec: add fallback for calculating file duration

2017-08-30 Thread Nicolas George
Le primidi 11 fructidor, an CCXXV, Justin Ruggles a écrit :
> If a file does not have a known duration, this leads to the timestamps
> starting over for the next file, causing non-monotonic timestamps.
> To prevent this, track the duration during demuxing and use it to
> determine the current file duration before opening the next file.
> ---
>  libavformat/concatdec.c | 20 ++--
>  1 file changed, 18 insertions(+), 2 deletions(-)

Looks ok.

I wonder if it would not be better to do that in the common code. I
think I assumed the duration of the file was being updated like that
automatically.

Regards,

-- 
  Nicolas George


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


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

2017-08-30 Thread Ashish Pratap Singh
From: Ashish Singh 

Hi,
This patch changes the previous adm filter to integer types which will be
helpful for writing SIMD optimizations later. 

Signed-off-by: Ashish Singh 
---
 Changelog|   1 +
 doc/filters.texi |  15 +
 libavfilter/Makefile |   1 +
 libavfilter/adm.h|  75 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_adm.c | 742 +++
 6 files changed, 835 insertions(+)
 create mode 100644 libavfilter/adm.h
 create mode 100644 libavfilter/vf_adm.c

diff --git a/Changelog b/Changelog
index 8309417..c6a775c 100644
--- a/Changelog
+++ b/Changelog
@@ -40,6 +40,7 @@ version :
   They must always be used by name.
 - FITS demuxer and decoder
 - FITS muxer and encoder
+- ADM video filter
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/doc/filters.texi b/doc/filters.texi
index 19e13a1..67b39f9 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4654,6 +4654,21 @@ build.
 
 Below is a description of the currently available video filters.
 
+@section adm
+
+Obtain the average ADM/DLM (Detail Loss Metric) between two input videos.
+
+This filter takes two input videos.
+
+The obtained average ADM score is printed through the logging system.
+
+In the below example the input file @file{main.mpg} being processed is compared
+with the reference file @file{ref.mpg}.
+
+@example
+ffmpeg -i main.mpg -i ref.mpg -lavfi adm -f null -
+@end example
+
 @section alphaextract
 
 Extract the alpha component from the input as a grayscale video. This
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index ee840b0..b4b46e1 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -126,6 +126,7 @@ OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
 OBJS-$(CONFIG_ANULLSINK_FILTER)  += asink_anullsink.o
 
 # video filters
+OBJS-$(CONFIG_ADM_FILTER)+= vf_adm.o
 OBJS-$(CONFIG_ALPHAEXTRACT_FILTER)   += vf_extractplanes.o
 OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o
 OBJS-$(CONFIG_ASS_FILTER)+= vf_subtitles.o
diff --git a/libavfilter/adm.h b/libavfilter/adm.h
new file mode 100644
index 000..862bd17
--- /dev/null
+++ b/libavfilter/adm.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 Ronald S. Bultje 
+ * Copyright (c) 2017 Ashish Pratap Singh 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFILTER_ADM_H
+#define AVFILTER_ADM_H
+/** Formula (1), page 1165 - display visual resolution (DVR),
+ * in pixels/degree of visual angle. This should be 56.55
+ */
+#define R 56.55
+/** Percentage of frame to discard on all 4 sides */
+#define ADM_BORDER_FACTOR (0.1)
+
+#define N 15
+
+typedef struct adm_dwt_band_t {
+int16_t *band_a; /** Low-pass V + low-pass H. */
+int16_t *band_v; /** Low-pass V + high-pass H. */
+int16_t *band_h; /** High-pass V + low-pass H. */
+int16_t *band_d; /** High-pass V + high-pass H. */
+} adm_dwt_band_t;
+
+static const float dwt2_db2_coeffs_lo[4] = {
+0.482962913144690,  0.836516303737469,
+0.224143868041857, -0.129409522550921
+};
+static const float dwt2_db2_coeffs_hi[4] = {
+-0.129409522550921, -0.224143868041857,
+0.836516303737469,  -0.482962913144690
+};
+
+static int32_t dwt2_db2_coeffs_lo_int[4];
+static int32_t dwt2_db2_coeffs_hi_int[4];
+
+/**
+ * The following dwt basis function amplitudes, Q(lambda,theta), are taken from
+ * "Visibility of Wavelet Quantization Noise"
+ * by A. B. Watson, G. Y. Yang, J. A. Solomon and J. Villasenor
+ * IEEE Trans. on Image Processing, Vol. 6, No 8, Aug. 1997
+ * Page 1172, Table V
+ * The table has been transposed, i.e. it can be used directly to obtain 
Q[lambda][theta]
+ * These amplitudes were calculated for the 7-9 biorthogonal wavelet basis
+ */
+static const float Q[4][2] = {
+{ 57.534645,  169.767410, },
+{ 31.265896,  69.937431,  },
+{ 23.056629,  40.990150,  },
+{ 21.895033,  31.936741,  },
+};
+
+/** function to compute adm score */
+int compute_adm2(const void *ref, const void *main, int w, int h,
+ ptrdiff_t ref_stride, ptrdiff_t main_stride, double *score,
+ double *score_num, double *score_den, double *scores,
+ in

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

2017-08-30 Thread Paul B Mahol
On 8/30/17, Ashish Pratap Singh  wrote:
> From: Ashish Singh 
>
> Hi,
> This patch changes the previous adm filter to integer types which will be
> helpful for writing SIMD optimizations later.
>
> Signed-off-by: Ashish Singh 
> ---
>  Changelog|   1 +
>  doc/filters.texi |  15 +
>  libavfilter/Makefile |   1 +
>  libavfilter/adm.h|  75 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/vf_adm.c | 742
> +++
>  6 files changed, 835 insertions(+)
>  create mode 100644 libavfilter/adm.h
>  create mode 100644 libavfilter/vf_adm.c
>

dualinput.h is removed in master, thus patch is useless.

You need to port this to activate and framesync2.
You can look at psnr and ssim for clues.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/vf_subtitles: enable processing of alpha channel

2017-08-30 Thread Paul B Mahol
Fixes #6605.

Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_subtitles.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 805ee2d..b7ba628 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -54,6 +54,7 @@ typedef struct AssContext {
 char *charenc;
 char *force_style;
 int stream_index;
+int alpha;
 uint8_t rgba_map[4];
 int pix_step[4];   ///< steps per pixel for each plane of the main 
output
 int original_w, original_h;
@@ -69,6 +70,7 @@ typedef struct AssContext {
 {"f",  "set the filename of file to read", 
OFFSET(filename),   AV_OPT_TYPE_STRING, {.str = NULL},  CHAR_MIN, 
CHAR_MAX, FLAGS }, \
 {"original_size",  "set the size of the original video (used to scale 
fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL},  CHAR_MIN, 
CHAR_MAX, FLAGS }, \
 {"fontsdir",   "set the directory containing the fonts to read",   
OFFSET(fontsdir),   AV_OPT_TYPE_STRING, {.str = NULL},  CHAR_MIN, 
CHAR_MAX, FLAGS }, \
+{"alpha",  "enable processing of alpha channel",   
OFFSET(alpha),  AV_OPT_TYPE_BOOL,   {.i64 = 0   }, 0,   
 1, FLAGS }, \
 
 /* libass supports a log level ranging from 0 to 7 */
 static const int ass_libavfilter_log_level_map[] = {
@@ -140,7 +142,7 @@ static int config_input(AVFilterLink *inlink)
 {
 AssContext *ass = inlink->dst->priv;
 
-ff_draw_init(&ass->draw, inlink->format, 0);
+ff_draw_init(&ass->draw, inlink->format, ass->alpha);
 
 ass_set_frame_size  (ass->renderer, inlink->w, inlink->h);
 if (ass->original_w && ass->original_h)
-- 
2.9.3

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


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

2017-08-30 Thread Ashish Pratap Singh
Hi,

On Aug 30, 2017 22:52, "Paul B Mahol"  wrote:

On 8/30/17, Ashish Pratap Singh  wrote:
> From: Ashish Singh 
>
> Hi,
> This patch changes the previous adm filter to integer types which will be
> helpful for writing SIMD optimizations later.
>
> Signed-off-by: Ashish Singh 
> ---
>  Changelog|   1 +
>  doc/filters.texi |  15 +
>  libavfilter/Makefile |   1 +
>  libavfilter/adm.h|  75 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/vf_adm.c | 742
> +++
>  6 files changed, 835 insertions(+)
>  create mode 100644 libavfilter/adm.h
>  create mode 100644 libavfilter/vf_adm.c
>

dualinput.h is removed in master, thus patch is useless.

You need to port this to activate and framesync2.
You can look at psnr and ssim for clues.

Ok.

___
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] nvenc: Don't segfault on close if no cuda is available

2017-08-30 Thread Mark Thompson
---
"""
Cannot load libcuda.so.1

Thread 1 "ffmpeg_g" received signal SIGSEGV, Segmentation fault.
0x5657cd59 in ff_nvenc_encode_close (avctx=0x578ed920) at 
src/libavcodec/nvenc.c:1337
1337cu_res = dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context);
"""

This only fixes the segfaults - some of the other stuff might want to be gated 
as well?


 libavcodec/nvenc.c | 26 +++---
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 8c4fd31fec..5586a8901f 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1334,10 +1334,12 @@ av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
 CUcontext dummy;
 int i;
 
-cu_res = dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context);
-if (cu_res != CUDA_SUCCESS) {
-av_log(avctx, AV_LOG_ERROR, "cuCtxPushCurrent failed\n");
-return AVERROR_EXTERNAL;
+if (dl_fn->cuda_dl) {
+cu_res = dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context);
+if (cu_res != CUDA_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "cuCtxPushCurrent failed\n");
+return AVERROR_EXTERNAL;
+}
 }
 
 /* the encoder has to be flushed before it can be closed */
@@ -1381,14 +1383,16 @@ av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
 p_nvenc->nvEncDestroyEncoder(ctx->nvencoder);
 ctx->nvencoder = NULL;
 
-cu_res = dl_fn->cuda_dl->cuCtxPopCurrent(&dummy);
-if (cu_res != CUDA_SUCCESS) {
-av_log(avctx, AV_LOG_ERROR, "cuCtxPopCurrent failed\n");
-return AVERROR_EXTERNAL;
-}
+if (dl_fn->cuda_dl) {
+cu_res = dl_fn->cuda_dl->cuCtxPopCurrent(&dummy);
+if (cu_res != CUDA_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "cuCtxPopCurrent failed\n");
+return AVERROR_EXTERNAL;
+}
 
-if (ctx->cu_context_internal)
-dl_fn->cuda_dl->cuCtxDestroy(ctx->cu_context_internal);
+if (ctx->cu_context_internal)
+dl_fn->cuda_dl->cuCtxDestroy(ctx->cu_context_internal);
+}
 ctx->cu_context = ctx->cu_context_internal = NULL;
 
 nvenc_free_functions(&dl_fn->nvenc_dl);
-- 
2.11.0
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v15] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Rodger Combs
I'm not confident that we'll be able to verify the correctness of any 
validation code for a printf format string sufficiently. Just parse out the 
padding value and use "%0*"PRId64. Do not pass anything other than a string 
literal to printf-family functions in future versions of this patch.

> On Aug 30, 2017, at 14:17, samsamsam  wrote:
> 
> No, you have not get the point.
> The hackers won’t refer to specification and just broke the rule to get root 
> shell.
> 
> I got a point. This is why I proposed the validation if validation faile then 
> return error and stop processing. 
> But, I was not checked proposed validation it was only concept. I will write 
> correct validation when I will have access to my PC in the next week.
> 
> 
> Dnia 30 sierpnia 2017 09:59 刘歧  napisał(a):
> 
> 在 2017年8月30日,15:52,samsamsam  写道:
> 
> What will happen when $Number%02s%08d$
> 
> Exacly. Such format is not allowed by dash specification. So, such validation 
> is sufficient.
> 
> Please check DASH specification format like that $Number%02s%08d$ is not 
> allowed.
> So what for you want to allow it?
> No, you have not get the point.
> The hackers won’t refer to specification and just broke the rule to get root 
> shell.
> 
> Anyway, merge your code and will update a new version patch later.
> 
> 
> Dnia 30 sierpnia 2017 09:32 刘歧  napisał(a):
> 
> 在 2017年8月30日,14:38,samsamsam  写道:
> 
> But you do not added this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> What will happen when $Number%02s%08d$
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
> format_len = end - start - marker_len - 1 + strlen(PRId64);
> *o_format = av_mallocz(format_len+1);
> strncpy(*o_format, start + marker_len, end - start - marker_len -1);
> strcat(*o_format, PRId64);
> …
> }
> 
> modification. Right?
> 
> Dnia 30 sierpnia 2017 00:04 Liu Steven  napisał(a):
> 
> 在 2017年8月30日,上午3:30,samsamsam  写道:
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> What? With my solution this is not problem.
> Why you think %s%d%d%d%d or %02c%lld give any problem?
> 
> localhost:dash StevenLiu$ ./ffmpeg -i /tmp/dash.mpd
> ffmpeg version N-87079-g257f0d09f7 Copyright (c) 2000-2017 the FFmpeg 
> developers
> built with Apple LLVM version 8.1.0 (clang-802.0.42)
> configuration: --enable-libass --enable-opengl --enable-libx264 
> --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local 
> --enable-libopencv --enable-libtesseract --enable-libspeex 
> --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac 
> --enable-videotoolbox --enable-libxml2
> libavutil  55. 74.100 / 55. 74.100
> libavcodec 57.103.101 / 57.103.101
> libavformat57. 78.100 / 57. 78.100
> libavdevice57.  7.101 / 57.  7.101
> libavfilter 6.100.100 /  6.100.100
> libswscale  4.  7.103 /  4.  7.103
> libswresample   2.  8.100 /  2.  8.100
> libpostproc54.  6.100 / 54.  6.100
> [dash @ 0x7ffb76802a00] 11
> Segmentation fault: 11ted 1 times
> localhost:dash StevenLiu$ grep -r "%s%05d" /tmp/dash.mpd
> /tmp/dash.mpd: initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1">
> localhost:dash StevenLiu$
> 
> reproduce:
> ffmpeg -i input -c copy -f dash /tmp/dash.mpd
> vim /tmp/dash.mpd
> seek to `media="chunk-stream$RepresentationID`
> the context is `  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1”>`
> modify to:
>  initialization="init-stream$RepresentationID$.m4s" 
> media="chunk-stream$RepresentationID$-$Number%s%05d$.m4s" startNumber="1”>
> 
> use your solution:
> ./ffmpeg -i /tmp/dash.mpd
> 
> 
> 
> 
> Dnia 28 sierpnia 2017 12:27 刘歧  napisał(a):
> 
> 在 2017年8月28日,18:12,samsamsam  写道:
> 
> Validation will be very simple. I am talking about something like this:
> static int get_repl_pattern_and_format(const char *i_url, const char 
> *i_marker, char **o_pattern, char **o_format)
> {
> ...
> +for(ptr=start + marker_len; ptr < (end - 1); ++ptr) {  /*there is 
> need to check this condition :P */
> +if (*ptr != '0') {
> +   // Unknown format add log here
> +goto finish;
> +}
> +}
> format_len = end - start - marker_len - 1 + strlen(PRId64);
> *o_format = av_mallocz(format_len+1);
> strncpy(*o_format, start + marker_len, end - start - marker_len -1);
> strcat(*o_format, PRId64);
> …
> }
> maybe more complex than this way, for example:
> %d
> %lld
> %04lld
> %PRId64
> %PRId32
> %PRId16
> 
> and think about the safety :
> %02c%lld
> %s%d%d%d%d
> 
> and so on,blablabla.
> 
> maybe we need to th

Re: [FFmpeg-devel] [PATCH] lavfi/atempo: Avoid false triggering an assertion failure

2017-08-30 Thread Marton Balint


On Mon, 19 Dec 2016, Marton Balint wrote:



On Sat, 17 Dec 2016, pkoshe...@gmail.com wrote:


From: Pavel Koshevoy 

Steps to reproduce:
./ffmpeg_g -f s16be -i /dev/null -af atempo=0.5 -y /tmp/atempo.wav
---
libavfilter/af_atempo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 59b08ec..a487882 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -914,8 +914,8 @@ static int yae_flush(ATempoContext *atempo,

atempo->state = YAE_FLUSH_OUTPUT;

-if (atempo->position[0] == frag->position[0] + frag->nsamples &&
-atempo->position[1] == frag->position[1] + frag->nsamples) {
+if (atempo->position[0] >= frag->position[0] + frag->nsamples &&
+atempo->position[1] >= frag->position[1] + frag->nsamples) {
// the current fragment is already flushed:
return 0;
}


Thanks, this indeed fixes the assertion I came accross.


Hmm, this patch seems to cause cut off data at the end, as reported in 
https://trac.ffmpeg.org/ticket/6540


Pavel, would you mind taking a look?

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


Re: [FFmpeg-devel] [PATCHv3 2/2] avcodec/vp9: Add tile threading support

2017-08-30 Thread Michael Niedermayer
On Mon, Aug 28, 2017 at 06:36:13PM +0700, Ilia Valiakhmetov wrote:
> Signed-off-by: Ilia Valiakhmetov 
> ---
>  libavcodec/vp9.c | 608 
> ++-
>  libavcodec/vp9_mc_template.c | 202 +++---
>  libavcodec/vp9block.c| 522 ++---
>  libavcodec/vp9dec.h  | 108 +---
>  libavcodec/vp9mvs.c  |  97 +++
>  libavcodec/vp9prob.c |  64 ++---
>  libavcodec/vp9recon.c| 153 +--
>  7 files changed, 1006 insertions(+), 748 deletions(-)

with mips-linux-gnu-gcc-4.4 (Debian 4.4.5-8) 4.4.5

In file included from src/libavcodec/vp9data.h:28,
 from src/libavcodec/vp9.c:33:
src/libavcodec/vp9dec.h:218: error: redefinition of typedef ‘VP9TileData’
src/libavcodec/vp9dec.h:89: note: previous declaration of ‘VP9TileData’ was here
src/libavcodec/vp9.c: In function ‘vp9_decode_frame’:
src/libavcodec/vp9.c:1379: warning: ‘pkt_pts’ is deprecated (declared at 
src/libavutil/frame.h:302)
make: *** [libavcodec/vp9.o] Error 1
make: *** Waiting for unfinished jobs
In file included from src/libavcodec/vp9data.h:28,
 from src/libavcodec/vp9data.c:24:
src/libavcodec/vp9dec.h:218: error: redefinition of typedef ‘VP9TileData’
src/libavcodec/vp9dec.h:89: note: previous declaration of ‘VP9TileData’ was here
make: *** [libavcodec/vp9data.o] Error 1
In file included from src/libavcodec/vp9data.h:28,
 from src/libavcodec/vp9block.c:32:
src/libavcodec/vp9dec.h:218: error: redefinition of typedef ‘VP9TileData’
src/libavcodec/vp9dec.h:89: note: previous declaration of ‘VP9TileData’ was here
make: *** [libavcodec/vp9block.o] Error 1
src/libavcodec/utils.c: In function ‘avcodec_open2’:
src/libavcodec/utils.c:859: warning: ‘coded_frame’ is deprecated (declared at 
src/libavcodec/avcodec.h:3170)
src/libavcodec/utils.c:860: warning: ‘coded_frame’ is deprecated (declared at 
src/libavcodec/avcodec.h:3170)
src/libavcodec/utils.c:1135: warning: ‘coded_frame’ is deprecated (declared at 
src/libavcodec/avcodec.h:3170)
src/libavcodec/utils.c: In function ‘avcodec_close’:
src/libavcodec/utils.c:1232: warning: ‘coded_frame’ is deprecated (declared at 
src/libavcodec/avcodec.h:3170)
src/libavcodec/utils.c: In function ‘av_log_missing_feature’:
src/libavcodec/utils.c:1936: warning: ‘av_log_ask_for_sample’ is deprecated 
(declared at src/libavcodec/avcodec.h:6288)



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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- 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/atempo: Avoid false triggering an assertion failure

2017-08-30 Thread Pavel Koshevoy
On Wed, Aug 30, 2017 at 2:00 PM, Marton Balint  wrote:
>
> On Mon, 19 Dec 2016, Marton Balint wrote:
>
>>
>> On Sat, 17 Dec 2016, pkoshe...@gmail.com wrote:
>>
>>> From: Pavel Koshevoy 
>>>
>>> Steps to reproduce:
>>> ./ffmpeg_g -f s16be -i /dev/null -af atempo=0.5 -y /tmp/atempo.wav
>>> ---
>>> libavfilter/af_atempo.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
>>> index 59b08ec..a487882 100644
>>> --- a/libavfilter/af_atempo.c
>>> +++ b/libavfilter/af_atempo.c
>>> @@ -914,8 +914,8 @@ static int yae_flush(ATempoContext *atempo,
>>>
>>> atempo->state = YAE_FLUSH_OUTPUT;
>>>
>>> -if (atempo->position[0] == frag->position[0] + frag->nsamples &&
>>> -atempo->position[1] == frag->position[1] + frag->nsamples) {
>>> +if (atempo->position[0] >= frag->position[0] + frag->nsamples &&
>>> +atempo->position[1] >= frag->position[1] + frag->nsamples) {
>>> // the current fragment is already flushed:
>>> return 0;
>>> }
>>
>>
>> Thanks, this indeed fixes the assertion I came accross.
>
>
> Hmm, this patch seems to cause cut off data at the end, as reported in
> https://trac.ffmpeg.org/ticket/6540
>
> Pavel, would you mind taking a look?
>
> Thanks,
> Marton


Sure, but it will probably have to wait until the weekend.

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


Re: [FFmpeg-devel] [PATCHv3 2/2] avcodec/vp9: Add tile threading support

2017-08-30 Thread gh0st
Should be fixed now in PATCHv4, thanks!

On Thu, Aug 31, 2017 at 3:59 AM, Michael Niedermayer  wrote:

> On Mon, Aug 28, 2017 at 06:36:13PM +0700, Ilia Valiakhmetov wrote:
> > Signed-off-by: Ilia Valiakhmetov 
> > ---
> >  libavcodec/vp9.c | 608 ++
> -
> >  libavcodec/vp9_mc_template.c | 202 +++---
> >  libavcodec/vp9block.c| 522 ++
> ---
> >  libavcodec/vp9dec.h  | 108 +---
> >  libavcodec/vp9mvs.c  |  97 +++
> >  libavcodec/vp9prob.c |  64 ++---
> >  libavcodec/vp9recon.c| 153 +--
> >  7 files changed, 1006 insertions(+), 748 deletions(-)
>
> with mips-linux-gnu-gcc-4.4 (Debian 4.4.5-8) 4.4.5
>
> In file included from src/libavcodec/vp9data.h:28,
>  from src/libavcodec/vp9.c:33:
> src/libavcodec/vp9dec.h:218: error: redefinition of typedef ‘VP9TileData’
> src/libavcodec/vp9dec.h:89: note: previous declaration of ‘VP9TileData’
> was here
> src/libavcodec/vp9.c: In function ‘vp9_decode_frame’:
> src/libavcodec/vp9.c:1379: warning: ‘pkt_pts’ is deprecated (declared at
> src/libavutil/frame.h:302)
> make: *** [libavcodec/vp9.o] Error 1
> make: *** Waiting for unfinished jobs
> In file included from src/libavcodec/vp9data.h:28,
>  from src/libavcodec/vp9data.c:24:
> src/libavcodec/vp9dec.h:218: error: redefinition of typedef ‘VP9TileData’
> src/libavcodec/vp9dec.h:89: note: previous declaration of ‘VP9TileData’
> was here
> make: *** [libavcodec/vp9data.o] Error 1
> In file included from src/libavcodec/vp9data.h:28,
>  from src/libavcodec/vp9block.c:32:
> src/libavcodec/vp9dec.h:218: error: redefinition of typedef ‘VP9TileData’
> src/libavcodec/vp9dec.h:89: note: previous declaration of ‘VP9TileData’
> was here
> make: *** [libavcodec/vp9block.o] Error 1
> src/libavcodec/utils.c: In function ‘avcodec_open2’:
> src/libavcodec/utils.c:859: warning: ‘coded_frame’ is deprecated (declared
> at src/libavcodec/avcodec.h:3170)
> src/libavcodec/utils.c:860: warning: ‘coded_frame’ is deprecated (declared
> at src/libavcodec/avcodec.h:3170)
> src/libavcodec/utils.c:1135: warning: ‘coded_frame’ is deprecated
> (declared at src/libavcodec/avcodec.h:3170)
> src/libavcodec/utils.c: In function ‘avcodec_close’:
> src/libavcodec/utils.c:1232: warning: ‘coded_frame’ is deprecated
> (declared at src/libavcodec/avcodec.h:3170)
> src/libavcodec/utils.c: In function ‘av_log_missing_feature’:
> src/libavcodec/utils.c:1936: warning: ‘av_log_ask_for_sample’ is
> deprecated (declared at src/libavcodec/avcodec.h:6288)
>
>
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> When the tyrant has disposed of foreign enemies by conquest or treaty, and
> there is nothing more to fear from them, then he is always stirring up
> some war or other, in order that the people may require a leader. -- Plato
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-08-30 Thread Michael Niedermayer
On Wed, Aug 30, 2017 at 02:27:36PM +0300, Александр Слободенюк wrote:
> #include "libavutil/bswap.h" was not necessary for the compilation.
> 
> > I'm  really  sorry for the waste of your time... very shameful, that I
> > didn't mind to run fate first..
> 
> > The patch had 2 different bugs at the same time:
> > -  samples  were  restricted  to  one  byte  being taken from uint8_t
> > pointer
> > - 0x8000 magic was platform-related
> 
> > Sending the fixed version.
> 
> > P.S.  On  my system (bash subsystem for Windows 10) ffmpeg works fine,
> > but fate breaks on tests/data/fate/seek-extra-mp4
> 
> >> 2017-08-29 11:31 GMT+02:00 Александр Слободенюк
> >> :
> >>> sending patch with bumped micro version.
> 
> >> Your patch breaks fate, this has to be fixed in the same commit.
> 
> >> Carl Eugen
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> 
> 
> 
> 
> 
> -- 
> С уважением,
>  Александр  mailto:alexander.sloboden...@bramtech.ru

>  dv.c  |   30 ++
>  version.h |2 +-
>  2 files changed, 11 insertions(+), 21 deletions(-)
> e7b65efa7f8bea00355ff8754028579e9e39f66b  
> 0001-libavformat-dv-read-dv-audio-as-BE.patch
> From 238c53030e9c5420a431df469f67a8e6c968abfd Mon Sep 17 00:00:00 2001
> From: Aleksandr Slobodeniuk 
> Date: Fri, 25 Aug 2017 17:02:18 +0300
> Subject: [PATCH] libavformat/dv : read dv audio as BE

this breaks stream copy:
./ffmpeg -i ~/tickets/1042/submarine.dv -acodec copy -vcodec copy file.dv
the sample file seems to be at
http://www.mediafire.com/file/8agcdgs2f9kqlbi/submarine.dv

[dv @ 0x2842d80] Can't initialize DV format!
Make sure that you supply exactly two streams:
 video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM
 (50Mbps allows an optional second audio stream)
Could not write header for output file #0 (incorrect codec parameters ?): 
Operation not permitted

[...]
-- 
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 1/2] avformat/flvdec: Set need_context_update when setting the initial extradata

2017-08-30 Thread Michael Niedermayer
On Tue, Aug 29, 2017 at 11:40:06AM -0700, Alex Converse wrote:
> Fixes ticket 6398.
> 
> Debugged with the help of James Almer and Hendrik Leppkes.
> ---
>  libavformat/flvdec.c | 1 +
>  1 file changed, 1 insertion(+)

should be ok

thx

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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- 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]lavc/hevc_ps: Be less strict on sps conformance by default.

2017-08-30 Thread Michael Niedermayer
On Wed, Aug 30, 2017 at 12:05:32PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch allows users to control the sps conformance
> requirement: It allows to revert the fix for ticket #4035, so faulty
> streams can be ignored.
> Also fixes a user-provided sample.
> 
> Please comment, Carl Eugen

>  hevc_ps.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 46c5772fae6f32bb580246c84ed42e4070834c77  
> 0001-lavc-hevc_ps-Be-less-strict-on-sps-conformance-by-de.patch
> From d2a4241f52c7e5b4b5226f7aed237e7448815b77 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos 
> Date: Wed, 30 Aug 2017 11:55:15 +0200
> Subject: [PATCH] lavc/hevc_ps: Be less strict on sps conformance by default.
> 
> ---
>  libavcodec/hevc_ps.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index 37eae22..6d12d90 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -1187,7 +1187,8 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, 
> unsigned int *sps_id,
>  if (get_bits_left(gb) < 0) {
>  av_log(avctx, AV_LOG_ERROR,
> "Overread SPS by %d bits\n", -get_bits_left(gb));
> -return AVERROR_INVALIDDATA;
> +if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
> +return AVERROR_INVALIDDATA;

This is likely not correct

when get_bits_left becomes smaller than 0 then parsing went wrong
prior


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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


Re: [FFmpeg-devel] [PATCH] avformat/utils: refine av_get_frame_filename2 function

2017-08-30 Thread Michael Niedermayer
On Mon, Aug 28, 2017 at 08:03:36PM +0800, Steven Liu wrote:
> support parse the l for the %lld or %ld
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/utils.c | 4 
>  1 file changed, 4 insertions(+)

LGTM

please add a fate test for this.

thx

[...]

-- 
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] [PATCH] avfilter/mcdeint: remove usage of deprecated AVCodecContext.me_method

2017-08-30 Thread Michael Niedermayer
On Mon, Aug 28, 2017 at 02:18:53PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
> Depends on patch "avcodec/snowenc: fix setting motion_est option"
> 
>  libavfilter/vf_mcdeint.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c
> index 26387b84e7..f07e1a0d60 100644
> --- a/libavfilter/vf_mcdeint.c
> +++ b/libavfilter/vf_mcdeint.c
> @@ -52,6 +52,7 @@
>  #include "libavutil/opt.h"
>  #include "libavutil/pixdesc.h"
>  #include "libavcodec/avcodec.h"
> +#include "libavcodec/snow.h"
>  #include "avfilter.h"
>  #include "formats.h"
>  #include "internal.h"
> @@ -134,7 +135,7 @@ static int config_props(AVFilterLink *inlink)
>  case MODE_EXTRA_SLOW:
>  enc_ctx->refs = 3;
>  case MODE_SLOW:
> -enc_ctx->me_method = ME_ITER;
> +av_dict_set(&opts, "motion_est", AV_STRINGIFY(FF_ME_ITER), 0);

"iter" doesnt work instead of AV_STRINGIFY(FF_ME_ITER) ?

either way LGTM if tested

thx

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

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.


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


Re: [FFmpeg-devel] [PATCH] avfilter/mcdeint: remove usage of deprecated AVCodecContext.me_method

2017-08-30 Thread James Almer
On 8/30/2017 9:39 PM, Michael Niedermayer wrote:
> On Mon, Aug 28, 2017 at 02:18:53PM -0300, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>> Depends on patch "avcodec/snowenc: fix setting motion_est option"
>>
>>  libavfilter/vf_mcdeint.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c
>> index 26387b84e7..f07e1a0d60 100644
>> --- a/libavfilter/vf_mcdeint.c
>> +++ b/libavfilter/vf_mcdeint.c
>> @@ -52,6 +52,7 @@
>>  #include "libavutil/opt.h"
>>  #include "libavutil/pixdesc.h"
>>  #include "libavcodec/avcodec.h"
>> +#include "libavcodec/snow.h"
>>  #include "avfilter.h"
>>  #include "formats.h"
>>  #include "internal.h"
>> @@ -134,7 +135,7 @@ static int config_props(AVFilterLink *inlink)
>>  case MODE_EXTRA_SLOW:
>>  enc_ctx->refs = 3;
>>  case MODE_SLOW:
>> -enc_ctx->me_method = ME_ITER;
>> +av_dict_set(&opts, "motion_est", AV_STRINGIFY(FF_ME_ITER), 0);
> 
> "iter" doesnt work instead of AV_STRINGIFY(FF_ME_ITER) ?

You're right, thanks for the suggestion.

> 
> either way LGTM if tested

Tested and pushed, thanks.

> 
> thx
> 
> [...]
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

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


Re: [FFmpeg-devel] fate/pixlet : add test for rgb

2017-08-30 Thread Michael Niedermayer
On Mon, Aug 28, 2017 at 05:51:48PM +0200, Martin Vignali wrote:
> 2017-04-03 2:21 GMT+02:00 Michael Niedermayer :
> 
> > On Sun, Apr 02, 2017 at 11:29:38PM +0200, Martin Vignali wrote:
> > > Hello,
> > >
> > > In attach patch to add a fate test for pixlet decoder
> > >
> > > Sample can be found here :
> > > https://we.tl/HYuFmmmfIe
> >
> > file uploaded
> >
> 
> Ping for the patch

tested on x86-32 & 64, arm, mips and mingw32&64

applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


Re: [FFmpeg-devel] [PATCH v3] fate: add tests for some video source filters

2017-08-30 Thread Michael Niedermayer
On Tue, Aug 29, 2017 at 04:49:58PM +0200, Tobias Rapp wrote:
> On 25.07.2017 11:11, Tobias Rapp wrote:
> >Adds FATE tests for the previously untested allrgb, allyuv, rgbtestsrc,
> >smptebars, smptehdbars and yuvtestsrc filters.
> >
> >Also adds a test for testsrc2 filter with rgb+alpha.
> >
> >Signed-off-by: Tobias Rapp 
> >---
> >  tests/fate/filter-video.mak| 24 ++
> >  tests/ref/fate/filter-allrgb   | 10 
> >  tests/ref/fate/filter-allyuv   | 10 
> >  tests/ref/fate/filter-rgbtestsrc   | 10 
> >  tests/ref/fate/filter-smptebars| 10 
> >  tests/ref/fate/filter-smptehdbars  | 10 
> >  tests/ref/fate/filter-testsrc2-rgba| 75 
> > ++
> >  tests/ref/fate/filter-yuvtestsrc-yuv444p   | 10 
> >  tests/ref/fate/filter-yuvtestsrc-yuv444p12 | 10 
> >  9 files changed, 169 insertions(+)
> >  create mode 100644 tests/ref/fate/filter-allrgb
> >  create mode 100644 tests/ref/fate/filter-allyuv
> >  create mode 100644 tests/ref/fate/filter-rgbtestsrc
> >  create mode 100644 tests/ref/fate/filter-smptebars
> >  create mode 100644 tests/ref/fate/filter-smptehdbars
> >  create mode 100644 tests/ref/fate/filter-testsrc2-rgba
> >  create mode 100644 tests/ref/fate/filter-yuvtestsrc-yuv444p
> >  create mode 100644 tests/ref/fate/filter-yuvtestsrc-yuv444p12
> >
> >[...]
> 
> Ping.

tested on x86 32 /64 arm mips linux // mingw32/64

LGTM

thx

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] Odp: Re: [PATCH v15] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Lou Logan
On Wed, Aug 30, 2017, at 11:53 AM, samsamsam wrote:
> [...]

Please fix your emails—they are broken. Here's what one looks like:



Your messages are:

* At least 150k in size. There is no need for them to be this large.
Please trim the message; keeping only the relevant sections you are
directly replying to.

* Lacking proper quoting so it is not easy to determine the difference
between what you wrote and what someone else wrote. This was mentioned
by someone else previously.

* Missing proper line breaks resulting in an unreadable wall of text.

Also, try to avoid top-posting on this mailing list.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v17] avformat/dashdec: add dash demuxer base version

2017-08-30 Thread Steven Liu
2017-08-30 19:50 GMT+08:00 Timo Rothenpieler :
>>> Just wanted to point out, as stated on IRC, that dashenc already has a
>>> function that seems to safely solve the filename template issue, and
>>> looks
>>> like it can be moved into a common file + header, and reused as is:
>>>
>>>
>>> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l314
>>>
>> I have try to used that APIs, but it need some modify :
>> template $Number-%d$ will ok, but $Number$ will wrong, maybe mux
>> operation different to demux, or i misunderstand some thing?
>
>
> This looks to me like just $Number$ should work fine as well.
> It will expand to, basically, printf("%d", number);
>
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/dashenc.c;h=bdb332c71ab4aae87201c87c3d43938a07a9ed5c;hb=HEAD#l289
>
> If there is some feature missing from it, it can most likely easily be added
> without breaking dashenc.
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Hi Timo,

I try again, it's looks good :D

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