[FFmpeg-devel] [PATCH 3/3] lavf/libsmbclient: implement directory listing callbacks

2015-04-02 Thread Mariusz Szczepańczyk
---
 libavformat/libsmbclient.c | 108 +
 1 file changed, 108 insertions(+)

diff --git a/libavformat/libsmbclient.c b/libavformat/libsmbclient.c
index 8290d75..1af8163 100644
--- a/libavformat/libsmbclient.c
+++ b/libavformat/libsmbclient.c
@@ -28,6 +28,7 @@
 typedef struct {
 const AVClass *class;
 SMBCCTX *ctx;
+int dh;
 int fd;
 int64_t filesize;
 int trunc;
@@ -182,6 +183,110 @@ static int libsmbc_write(URLContext *h, const unsigned 
char *buf, int size)
 return bytes_written;
 }
 
+static int libsmbc_open_dir(URLContext *h)
+{
+LIBSMBContext *libsmbc = h->priv_data;
+int ret;
+
+if ((ret = libsmbc_connect(h)) < 0)
+goto fail;
+
+if ((libsmbc->dh = smbc_opendir(h->filename)) < 0) {
+ret = AVERROR(errno);
+av_log(h, AV_LOG_ERROR, "Error opening dir: %s\n", strerror(errno));
+goto fail;
+}
+
+return 0;
+
+  fail:
+libsmbc_close(h);
+return ret;
+}
+
+static int libsmbc_read_dir(URLContext *h, AVIODirEntry **next)
+{
+LIBSMBContext *libsmbc = h->priv_data;
+AVIODirEntry *entry;
+struct smbc_dirent *dirent = NULL;
+char *url = NULL;
+int skip_entry;
+
+*next = entry = ff_alloc_dir_entry();
+if (!entry)
+return AVERROR(ENOMEM);
+
+do {
+skip_entry = 0;
+dirent = smbc_readdir(libsmbc->dh);
+if (!dirent) {
+av_freep(next);
+return 0;
+}
+switch (dirent->smbc_type) {
+case SMBC_DIR:
+entry->type = AVIO_ENTRY_DIRECTORY;
+break;
+case SMBC_FILE:
+entry->type = AVIO_ENTRY_FILE;
+break;
+case SMBC_FILE_SHARE:
+entry->type = AVIO_ENTRY_SHARE;
+break;
+case SMBC_SERVER:
+entry->type = AVIO_ENTRY_SERVER;
+break;
+case SMBC_WORKGROUP:
+entry->type = AVIO_ENTRY_WORKGROUP;
+break;
+case SMBC_COMMS_SHARE:
+case SMBC_IPC_SHARE:
+case SMBC_PRINTER_SHARE:
+skip_entry = 1;
+break;
+case SMBC_LINK:
+default:
+entry->type = AVIO_ENTRY_UNKNOWN;
+break;
+}
+} while (skip_entry || !strcmp(dirent->name, ".") ||
+ !strcmp(dirent->name, ".."));
+
+entry->name = av_strdup(dirent->name);
+if (!entry->name) {
+av_freep(next);
+return AVERROR(ENOMEM);
+}
+
+url = av_append_path_component(h->filename, dirent->name);
+if (url) {
+struct stat st;
+if (!smbc_stat(url, &st)) {
+entry->group_id = st.st_gid;
+entry->user_id = st.st_uid;
+entry->size = st.st_size;
+entry->filemode = st.st_mode & 0777;
+entry->modification_timestamp = INT64_C(100) * st.st_mtime;
+entry->access_timestamp =  INT64_C(100) * st.st_atime;
+entry->status_change_timestamp = INT64_C(100) * st.st_ctime;
+}
+av_free(url);
+}
+
+return 0;
+}
+
+static int libsmbc_close_dir(URLContext *h)
+{
+LIBSMBContext *libsmbc = h->priv_data;
+if (libsmbc->dh >= 0) {
+smbc_closedir(libsmbc->dh);
+libsmbc->dh = -1;
+}
+libsmbc_close(h);
+return 0;
+}
+
 #define OFFSET(x) offsetof(LIBSMBContext, x)
 #define D AV_OPT_FLAG_DECODING_PARAM
 #define E AV_OPT_FLAG_ENCODING_PARAM
@@ -206,6 +311,9 @@ URLProtocol ff_libsmbclient_protocol = {
 .url_write   = libsmbc_write,
 .url_seek= libsmbc_seek,
 .url_close   = libsmbc_close,
+.url_open_dir= libsmbc_open_dir,
+.url_read_dir= libsmbc_read_dir,
+.url_close_dir   = libsmbc_close_dir,
 .priv_data_size  = sizeof(LIBSMBContext),
 .priv_data_class = &libsmbclient_context_class,
 .flags   = URL_PROTOCOL_FLAG_NETWORK,
-- 
2.3.3

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


[FFmpeg-devel] [PATCH 1/3] lavf/avio: Add new types to AVIODirEntryType, bump minor version

2015-04-02 Thread Mariusz Szczepańczyk
---
 doc/APIchanges| 5 +
 libavformat/avio.h| 5 -
 libavformat/version.h | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index b1beb9d..ae67e06 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,11 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2015-xx-xx - xxx - lavf 56.29.100 - avio.h
+  Add AVIODirEntryType.AVIO_ENTRY_SERVER.
+  Add AVIODirEntryType.AVIO_ENTRY_SHARE.
+  Add AVIODirEntryType.AVIO_ENTRY_WORKGROUP.
+
 2015-xx-xx - xxx - lavu 54.22.100 - avstring.h
   Add av_append_path_component()
 
diff --git a/libavformat/avio.h b/libavformat/avio.h
index f61a8f8..51913e3 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -63,7 +63,10 @@ enum AVIODirEntryType {
 AVIO_ENTRY_NAMED_PIPE,
 AVIO_ENTRY_SYMBOLIC_LINK,
 AVIO_ENTRY_SOCKET,
-AVIO_ENTRY_FILE
+AVIO_ENTRY_FILE,
+AVIO_ENTRY_SERVER,
+AVIO_ENTRY_SHARE,
+AVIO_ENTRY_WORKGROUP,
 };
 
 /**
diff --git a/libavformat/version.h b/libavformat/version.h
index 2c7c621..1c78df2 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR  28
+#define LIBAVFORMAT_VERSION_MINOR  29
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
2.3.3

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


[FFmpeg-devel] [PATCH 2/3] doc/examples: Handle new types in avio_list_dir

2015-04-02 Thread Mariusz Szczepańczyk
---
 doc/examples/avio_list_dir.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/doc/examples/avio_list_dir.c b/doc/examples/avio_list_dir.c
index 37b80c5..281b5af 100644
--- a/doc/examples/avio_list_dir.c
+++ b/doc/examples/avio_list_dir.c
@@ -41,6 +41,12 @@ static const char *type_string(int type)
 return "";
 case AVIO_ENTRY_SOCKET:
 return "";
+case AVIO_ENTRY_SERVER:
+return "";
+case AVIO_ENTRY_SHARE:
+return "";
+case AVIO_ENTRY_WORKGROUP:
+return "";
 case AVIO_ENTRY_UNKNOWN:
 default:
 break;
-- 
2.3.3

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


[FFmpeg-devel] [PATCH 0/3] [GSoC] directory listing for samba

2015-04-02 Thread Mariusz Szczepańczyk
Hi,

this set of patches implements directory listing callbacks for SMB protocol.
It also extends AVIODirEntryType enum with few elements needed to cover all
relevant file types served by samba.

One of the samba types, SMBC_LINK is mapped to AVIO_ENTRY_UNKNOWN, since it
doesn't seem to be ever returned by libsmbclient. I asked about it on samba
mailing list but haven't been answered yet.

Regards,
Mariusz


Mariusz Szczepańczyk (3):
  lavf/avio: Add new types to AVIODirEntryType, bump minor version
  doc/examples: Handle new types in avio_list_dir
  lavf/libsmbclient: implement directory listing callbacks

 doc/APIchanges   |   5 ++
 doc/examples/avio_list_dir.c |   6 +++
 libavformat/avio.h   |   5 +-
 libavformat/libsmbclient.c   | 108 +++
 libavformat/version.h|   2 +-
 5 files changed, 124 insertions(+), 2 deletions(-)

-- 
2.3.3

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


Re: [FFmpeg-devel] [PATCH] doc/protocols: explain FTP truncuation problem

2015-04-02 Thread Michael Niedermayer
On Fri, Apr 03, 2015 at 12:45:34AM +0200, Lukasz Marek wrote:
> Signed-off-by: Lukasz Marek 
> ---
>  doc/protocols.texi | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)

content LGTM
spelling/grammer, cant comment

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

You can kill me, but you cannot change the truth.


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


[FFmpeg-devel] [PATCH] doc/protocols: explain FTP truncuation problem

2015-04-02 Thread Lukasz Marek
Signed-off-by: Lukasz Marek 
---
 doc/protocols.texi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 2a19b41..73c511c 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -183,7 +183,11 @@ to be seekable. Default value is 0.
 NOTE: Protocol can be used as output, but it is recommended to not do
 it, unless special care is taken (tests, customized server configuration
 etc.). Different FTP servers behave in different way during seek
-operation. ff* tools may produce incomplete content due to server limitations.
+operation. Some servers will overwrite existing data after seeking backward,
+which is expected by FFmpeg, but some servers truncate file at new position.
+Unless FFmpeg can seek backward without truncuation, it may produce incomplete
+or corrupted content. Some FTP servers behave in expected way by default,
+some are configurable, some cannot be used to store files directly.
 
 @section gopher
 
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] Fix regression preventing vtag being used as a source option.

2015-04-02 Thread Carl Eugen Hoyos
tim nicholson  ffmpeg.org> writes:

> As per discussion ["FFmpeg-user] using -vtag on input files"

Thank you!

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH 3/3] doc: Slightly revise AviSynth version info

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 03:38:55PM -0400, Stephen Hutchinson wrote:
> ---
>  doc/general.texi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

applied

thanks

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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


Re: [FFmpeg-devel] [PATCH 2/3] avisynth: Bump minimum required version to interface version 6

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 03:38:54PM -0400, Stephen Hutchinson wrote:
> The AVSC_API changes in the new headers mean that the 2.6 alphas
> are just as incompatible as 2.5 is.
> ---
>  libavformat/avisynth.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)

applied

thanks

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

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"


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


Re: [FFmpeg-devel] [PATCH 1/3] avisynth: Fix detection of AviSynth 2.5

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 03:38:53PM -0400, Stephen Hutchinson wrote:
> In order to safely exit when the user tries to use AviSynth 2.5,
> the continue_on_fail value for 2.6's functions need to be set to
> 1.  Otherwise, the library loader fails before the 'upgrade to
> 2.6' log message appears.
> ---
>  libavformat/avisynth.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)

applied

thanks

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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


Re: [FFmpeg-devel] [PATCH] avcodec/pngenc: don't return a value in a void function

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 05:19:41PM -0300, James Almer wrote:
> Should fix compilation failures with strict compilers
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/pngenc.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

applied

btw, no need to send patches for such things, just push them if you
notice such obvious and serious mistakes

thanks

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


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] lavu/dict: fix set function when reuse existing key pointer

2015-04-02 Thread Lukasz Marek

On 02.04.2015 01:09, Michael Niedermayer wrote:

On Thu, Apr 02, 2015 at 12:37:34AM +0200, Lukasz Marek wrote:

On 01.04.2015 04:33, Michael Niedermayer wrote:

On Wed, Apr 01, 2015 at 03:25:23AM +0200, Lukasz Marek wrote:

Fixes following scenario:

av_dict_set(&d, "key", "old", 0);
AVDictionaryEentry *e = av_dict_get(d, "key", NULL, 0);
av_dict_set(&d, e->key, "new", 0);

Signed-off-by: Lukasz Marek 
---
  libavutil/dict.c | 18 --
  1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 0d54c79..3163894 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -72,6 +72,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const 
char *value,
  AVDictionary *m = *pm;
  AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);
  char *oldval = NULL;
+int the_same_key = 0;



does it work to av_strdup() both key and value if they need to be
strduped but at the top of the function and simplify the rest
accordingly ?



something like attached?


yes, LGTM if tested with valgrind or similar


Yes, I've tested with valgrind. Pushed.

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


Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server

2015-04-02 Thread Nicolas George
Le tridi 13 germinal, an CCXXIII, Stephan Holljes a écrit :
> How would http listening work as an input option?

I do not see any particular problem.

With your current patch, you can do:

ffmpeg $input $output_options -listen 1 http://0:1234
ffmpeg -i http://host:1234/ $remote_output

It would work the symmetric way:

ffmpeg -listen 1 -i http://0:1234 $output
ffmpeg $input $output_options http://host:1234/

You can already do part of the work with socat as a server:

socat tcp-listen:1234,reuseaddr -
ffmpeg -lavfi sine -f framecrc -t 1 -chunked_post 0 
http://localhost:1234/foo/bar

The result in the socat terminal looks like that (I use framecrc to avoid
dumping binary to the tty in this example case):

POST /foo/bar HTTP/1.1
User-Agent: Lavf/56.25.101
Accept: */*
Connection: close
Host: localhost:1234
Icy-MetaData: 1

#software: Lavf56.25.101
#tb 0: 1/44100
0,  0,  0, 1024, 2048, 0x1ee8f45a
0,   1024,   1024, 1024, 2048, 0x273ef6ee
0,   2048,   2048, 1024, 2048, 0x0a5f0111
0,   3072,   3072, 1024, 2048, 0x51be06b8

Basically, on top of what is already working, you would just need to
summarily parse the headers to skip them.

The full project, if accepted by Google, would involve, amongst other
things, correctly parsing the headers. Without it, it will badly break with
chunked transfer encoding. It would also involve finding a way of taking the
request string into account and exporting it to the application.

Of course, if you have other ideas to strengthen your application, do not
hesitate to discuss them, but implementing input looks like a good
result/work ratio.

The patch itself looks ok enough (I saw a stray empty line, that is one of
the details we learn to spot while proofreading patches before sending them,
it does not matter much). I will have time to re-test carefully and arrange
merging on Saturday, if nobody has other remarks.

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 2/2] fate: add AVDictionary tests

2015-04-02 Thread Lukasz Marek

On 02.04.2015 01:43, Michael Niedermayer wrote:

On Thu, Apr 02, 2015 at 12:38:20AM +0200, Lukasz Marek wrote:

On 01.04.2015 03:25, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek 
---
  tests/fate/libavutil.mak |  4 
  tests/ref/fate/dict  | 26 ++


I added more tests, so please see 2 attached instead


LGTM


Pushed both.

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


Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server

2015-04-02 Thread Stephan Holljes
On Mon, Mar 30, 2015 at 5:19 PM, Nicolas George  wrote:
> Le nonidi 9 germinal, an CCXXIII, Stephan Holljes a écrit :
>> I hope this addresses the issues mentioned.
>> I added a new label in case of failure in http_open() in favor of
>> duplicated code (i.e. calling av_dict_free() multiple times). I copied
>> the style from the other functions.
>>
>> Signed-off-by: Stephan Holljes 
>
> The patch looks good to me (acronym to learn: LGTM) as is or with the code
> moved into a separate function point.
>
> Except one more point that was not addressed earlier: if you want to add
> comments to a Git patch email, you need to put them between the "---" and
> the first "diff --git" lines. That is where the small stats "2 files
> changed, 28 insertions(+), 1 deletion(-)" is already inserted, it is
> considered as a simple comment too.
>
> If you put them before the "---" line, it becomes part of the commit message
> when the patch is applied from the mail. For the final version, maybe better
> attach the patch or push it to a public clone.
>
> At this point, I suspect you can consider this will be applied soon (better
> give it maybe two days before asking for merging) and, if you want to
> strengthen your application, make the patch even better, for example getting
> it to work for input as well as output.

How would http listening work as an input option?

>
> For that, I suspect it will be convenient for you to isolate the code in its
> own function, that makes handling the variables and the failure code path
> easier, so you probably better follow wm4's advice.
>
> Regards,
>
> --
>   Nicolas George
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

I moved the functionality opening the listening socket to a new function.
The patch is attached.
Sorry for the late reply, I had exams.

Regards,
Stephan Holljes
From c01ec773448a76485895171cbfb296657d56da97 Mon Sep 17 00:00:00 2001
From: Stephan Holljes 
Date: Thu, 2 Apr 2015 22:49:07 +0200
Subject: [PATCH] libavformat/http.c: Add proof-of-concept http server.

Signed-off-by: Stephan Holljes 
---
 doc/protocols.texi |  3 +++
 libavformat/http.c | 31 +++
 2 files changed, 34 insertions(+)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 2a19b41..5b7b6cf 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -277,6 +277,9 @@ Set initial byte offset.
 
 @item end_offset
 Try to limit the request to bytes preceding this offset.
+
+@item listen
+If set to 1 enables experimental HTTP server.
 @end table
 
 @subsection HTTP Cookies
diff --git a/libavformat/http.c b/libavformat/http.c
index 45533e4..3276737 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -96,6 +96,7 @@ typedef struct HTTPContext {
 int send_expect_100;
 char *method;
 int reconnect;
+int listen;
 } HTTPContext;
 
 #define OFFSET(x) offsetof(HTTPContext, x)
@@ -127,6 +128,7 @@ static const AVOption options[] = {
 { "end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D },
 { "method", "Override the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
 { "reconnect", "auto reconnect after disconnect before EOF", OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
+{ "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
 { NULL }
 };
 
@@ -296,6 +298,31 @@ int ff_http_averror(int status_code, int default_averror)
 return default_averror;
 }
 
+static int http_listen(URLContext *h, const char *uri, int flags,
+   AVDictionary **options) {
+HTTPContext *s = h->priv_data;
+int ret;
+static const char header[] = "HTTP/1.1 200 OK\r\nContent-Type: application/octet-stream\r\nTransfer-Encoding: chunked\r\n\r\n";
+char hostname[1024];
+char lower_url[100];
+int port;
+av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
+ NULL, 0, uri);
+ff_url_join(lower_url, sizeof(lower_url), "tcp", NULL, hostname, port,
+NULL);
+av_dict_set(options, "listen", "1", 0);
+if (ret = ffurl_open(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
+ &h->interrupt_callback, options) < 0)
+goto fail;
+if (ret = ffurl_write(s->hd, header, strlen(header)) < 0)
+goto fail;
+return 0;
+
+fail:
+av_dict_free(&s->chained_options);
+return ret;
+}
+
 static int http_open(URLContext *h, const char *uri, int flags,
  AVDictionary **options)
 {
@@ -321,12 +348,16 @@ static int http_open(URLContext *h, const char *uri, int flags,
"No trailing CRLF found in HTTP header.\n");
 }
 
+if (s->listen) {
+return http_listen(h, uri, flags, options);
+}
 ret = http_open_cnx(h, options);
 if (ret

[FFmpeg-devel] [PATCH] avcodec/pngenc: don't return a value in a void function

2015-04-02 Thread James Almer
Should fix compilation failures with strict compilers

Signed-off-by: James Almer 
---
 libavcodec/pngenc.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 8699b80..7a9d0b0 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -229,8 +229,10 @@ static void png_write_image_data(AVCodecContext *avctx,
 const AVCRC *crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
 uint32_t crc = ~0U;
 
-if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_number == 0)
-return png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), buf, 
length);
+if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_number == 0) {
+png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), buf, 
length);
+return;
+}
 
 bytestream_put_be32(&s->bytestream, length + 4);
 
-- 
2.3.4

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


[FFmpeg-devel] [PATCH 2/3] avisynth: Bump minimum required version to interface version 6

2015-04-02 Thread Stephen Hutchinson
The AVSC_API changes in the new headers mean that the 2.6 alphas
are just as incompatible as 2.5 is.
---
 libavformat/avisynth.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 84b7d04..4af58f6 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -406,13 +406,14 @@ static int avisynth_open_file(AVFormatContext *s)
 avs->vi   = avs_library.avs_get_video_info(avs->clip);
 
 #ifdef USING_AVISYNTH
-/* FFmpeg only supports AviSynth 2.6 on Windows. Since AvxSynth
- * identifies itself as interface version 3 like 2.5.8, this
- * needs to be special-cased. */
+/* On Windows, FFmpeg supports AviSynth interface version 6 or higher.
+ * This includes AviSynth 2.6 RC1 or higher, and AviSynth+ r1718 or higher,
+ * and excludes 2.5 and the 2.6 alphas. Since AvxSynth identifies itself
+ * as interface version 3 like 2.5.8, this needs to be special-cased. */
 
-if (avs_library.avs_get_version(avs->clip) == 3) {
+if (avs_library.avs_get_version(avs->clip) < 6) {
 av_log(s, AV_LOG_ERROR,
-   "AviSynth 2.5.8 not supported. Please upgrade to 2.6.\n");
+   "AviSynth version is too old. Please upgrade to either AviSynth 
2.6 >= RC1 or AviSynth+ >= r1718.\n");
 ret = AVERROR_UNKNOWN;
 goto fail;
 }
-- 
2.1.0

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


[FFmpeg-devel] [PATCH 3/3] doc: Slightly revise AviSynth version info

2015-04-02 Thread Stephen Hutchinson
---
 doc/general.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/general.texi b/doc/general.texi
index 85ee219..f8e7470 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -179,8 +179,8 @@ included in compat/avisynth/, which allows the user to 
enable support
 without needing to search for these headers themselves.
 
 For Windows, supported AviSynth variants are
-@url{http://avisynth.nl, AviSynth 2.6} for 32-bit builds and
-@url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
+@url{http://avisynth.nl, AviSynth 2.6 RC1 or higher} for 32-bit builds and
+@url{http://avs-plus.net, AviSynth+ r1718 or higher} for 32-bit and 64-bit 
builds.
 
 For Linux and OS X, the supported AviSynth variant is
 @url{https://github.com/avxsynth/avxsynth, AvxSynth}.
-- 
2.1.0

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


[FFmpeg-devel] [PATCH 0/3] Fix AviSynth upgrade message

2015-04-02 Thread Stephen Hutchinson
There was a minor regression introduced by adding the
new 2.6 functions in avisynth_load_library, because
the continue_on_fail value wasn't set correctly.

This meant that if the user attempted to use an
incompatible version of AviSynth, it wouldn't
show the error message telling them to upgrade.

Since 2.6 versions prior to RC1 also suffer
from incompatibility issues, make the version
checker reject all versions prior to version 6.

Regarding AviSynth+, the upgrade message
currently uses the revision-based version
since 0.2 hasn't been released yet. Once
0.2 has been released, then the message
should be adjusted to use that instead.

Stephen Hutchinson (3):
  avisynth: Fix detection of AviSynth 2.5
  avisynth: Bump minimum required version to interface version 6
  doc: Slightly revise AviSynth version info

 doc/general.texi   |  4 ++--
 libavformat/avisynth.c | 29 +++--
 2 files changed, 17 insertions(+), 16 deletions(-)

-- 
2.1.0

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


[FFmpeg-devel] [PATCH 1/3] avisynth: Fix detection of AviSynth 2.5

2015-04-02 Thread Stephen Hutchinson
In order to safely exit when the user tries to use AviSynth 2.5,
the continue_on_fail value for 2.6's functions need to be set to
1.  Otherwise, the library loader fails before the 'upgrade to
2.6' log message appears.
---
 libavformat/avisynth.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 7b3f2c6..84b7d04 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -139,15 +139,15 @@ static av_cold int avisynth_load_library(void)
 LOAD_AVS_FUNC(avs_release_video_frame, 0);
 LOAD_AVS_FUNC(avs_take_clip, 0);
 #ifdef USING_AVISYNTH
-LOAD_AVS_FUNC(avs_bits_per_pixel, 0);
-LOAD_AVS_FUNC(avs_get_height_p, 0);
-LOAD_AVS_FUNC(avs_get_pitch_p, 0);
-LOAD_AVS_FUNC(avs_get_read_ptr_p, 0);
-LOAD_AVS_FUNC(avs_get_row_size_p, 0);
-LOAD_AVS_FUNC(avs_is_yv24, 0);
-LOAD_AVS_FUNC(avs_is_yv16, 0);
-LOAD_AVS_FUNC(avs_is_yv411, 0);
-LOAD_AVS_FUNC(avs_is_y8, 0);
+LOAD_AVS_FUNC(avs_bits_per_pixel, 1);
+LOAD_AVS_FUNC(avs_get_height_p, 1);
+LOAD_AVS_FUNC(avs_get_pitch_p, 1);
+LOAD_AVS_FUNC(avs_get_read_ptr_p, 1);
+LOAD_AVS_FUNC(avs_get_row_size_p, 1);
+LOAD_AVS_FUNC(avs_is_yv24, 1);
+LOAD_AVS_FUNC(avs_is_yv16, 1);
+LOAD_AVS_FUNC(avs_is_yv411, 1);
+LOAD_AVS_FUNC(avs_is_y8, 1);
 #endif
 #undef LOAD_AVS_FUNC
 
-- 
2.1.0

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


Re: [FFmpeg-devel] Patch for High color and High bit-depth support

2015-04-02 Thread Debargha Mukherjee
On Wed, Apr 1, 2015 at 3:11 PM, Debargha Mukherjee 
wrote:

> Updated patch.
>
> On Wed, Apr 1, 2015 at 3:10 PM, Debargha Mukherjee 
> wrote:
>
>>
>>
>> On Tue, Mar 31, 2015 at 4:16 PM, James Zern  wrote:
>>
>>> On Mon, Mar 30, 2015 at 10:26 AM, Debargha Mukherjee
>>>  wrote:
>>> > On Fri, Mar 27, 2015 at 8:07 PM, James Zern  wrote:
>>> >
>>> >> On Fri, Mar 27, 2015 at 6:58 PM, Debargha Mukherjee <
>>> debar...@google.com>
>>> >> wrote:
>>> >> > [...]
>>> >>
>>> >> > +#if CONFIG_LIBVPX_VP9_ENCODER && defined(VPX_IMG_FMT_HIGHBITDEPTH)
>>> >> > +static int set_pix_fmt(AVCodecContext *avctx, struct
>>> vpx_codec_enc_cfg
>>> >> *enccfg,
>>> >> > +   vpx_codec_flags_t *flags, vpx_img_fmt_t
>>> >> *img_fmt) {
>>> >> > +if (avctx->codec_id == AV_CODEC_ID_VP8 && avctx->pix_fmt !=
>>> >> AV_PIX_FMT_YUV420P) {
>>> >> >
>>> >>
>>> >> couldn't you just check a codec capability? what happens when vp9 is
>>> >> configured
>>> >> with high bitdepth encoding disabled?
>>> >>
>>> >
>>> > I wanted to insulate against compiling with an older version of libvpx
>>> that
>>> > did not have the highbitdepth flags defined. This is how we did the
>>> > libvpxdec.
>>> > I have added a codec caps check also to the code.
>>> >
>>>
>>> OK, but if you're checking for VPX_IMG_FMT_HIGHBITDEPTH then couldn't
>>> you just rely on the presence of the codec capability? If the mapping
>>> is for vp9 only then cap+vp9 check is all right, you can drop the vp8
>>> check as that code can't be reached (maybe add an av_assert).
>>>
>>
>> Removed the vp8 check.
>>
>
Updated patch to handle the checks better.


>
>>
>>> ___
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>
>>
>>
>> --
>> Debargha Mukherjee, Ph.D.
>> Staff Software Engineer,
>> Google, Inc.
>> Email: debar...@google.com
>> Phone: 408-234-5956 (cell)
>>
>
>
>
> --
> Debargha Mukherjee, Ph.D.
> Staff Software Engineer,
> Google, Inc.
> Email: debar...@google.com
> Phone: 408-234-5956 (cell)
>



-- 
Debargha Mukherjee, Ph.D.
Staff Software Engineer,
Google, Inc.
Email: debar...@google.com
Phone: 408-234-5956 (cell)
From 2a86c6444bfa63d544f98af254613ce2b8c475da Mon Sep 17 00:00:00 2001
From: Deb Mukherjee 
Date: Wed, 25 Mar 2015 17:10:16 -0700
Subject: [PATCH] Support for VP9 high-color/high-bit-depth encoding

Patch to support VP9 encoding with new profiles 1-3.
Profile 1 (8-bit 422/444) should work with default libvpx
configuration.
However you will need to configure libvpx with
--enable-vp9-highbitdepth before building and linking
with ffmpeg for profile 2 (10-/12-bit 420) and profile 3
(10-/12-bit 422/444) encoding.

You may use the appropriate profile option on the
command line:
-profile:v 1 for 422/444 8-bit encoding
-profile:v 2 for 420 10-/12- bit encoding
-profile:v 3 for 422/444 10-/12-bit encoding
If you do not use the -profile:v option, it will be deduced
from the source format.
---
 libavcodec/libvpxenc.c | 108 -
 1 file changed, 106 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 176c6b6..faf4cb2 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -149,12 +149,19 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx,
 av_log(avctx, level, "vpx_codec_enc_cfg\n");
 av_log(avctx, level, "generic settings\n"
"  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n"
+#if CONFIG_LIBVPX_VP9_ENCODER && defined(VPX_IMG_FMT_HIGHBITDEPTH)
+   "  %*s%u\n  %*s%u\n"
+#endif
"  %*s{%u/%u}\n  %*s%u\n  %*s%d\n  %*s%u\n",
width, "g_usage:",   cfg->g_usage,
width, "g_threads:", cfg->g_threads,
width, "g_profile:", cfg->g_profile,
width, "g_w:",   cfg->g_w,
width, "g_h:",   cfg->g_h,
+#if CONFIG_LIBVPX_VP9_ENCODER && defined(VPX_IMG_FMT_HIGHBITDEPTH)
+   width, "g_bit_depth:",   cfg->g_bit_depth,
+   width, "g_input_bit_depth:", cfg->g_input_bit_depth,
+#endif
width, "g_timebase:",cfg->g_timebase.num, cfg->g_timebase.den,
width, "g_error_resilient:", cfg->g_error_resilient,
width, "g_pass:",cfg->g_pass,
@@ -259,6 +266,78 @@ static av_cold int vp8_free(AVCodecContext *avctx)
 return 0;
 }
 
+#if CONFIG_LIBVPX_VP9_ENCODER
+static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t codec_caps,
+   struct vpx_codec_enc_cfg *enccfg, vpx_codec_flags_t *flags,
+   vpx_img_fmt_t *img_fmt) {
+switch (avctx->pix_fmt) {
+case AV_PIX_FMT_YUV420P:
+#ifdef VPX_IMG_FMT_HIGHBITDEPTH
+enccfg->g_bit_depth = enccfg->g_input_bit_depth = 8;
+#endif
+enccfg->g_profile = 0;
+*img_fmt = VPX_IMG_FMT_I420;
+return 0;
+case AV_PIX_FMT_YUV422P:
+#if

Re: [FFmpeg-devel] [PATCH] png: Use libavutil's crc functions instead of zlib's

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 03:09:18PM +, Donny Yang wrote:
> Signed-off-by: Donny Yang 
> ---
>  libavcodec/pngenc.c | 22 --
>  1 file changed, 12 insertions(+), 10 deletions(-)

patch applied

maybe you want to add a fate test for apng as well ?

thanks

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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


Re: [FFmpeg-devel] [PATCH] Fix regression preventing vtag being used as a source option.

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 05:45:14PM +0100, tim nicholson wrote:
> As per discussion ["FFmpeg-user] using -vtag on input files"
> 
> untested (as Carl would say) ;)
> -- 
> Tim.
> Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83

>  ffmpeg_opt.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> ee3ce9b375b4e71a0524a4810aa609e07b7112eb  
> 0001-ffmpeg_opt.c-fix-regression-introduced-in-5743095c.patch
> From fa1b11ae65f6c0c6cd7f5fa11054d2db93c29af4 Mon Sep 17 00:00:00 2001
> From: Tim Nicholson 
> Date: Thu, 2 Apr 2015 17:41:22 +0100
> Subject: [PATCH] ffmpeg_opt.c: fix regression introduced in 5743095c

confirmed to work

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : exr lossy compression B44 based on OpenEXR code

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 07:31:07PM +0200, Michael Niedermayer wrote:
> On Thu, Apr 02, 2015 at 04:56:18PM +0200, Martin Vignali wrote:
> > I doesn't test yet the patch.
> > 
> > But if you need to,
> > two samples create with After Effects from  (
> > http://fr.wikipedia.org/wiki/FFmpeg#/media/File:FFmpeg_Logo_new.svg)
> > 
> 
> > EXR B44 Half Float
> > http://www.datafilehost.com/d/b3fdd446
> 
> this seems not to work with the patch
> 
> also the patch still lacks copyright as derek reminded me

the patch also breaks make fate

--- ./tests/ref/fate/exr-slice-rle  2015-03-30 05:05:30.185417166 +0200
+++ tests/data/fate/exr-slice-rle   2015-04-02 19:48:41.495994181 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,  0,  0,1,  3169800, 0x6a356d0d
+0,  0,  0,1,  3169800, 0x
Test exr-slice-rle failed. Look at tests/data/fate/exr-slice-rle.err for 
details.
make: *** [fate-exr-slice-rle] Error 1
make: *** Waiting for unfinished jobs


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : exr lossy compression B44 based on OpenEXR code

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 04:56:18PM +0200, Martin Vignali wrote:
> I doesn't test yet the patch.
> 
> But if you need to,
> two samples create with After Effects from  (
> http://fr.wikipedia.org/wiki/FFmpeg#/media/File:FFmpeg_Logo_new.svg)
> 

> EXR B44 Half Float
> http://www.datafilehost.com/d/b3fdd446

this seems not to work with the patch

also the patch still lacks copyright as derek reminded me

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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


[FFmpeg-devel] [PATCH] Fix regression preventing vtag being used as a source option.

2015-04-02 Thread tim nicholson
As per discussion ["FFmpeg-user] using -vtag on input files"

untested (as Carl would say) ;)
-- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
>From fa1b11ae65f6c0c6cd7f5fa11054d2db93c29af4 Mon Sep 17 00:00:00 2001
From: Tim Nicholson 
Date: Thu, 2 Apr 2015 17:41:22 +0100
Subject: [PATCH] ffmpeg_opt.c: fix regression introduced in 5743095c

-vtag is an input and output option.

Signed-off-by: Tim Nicholson 
---
 ffmpeg_opt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index fb7490a..15eee0b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -3040,7 +3040,7 @@ const OptionDef options[] = {
   OPT_INPUT | OPT_OUTPUT,{ .off = OFFSET(top_field_first) },
 "top=1/bottom=0/auto=-1 field first", "" },
 { "vtag", OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_PERFILE |
-  OPT_OUTPUT,{ .func_arg = opt_old2new },
+  OPT_INPUT | OPT_OUTPUT,{ .func_arg = opt_old2new },
 "force video tag/fourcc", "fourcc/tag" },
 { "qphist",   OPT_VIDEO | OPT_BOOL | OPT_EXPERT ,{ &qp_hist },
 "show QP histogram" },
-- 
1.9.1

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


[FFmpeg-devel] [PATCH] png: Use libavutil's crc functions instead of zlib's

2015-04-02 Thread Donny Yang
Signed-off-by: Donny Yang 
---
 libavcodec/pngenc.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 4349d1a..8699b80 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -27,6 +27,7 @@
 #include "apng.h"
 
 #include "libavutil/avassert.h"
+#include "libavutil/crc.h"
 #include "libavutil/libm.h"
 #include "libavutil/opt.h"
 #include "libavutil/color_utils.h"
@@ -205,27 +206,28 @@ static uint8_t *png_choose_filter(PNGEncContext *s, 
uint8_t *dst,
 static void png_write_chunk(uint8_t **f, uint32_t tag,
 const uint8_t *buf, int length)
 {
-uint32_t crc;
+const AVCRC *crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
+uint32_t crc = ~0U;
 uint8_t tagbuf[4];
 
 bytestream_put_be32(f, length);
-crc = crc32(0, Z_NULL, 0);
 AV_WL32(tagbuf, tag);
-crc = crc32(crc, tagbuf, 4);
+crc = av_crc(crc_table, crc, tagbuf, 4);
 bytestream_put_be32(f, av_bswap32(tag));
 if (length > 0) {
-crc = crc32(crc, buf, length);
+crc = av_crc(crc_table, crc, buf, length);
 memcpy(*f, buf, length);
 *f += length;
 }
-bytestream_put_be32(f, crc);
+bytestream_put_be32(f, ~crc);
 }
 
 static void png_write_image_data(AVCodecContext *avctx,
  const uint8_t *buf, int length)
 {
 PNGEncContext *s = avctx->priv_data;
-uint32_t crc = crc32(0, Z_NULL, 0);
+const AVCRC *crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
+uint32_t crc = ~0U;
 
 if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_number == 0)
 return png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), buf, 
length);
@@ -234,13 +236,13 @@ static void png_write_image_data(AVCodecContext *avctx,
 
 bytestream_put_be32(&s->bytestream, MKBETAG('f', 'd', 'A', 'T'));
 bytestream_put_be32(&s->bytestream, s->sequence_number);
-crc = crc32(crc, s->bytestream - 8, 8);
+crc = av_crc(crc_table, crc, s->bytestream - 8, 8);
 
-crc = crc32(crc, buf, length);
+crc = av_crc(crc_table, crc, buf, length);
 memcpy(s->bytestream, buf, length);
 s->bytestream += length;
 
-bytestream_put_be32(&s->bytestream, crc);
+bytestream_put_be32(&s->bytestream, ~crc);
 
 ++s->sequence_number;
 }
@@ -536,7 +538,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
 uint8_t buf[26];
 
 if (avctx->codec_id == AV_CODEC_ID_APNG && s->color_type == 
PNG_COLOR_TYPE_PALETTE) {
-uint32_t checksum = crc32(crc32(0, Z_NULL, 0), pict->data[1], 256 * 
sizeof(uint32_t));
+uint32_t checksum = ~av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), ~0U, 
pict->data[1], 256 * sizeof(uint32_t));
 
 if (avctx->frame_number == 0) {
 s->palette_checksum = checksum;
-- 
2.3.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : exr lossy compression B44 based on OpenEXR code

2015-04-02 Thread Martin Vignali
I doesn't test yet the patch.

But if you need to,
two samples create with After Effects from  (
http://fr.wikipedia.org/wiki/FFmpeg#/media/File:FFmpeg_Logo_new.svg)

EXR B44 Half Float
http://www.datafilehost.com/d/b3fdd446

EXR B44 Float
http://www.datafilehost.com/d/5fea8262

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


Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : exr lossy compression B44 based on OpenEXR code

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 07:32:39PM +0530, greeshma wrote:
> The patch is now getting applied.
> PFA.

where can we find EXR B44 samples to test the code?

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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


Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : exr lossy compression B44 based on OpenEXR code

2015-04-02 Thread greeshma
The patch is now getting applied.
PFA.



Greeshma


On Sat, Mar 28, 2015 at 8:39 AM, Michael Niedermayer 
wrote:

> On Sat, Mar 28, 2015 at 02:33:44AM +0530, greeshma wrote:
> > The corrected patch is attached.
> > PFA
> >
> > Greeshma
>
> >  exr.c |  117
> ++
> >  1 file changed, 117 insertions(+)
> > d4e16ed891ed0035e8dc552efbd37f5bdcd5bf78
> 0001-exr-lossy-compression-B44-based-on-OpenEXR-code.patch
> > From 9ab93eb32d4ee7a8cacc5ce98239dd12bc75bf42 Mon Sep 17 00:00:00 2001
> > From: greeshmab 
> > Date: Tue, 24 Mar 2015 12:36:21 +0530
> > Subject: [PATCH] exr lossy compression B44(based on OpenEXR code)
> >  Signed-off-by: Greeshma 
>
> does not apply:
> Applying: exr lossy compression B44(based on OpenEXR code) Signed-off-by:
> Greeshma 
> fatal: corrupt patch at line 133
> Repository lacks necessary blobs to fall back on 3-way merge.
> Cannot fall back to three-way merge.
> Patch failed at 0001 exr lossy compression B44(based on OpenEXR code)
> Signed-off-by: Greeshma 
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
>
> please make sure you attach the git patch without modifications
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The real ebay dictionary, page 3
> "Rare item" - "Common item with rare defect or maybe just a lie"
> "Professional" - "'Toy' made in china, not functional except as doorstop"
> "Experts will know" - "The seller hopes you are not an expert"
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
From 41b04641402c50dc5ac1058901ca522c68091163 Mon Sep 17 00:00:00 2001
From: greeshmab 
Date: Wed, 1 Apr 2015 18:56:54 +0530
Subject: [PATCH] exr lossy compression B44 based on OpenEXR code
 Signed-off-by: Greeshma 

---
 libavcodec/exr.c | 113 +++
 1 file changed, 113 insertions(+)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index f9525ec..9e51a73 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -770,6 +770,116 @@ static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize,
 return 0;
 }
 
+
+static void B44_unpack14 ( GetByteContext *gb, uint16_t out[16]){
+uint16_t shift;
+const uint8_t *r = gb->buffer;
+av_assert0(r[2] != 0xfc);
+out[0] = (r[0] << 8) | r[1];
+shift = (r[2] >> 2);
+out[ 1] = out[ 0] + ((r[ 5] >> 2) << shift);
+out[ 2] = out[ 1] + ((r[ 8] >> 2) << shift);
+out[ 3] = out[ 2] + ((r[11] >> 2) << shift);
+out[ 4] = out[ 0] + (((r[ 2] << 4) | (r[ 3] >> 4)) << shift);
+out[ 5] = out[ 4] + (((r[ 5] << 4) | (r[ 6] >> 4)) << shift);
+out[ 6] = out[ 5] + (((r[ 8] << 4) | (r[ 9] >> 4)) << shift);
+out[ 7] = out[ 6] + (((r[11] << 4) | (r[12] >> 4)) << shift);
+out[ 8] = out[ 4] + (((r[ 3] << 2) | (r[ 4] >> 6)) << shift);
+out[ 9] = out[ 8] + (((r[ 6] << 2) | (r[ 7] >> 6)) << shift);
+out[10] = out[ 9] + (((r[ 9] << 2) | (r[10] >> 6)) << shift);
+out[11] = out[10] + (((r[12] << 2) | (r[13] >> 6)) << shift);
+out[12] = out[ 8] + (r[ 4]  << shift);
+out[13] = out[12] + (r[ 7]  << shift);
+out[14] = out[13] + (r[10]  << shift);
+out[15] = out[14] + (r[13]  << shift);
+for (int i = 0; i < 16; ++i) {
+if (out[i] & 0x8000)
+out[i] &= 0x7fff;
+else
+out[i] = ~out[i];
+}
+}
+
+static void B44_unpack3 ( GetByteContext *gb, uint16_t out[16]){
+const uint8_t *r = gb->buffer;   //pixels have the same value
+av_assert0(r[2] == 0xfc);
+out[0] = (r[0] << 8) | r[1];
+if (out[0] & 0x8000)
+out[0] &= 0x7fff;
+else
+out[0] = ~out[0];
+for (int i = 1; i < 16; ++i)
+out[i] = out[0];
+}
+
+static int b44_uncompress(EXRContext *s, const uint8_t *src,int ssize, int dsize, EXRThreadData *td){
+GetByteContext gb;
+unsigned long  dest_len = dsize;
+uint8_t *out;
+int i, j;
+uint16_t *tmp = (uint16_t *)td->tmp;
+out = td->uncompressed_data;
+bytestream2_init(&gb, src, ssize);
+if (uncompress(td->tmp, &dest_len, src, ssize) != Z_OK || dest_len != dsize)
+return AVERROR_INVALIDDATA;
+for (i = 0; i < s->nb_channels; i++) {
+EXRChannel *channel = &s->channels[i];
+int size = channel->pixel_type;
+int inSize = ssize;
+if (channel->pixel_type != EXR_HALF) {  // UINT or FLOAT channel.
+int n = s->xdelta * s->ydelta * size * sizeof (*tmp);
+memcpy (tmp, gb.buffer, n);
+gb.buffer += n;
+inSize -= n;
+continue;
+} else {//EXR_HALF Channel
+for (int y=0; 

Re: [FFmpeg-devel] [PATCH] vda: fix h64 decoding, ?vda wants the entire buffer

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 11:51:29AM +, Rainer Hochecker wrote:
> Michael Niedermayer  gmx.at> writes:
> 
> 
> > 
> > have you tried this with both annex b and .mp4 style h264 ?
> > 
> > [...]
> 
> I have updated the patch and tested both styles:
> https://github.com/FFmpeg/FFmpeg/pull/129

applied

thanks

[...]
-- 
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] [PATCH] avcodec/nvenc: Fix profile parameter handling

2015-04-02 Thread Michael Niedermayer
On Wed, Apr 01, 2015 at 05:32:04PM -0700, Philip Langdale wrote:
> On Thu,  2 Apr 2015 00:04:07 +0200
> Timo Rothenpieler  wrote:
> 
> > It was not possible to set a profile before, the builtin profile
> > parameter does not seem to work propperly.
> > To be compatible with libx264, this overlays it with a local parameter
> > that expects a string, instead of an int, that takes the well known
> > values "high", "main" or "baseline".
> 
> Looks good to me.

applied

thanks

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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


Re: [FFmpeg-devel] [PATCH]lavf/mkv: Fix AAC remuxing

2015-04-02 Thread Hendrik Leppkes
On Thu, Apr 2, 2015 at 2:12 PM, Carl Eugen Hoyos  wrote:
> Carl Eugen Hoyos  ag.or.at> writes:
>
>> On Wednesday 01 April 2015 01:55:57 pm Carl Eugen Hoyos wrote:
>> > Attached patch fixes a user-reported regression when
>> > remuxing some streams containing aac to mkv.
>>
>> New patch attached.
>
> Ping, since this fixes a regression.
>

Muxing AAC without extradata into MKV is invalid. FFmpeg should not
produce invalid files.
Patch should not be applied.

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


Re: [FFmpeg-devel] [PATCH]lavf/mkv: Fix AAC remuxing

2015-04-02 Thread Carl Eugen Hoyos
Carl Eugen Hoyos  ag.or.at> writes:

> On Wednesday 01 April 2015 01:55:57 pm Carl Eugen Hoyos wrote:
> > Attached patch fixes a user-reported regression when
> > remuxing some streams containing aac to mkv.
> 
> New patch attached.

Ping, since this fixes a regression.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] vda: fix h64 decoding, vda wants the entire buffer

2015-04-02 Thread Rainer Hochecker
Michael Niedermayer  gmx.at> writes:


> 
> have you tried this with both annex b and .mp4 style h264 ?
> 
> [...]

I have updated the patch and tested both styles:
https://github.com/FFmpeg/FFmpeg/pull/129


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


Re: [FFmpeg-devel] [PATCH] Relaxed pattern to find ProRes in MXF.

2015-04-02 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/04/15 10:57, Steve Dierker wrote:
> Hello,
> 
>>
>> I am currently looking at the whole range of UL's to see if they can
>> be tidied up, but that will also take some time, so perhaps in the
>> interests of progress use your suggestion for now *but* change the
>> inline comment to something like:-
>>
>> /* Avid MC7 Prores */
>>
>> That will assist in identifying why the entry is there if we need to
>> update things, especially if the codec moves into the officially
>> recognised scope, as DNX did.
>>
> 
> I changed the comment and updated the patch. Here is the new file.
> 

+{ {
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x
60,0x02
}, 14, AV_CODEC_ID_MPEG2VIDEO }, /* Ikegami */

Errm where did this coming from, its unrelated (and wrong afaik as its a
container UL).


> btw: Is this the intended way to offer patches to FFmpeg?

if you mean git format-patch against master, yes.

> 
> best,
> Steve
> [...]

- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBAgAGBQJVHS0dAAoJEAwL/ESLC/yDEhYIALvaJcXst47BXby0UbhQzpLy
HVGOHUQzvDIHgcbUq+K7o3cs9JCrWvBKZCX3Wqvi9rPsB7scQqucTv0bTiz+vjO6
Y5QQCwRIitExcefOsDfZzy62szqg/8oUSQsohkJOMxdMt6904ucwVQFdzy7RJBVU
khgfCffoCCMeQlBZr7Lm+48HpioGwZvZXLIT9aJdzct886gqaS1MpCEsVDStsXTs
GH+mHp+64euNekpnfhMZ0xUl4vxKAOynR6tvfgCq5big76vP+aiVmKE7ovygep7I
YROkUlgkBWb+rphTZ7XXKLPJni6KC3OHML3IHY5FirQhmuPp2hBzS+AMmgLuSlQ=
=+Y3d
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] HEVC decoder debug in ffmpeg

2015-04-02 Thread Michael Niedermayer
On Wed, Apr 01, 2015 at 10:41:11PM -0400, Zhan Ma wrote:
> Dear experts
> 
> I am trying to do step-by-step debugging of HEVC decoder in ffmpeg for a 
> detailed study.  I created the eclipse project for ffmpeg and then compile 
> the ffmpeg using --enable-static and --enable-debug.  However, it seems that 
> I can't get into the low-level functions of HEVC, such as hls_coding_unit() 
> in libavcodec/hevc.c.  Anything is missed here? Thanks very much for your 
> comments.

the ffmpeg_g binary contains debug symbols you should use it or use
--disable-stripping
you also may want to use --disable-optimizations if your study is
unaffected by the speed of the code as it should reduce function
inlining

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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


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


Re: [FFmpeg-devel] [PATCH] ffmpeg: Avoid null pointer dereferences

2015-04-02 Thread Michael Niedermayer
On Thu, Apr 02, 2015 at 04:22:19PM +0530, Himangi Saraogi wrote:
> ---
>  ffmpeg.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

applied

thanks

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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 


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


[FFmpeg-devel] [PATCH] filtfmts: Avoid null pointer dereferences

2015-04-02 Thread Himangi Saraogi
---
 libavfilter/filtfmts.c | 58 --
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/libavfilter/filtfmts.c b/libavfilter/filtfmts.c
index c1025b9..d214c6c 100644
--- a/libavfilter/filtfmts.c
+++ b/libavfilter/filtfmts.c
@@ -34,32 +34,34 @@ static void print_formats(AVFilterContext *filter_ctx)
 
 #define PRINT_FMTS(inout, outin, INOUT) \
 for (i = 0; i < filter_ctx->nb_##inout##puts; i++) { \
-if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) {   \
-AVFilterFormats *fmts = \
-filter_ctx->inout##puts[i]->outin##_formats;\
-for (j = 0; j < fmts->nb_formats; j++)\
-if(av_get_pix_fmt_name(fmts->formats[j]))   \
-printf(#INOUT "PUT[%d] %s: fmt:%s\n",   \
-   i, avfilter_pad_get_name(filter_ctx->inout##put_pads, 
i),  \
-   av_get_pix_fmt_name(fmts->formats[j]));  \
-} else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
-AVFilterFormats *fmts;  \
-AVFilterChannelLayouts *layouts;\
-\
-fmts = filter_ctx->inout##puts[i]->outin##_formats; \
-for (j = 0; j < fmts->nb_formats; j++)\
-printf(#INOUT "PUT[%d] %s: fmt:%s\n",   \
-   i, avfilter_pad_get_name(filter_ctx->inout##put_pads, 
i),  \
-   av_get_sample_fmt_name(fmts->formats[j]));   \
-\
-layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
-for (j = 0; j < layouts->nb_channel_layouts; j++) {
  \
-char buf[256];  \
-av_get_channel_layout_string(buf, sizeof(buf), -1,  \
- layouts->channel_layouts[j]); 
\
-printf(#INOUT "PUT[%d] %s: chlayout:%s\n",  \
-   i, avfilter_pad_get_name(filter_ctx->inout##put_pads, 
i), buf); \
-}   \
+if (filter_ctx->inout##puts[i]) {\
+if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) {   \
+AVFilterFormats *fmts = \
+filter_ctx->inout##puts[i]->outin##_formats;\
+for (j = 0; j < fmts->nb_formats; j++)\
+if(av_get_pix_fmt_name(fmts->formats[j]))   \
+printf(#INOUT "PUT[%d] %s: fmt:%s\n",   \
+   i, 
avfilter_pad_get_name(filter_ctx->inout##put_pads, i),  \
+   av_get_pix_fmt_name(fmts->formats[j]));  \
+} else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) 
{ \
+AVFilterFormats *fmts;  \
+AVFilterChannelLayouts *layouts;\
+\
+fmts = filter_ctx->inout##puts[i]->outin##_formats; \
+for (j = 0; j < fmts->nb_formats; j++)\
+printf(#INOUT "PUT[%d] %s: fmt:%s\n",   \
+   i, 
avfilter_pad_get_name(filter_ctx->inout##put_pads, i),  \
+   av_get_sample_fmt_name(fmts->formats[j]));   \
+\
+layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; 
\
+for (j = 0; j < layouts->nb_channel_layouts; j++) {
  \
+char buf[256];  \
+av_get_channel_layout_string(buf, sizeof(buf), -1,  \
+ layouts->channel_layouts[j]); 
\
+printf(#INOUT "PUT[%d] %s: chlayout:%s\n",  \
+   i, 
avfilter_pad_get_name(filter_ctx->inout##put_pads, i), buf); \
+}   \
+}   \
 }   \
 }   \
 
@@ -115,11 +117,15 @@ int main(int argc, char **argv)
 /* create a link for each of the input pads */
 for (i = 0; i < filter_ctx->nb_inp

[FFmpeg-devel] [PATCH] ffmpeg: Avoid null pointer dereferences

2015-04-02 Thread Himangi Saraogi
---
 ffmpeg.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 67ce1f3..8bf507a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3171,17 +3171,22 @@ static int transcode_init(void)
 const char *in_codec_name  = "?";
 const char *encoder_name   = "?";
 const char *out_codec_name = "?";
+const AVCodecDescriptor *desc;
 
 if (in_codec) {
 decoder_name  = in_codec->name;
-in_codec_name = avcodec_descriptor_get(in_codec->id)->name;
+desc = avcodec_descriptor_get(in_codec->id);
+if (desc)
+in_codec_name = desc->name;
 if (!strcmp(decoder_name, in_codec_name))
 decoder_name = "native";
 }
 
 if (out_codec) {
 encoder_name   = out_codec->name;
-out_codec_name = avcodec_descriptor_get(out_codec->id)->name;
+desc = avcodec_descriptor_get(out_codec->id);
+if (desc)
+out_codec_name = desc->name;
 if (!strcmp(encoder_name, out_codec_name))
 encoder_name = "native";
 }
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] Relaxed pattern to find ProRes in MXF.

2015-04-02 Thread Steve Dierker
Hello,

> 
> I am currently looking at the whole range of UL's to see if they can
> be tidied up, but that will also take some time, so perhaps in the
> interests of progress use your suggestion for now *but* change the
> inline comment to something like:-
> 
> /* Avid MC7 Prores */
> 
> That will assist in identifying why the entry is there if we need to
> update things, especially if the codec moves into the officially
> recognised scope, as DNX did.
> 

I changed the comment and updated the patch. Here is the new file.

btw: Is this the intended way to offer patches to FFmpeg?

best,
Steve

-- 
--

XMPP: big...@jabber.ccc.de
GitHub: https://github.com/bigzed
Website: http://steved.org
From b4004016415fec724914a08ed916a93e10478b63 Mon Sep 17 00:00:00 2001
From: Steve Dierker 
Date: Thu, 2 Apr 2015 11:51:08 +0200
Subject: [PATCH] libavformat/mxf.c: Relaxed ProRes pattern

I found another MXF File containing ProRes with the following
codec_uls: 060E2B34040101010E04020102110500
Therefor I relaxed the pattern.

Related to issue #4349
---
 libavformat/mxf.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mxf.c b/libavformat/mxf.c
index 61b37f8..0f155b1 100644
--- a/libavformat/mxf.c
+++ b/libavformat/mxf.c
@@ -39,6 +39,7 @@ const MXFCodecUL ff_mxf_codec_uls[] = {
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* D-10 50Mbps PAL */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x03,0x03,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MP@HL Long GoP */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x04,0x02,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* 422P@HL I-Frame */
+{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x60,0x02 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* Ikegami */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x20,0x02,0x03 }, 14,  AV_CODEC_ID_MPEG4 }, /* XDCAM proxy_pal030926.mxf */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x02,0x01,0x02,0x00 }, 13,AV_CODEC_ID_DVVIDEO }, /* DV25 IEC PAL */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,   AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
@@ -50,7 +51,7 @@ const MXFCodecUL ff_mxf_codec_uls[] = {
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14,   AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x31,0x11,0x01 }, 14,   AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC SPS/PPS in-band */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x01 }, 16,   AV_CODEC_ID_V210 }, /* V210 */
-{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x02,0x01,0x02,0x11,0x04,0x00 }, 15, AV_CODEC_ID_PRORES }, /* PRORES */
+{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x02,0x01,0x02,0x11,0x00,0x00 }, 14, AV_CODEC_ID_PRORES }, /* Avid MC7 ProRes */
 /* SoundEssenceCompression */
 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x03,0x04,0x02,0x02,0x02,0x03,0x03,0x01,0x00 }, 14,AV_CODEC_ID_AAC }, /* MPEG2 AAC ADTS (legacy) */
 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 13,  AV_CODEC_ID_PCM_S16LE }, /* Uncompressed */
-- 
1.7.10.4




pgpJog8tmsrOn.pgp
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Support alaw in imkh files

2015-04-02 Thread Carl Eugen Hoyos
Carl Eugen Hoyos  ag.or.at> writes:

> diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
> index a0b5738..2ade9d4 100644
> --- a/libavformat/mpeg.c
> +++ b/libavformat/mpeg.c
>  -547,6 +547,8  redo:
>  codec_id = AV_CODEC_ID_ADPCM_ADX;
>  // Auto-detect AC-3
>  request_probe = 50;
> +} else if (m->imkh_cctv && startcode == 0x1c0) {
> +codec_id = AV_CODEC_ID_PCM_ALAW;

Maybe with "request_probe=50;" - the manual of one 
of the camera claims that MP2 is a possible audio 
codec.

Carl Eugen

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


[FFmpeg-devel] [PATCH]Support alaw in imkh files

2015-04-02 Thread Carl Eugen Hoyos
Hi!

Attached patch fixes another sample from ticket #4182.

Please comment, Carl Eugen
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index a0b5738..2ade9d4 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -547,6 +547,8 @@ redo:
 codec_id = AV_CODEC_ID_ADPCM_ADX;
 // Auto-detect AC-3
 request_probe = 50;
+} else if (m->imkh_cctv && startcode == 0x1c0) {
+codec_id = AV_CODEC_ID_PCM_ALAW;
 } else {
 codec_id = AV_CODEC_ID_MP2;
 }
@@ -591,7 +593,8 @@ skip:
 st->id= startcode;
 st->codec->codec_type = type;
 st->codec->codec_id   = codec_id;
-if (st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) {
+if (   st->codec->codec_id == AV_CODEC_ID_PCM_MULAW
+|| st->codec->codec_id == AV_CODEC_ID_PCM_ALAW) {
 st->codec->channels = 1;
 st->codec->channel_layout = AV_CH_LAYOUT_MONO;
 st->codec->sample_rate = 8000;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Relaxed pattern to find ProRes in MXF.

2015-04-02 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 01/04/15 16:32, Steve Dierker wrote:
> Hello,
> 
>> I support this patch if you didn't make the 
>> file yourself.
>> I only had one sample.
> 
> This sample is from the same customer as the other ProRes in MXF sampl
e
> I uploaded for the bug. (Doner Advertisment)
> I found it while searching for the reason why FFmpeg refused to encode
> some files after the bug was fixed.
> I don't know if the pattern is to relaxed or if there are any other
> ul's indicating ProRes. I just orientated myself at the DnxHD
> definitions.

DNX is not in the private UL scope, and has three ranges in ffmpeg, one
of which I believe to be completely wrong (SMPTE RP224 lists them as
tiff formats), but was obviously included for some reason at some stage,
so I'm not sure its a good template.

It would be good to get a full set of Avid Prores.mxf samples to try and
see how they have structured their UL's, I only have windows machines
currently to hand, so that is a way off.

I am currently looking at the whole range of UL's to see if they can be
tidied up, but that will also take some time, so perhaps in the
interests of progress use your suggestion for now *but* change the
inline comment to something like:-

/* Avid MC7 Prores */

That will assist in identifying why the entry is there if we need to
update things, especially if the codec moves into the officially
recognised scope, as DNX did.

Given the interest in Prores in MXF from AMWA that is quite likely imho.

> 
> best,
> Steve
> 
> [...]

- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBAgAGBQJVHQlxAAoJEAwL/ESLC/yDIfYIAMKTctzbP4qNVWbnOLvlBz/g
I9JNwvYIR33Jf18bsDJJMX7QaPgnO8y3yExAOHZM7ZCEICK130b79nTWQpVrLhB/
GChnExo69UO7xSprr+RG1hypxnFw6RTf9kK2IpT1aFxRDDSXbiYoG4JyQWMLdo7w
O+Mo1/Hz+ftUkOO7twGK4rOwMLl+LjyLhAOXwQ9/xKf57g3cjOB4wBIIk78apOLT
zTD9eD2+xH/L8TciLsXC5cGPbU9UJT1JukVuKbF/7P4edLNKRno4RunJjK29poIv
iDBSWYd6Js5f3oDZZlyKCnElwPkYEjPUN7h8Zx0tf3M9/mbgjCI3+K0lNBbuEAk=
=97j1
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel