Re: [FFmpeg-devel] [RFC][PATCH] avformat/flvdec: avoid reseting eof_reached to 0 silently

2015-04-13 Thread Zhang Rui
2015-04-14 1:09 GMT+08:00 wm4 :
> On Mon, 13 Apr 2015 12:02:29 +0800
> Zhang Rui  wrote:
>
>> 2015-04-12 22:45 GMT+08:00 Michael Niedermayer :
>> > On Sun, Apr 12, 2015 at 12:00:18PM +0800, Zhang Rui wrote:
>> >> 2015-04-10 22:04 GMT+08:00 wm4 :
>> >> > On Fri, 10 Apr 2015 21:17:42 +0800
>> >> > Zhang Rui  wrote:
>> >> >>
>> >> >> This kind of error handling need some more work in aviobuf.c,
>> >> >> and more advises from ffmpeg developers.
>> >> >> And i prefer this way than the patch I posted.
>> >> >
>> >> > stdio.h does it this way: FILE has an error flag that is set when
>> >> > something goes wrong.
>> >>
>> >> AVIOContext has an error field, too. But I don't think it's enough
>> >> for EAGAIN situation without some convention.
>> >> At least, ffplay doesn't show that.
>> >>
>> >> >> > Also, why doesn't avio_skip() return an error if the skip count is 
>> >> >> > not
>> >> >> > 0 and the stream has reached EOF?
>> >> >>
>> >> >> The eof handling is quite confusing in ffplay for me. AVERROR_EOF is
>> >> >> clear enough.
>> >> >
>> >> > Well, I have no idea what avio_skip() even returns... it just calls
>> >> > avio_seek(), which is a goddamn fucked up mess thanks to years of
>> >> > people adding hacks.
>> >>
>> >> Is there any correct direction to fix it?
>> >>
>> >> > ffplay probably does it wrong. Wouldn't be surprising. It checks
>> >> > avio_feof() after a av_read_frame() call, which doesn't look correct.
>> >> > File EOF has absolutely nothing to do with whether a demuxer still has
>> >> > data.
>> >> >
>> >> > On a side note, I'm not sure whether av_read_frame() returning
>> >> > AVERROR_EOF is an error at all, or just signals that the end of the
>> >> > file was reached. The doxygen on this function isn't helpful either.
>> >>
>> >> Is there any ideas, or any helpful keywords or threads in mail list 
>> >> archive?
>> >
>> > a simple error_count field could be added that way one could easily
>> > check if the count increased over any series of function call(s)
>
> Seems like a good idea.
>
>> Good enough for internal use of avio_r8().
>>
>> > it also could be presented at verbose level by the user application,
>> > showing how many io errors where encountered which where not fatal
>>
>> Two problems for application:
>>
>> 1. Which error should be defined as fatal?
>> For avio_r8(), even an EAGAIN can be a fatal.
>> The error_count has no more information than error field for application.
>
> Well, EAGAIN is fatal isn't it? Virtually nothing checks the avio_r8()
> return value to retry (and expecting it that would be totally
> unreasonable), so this has to be handled on a deeper level, possibly
> before the error is even set. (Or in other words, EAGAIN is not an
> error in some contexts. Although it could be - if you setup a signal
> handler to interrupt system calls instead of retrying them
> transparently, you probably really want to unblock all blocking calls,
> instead of having code to block immediately again by retrying.)

"verbose level by the user application" is the only concern here.
It has nothing to do with avio itself.

I agree with you on "error_count is a good idea".

>> 2. Nested format, e.g. hls, concatdec.
>> The error_count field is supposed to be added to AVIOContext.
>> But if the internal input failed, it's weired to set error to the
>> outer AVIOContext,
>> since it has nothing todo with the outer http/file/... protocol.
>
> What do nested protocols have to do anything with this? In cases when a
> protocol reads from another protocol, the error would obviously be
> naturally passed along.

Concern only about "verbose level by the user application", too.

Actually, It is a format (AVFormatContext), but not an avio (AVIOContext)
which reads from another format (AVFormatContext), for hls, concatdec situation.
The error/error_count field of the internal AVIOContext
is simply ignored without being passed along.

Whatever, it's not a serious problem, but only some opinion about
"verbose" idea.

It does have nothing to do with avio. (Maybe kind of off topic).

>>
>> In my opinion, we could stop returning avio error code directly from
>> av_read_frame(),
>> and limit the error code which could return from av_read_frame(), explicitly.
>> e.g.
>>
>> // Map various error codes to limited error codes.
>> int av_read_frame2(AVFormatContext *s, AVPacket *pkt) {
>> int ret = av_read_frame(s, pkt);
>> switch (ret) {
>> case AVERROR_EOS: // end of stream.
>> case AVERROR_AGAIN: // error can be recovered.
>> case AVERROR_EXIT: // interrupted by user.
>> case AVERROR_FAIL: // generic error
>> return ret;
>> case AVERROR(EAGAIN):
>> return AVERROR_AGAIN;
>> case AVERROR(EOF):
>> return AVERROR_EOS;
>> default:
>> return AVERROR_FAIL;
>> }
>> }
>>
>> Detailed error code could be obtained from new API av_get_error(),
>> as errno/WSAGetLastError() does.
>
> This looks terrible, an

Re: [FFmpeg-devel] [PATCH v2 2/3] [GSoC] [AAC] aacenc: Adjust the initial offset for PNS values

2015-04-13 Thread Michael Niedermayer
On Tue, Apr 14, 2015 at 12:33:51AM +0100, Rostislav Pehlivanov wrote:
> This commit adjusts the intial offset for PNS values, introduced with commit 
> f7f71b5795d708763eb0c55fe5e2cb051b2b69f4 earlier. This commit shifts the 
> value in such a way that no further offsets are required in the aaccoder.c 
> file. Earlier version of the PNS patch had 2 offsets in both the aaccoder and 
> aacenc.
> ---
>  libavcodec/aac.h| 1 +
>  libavcodec/aacenc.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)

applied

thanks

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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


[FFmpeg-devel] Test for FLAC

2015-04-13 Thread Ludmila Glinskih

Hi! 

I changed my test after your comments, thanks for your suggestions.=)

Now I test the codec with different parameters (sample rate and channel 
layout). For every set of parameters I create new input. I still use sin but 
now with double... The only other option I see is to pre-generate the inputs 
and commit them to the repository. Please help me if you know how to do it 
right.=(

And yeah, I understand that I test only how codec-decodec works (even here I 
don't test different sample formats, and use only positive cases). The next 
step (another test) should test common libavcodec functions (codec opening and 
so on). 

Let me know what you think.

Kind regards,
Ludmila Glinskih
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2] examples: add flac_test

2015-04-13 Thread Ludmila Glinskih
This is a simple test for the FLAC codec.
It generates an increasing tone, encodes it, decodes it back and
compares with the original one byte-by-byte.
---
 configure|   2 +
 doc/Makefile |   1 +
 doc/examples/Makefile|   1 +
 doc/examples/flac_test.c | 295 +++
 4 files changed, 299 insertions(+)
 create mode 100644 doc/examples/flac_test.c

diff --git a/configure b/configure
index bc59271..5650ef8 100755
--- a/configure
+++ b/configure
@@ -1329,6 +1329,7 @@ EXAMPLE_LIST="
 filter_audio_example
 filtering_audio_example
 filtering_video_example
+flac_test_example
 metadata_example
 muxing_example
 qsvdec_example
@@ -2679,6 +2680,7 @@ extract_mvs_example_deps="avcodec avformat avutil"
 filter_audio_example_deps="avfilter avutil"
 filtering_audio_example_deps="avfilter avcodec avformat avutil"
 filtering_video_example_deps="avfilter avcodec avformat avutil"
+flac_test_example_deps="avcodec avutil"
 metadata_example_deps="avformat avutil"
 muxing_example_deps="avcodec avformat avutil swscale"
 qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
diff --git a/doc/Makefile b/doc/Makefile
index 4573531..f462acc 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -45,6 +45,7 @@ DOC_EXAMPLES-$(CONFIG_EXTRACT_MVS_EXAMPLE)   += 
extract_mvs
 DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)  += filter_audio
 DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE)   += filtering_audio
 DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE)   += filtering_video
+DOC_EXAMPLES-$(CONFIG_FLAC_TEST_EXAMPLE) += flac_test
 DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)  += metadata
 DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE)+= muxing
 DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)+= qsvdec
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index 9699f11..72a2fb6 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -18,6 +18,7 @@ EXAMPLES=   avio_list_dir  \
 extract_mvs\
 filtering_video\
 filtering_audio\
+flac_test  \
 metadata   \
 muxing \
 remuxing   \
diff --git a/doc/examples/flac_test.c b/doc/examples/flac_test.c
new file mode 100644
index 000..392c50c
--- /dev/null
+++ b/doc/examples/flac_test.c
@@ -0,0 +1,295 @@
+/*
+ * Copyright (c) 2015 Ludmila Glinskih
+ * Copyright (c) 2001 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/*
+ * FLAC codec test.
+ * Encodes raw data to FLAC format and decodes it back to raw. Compares 
raw-data
+ * after that.
+ */
+
+#include 
+#include 
+#include 
+
+#define NUMBER_OF_FRAMES 200
+#define NAME_BUFF_SIZE 100
+
+/* generate i-th frame of test audio */
+static int generate_raw_frame(uint16_t *frame_data, int i, int sample_rate,
+  int channels, int frame_size)
+{
+double t, tincr, tincr2;
+int j, k;
+
+t = 0.0;
+tincr = 2 * M_PI * 440.0 / sample_rate;
+tincr2 = tincr / sample_rate;
+for (j = 0; j < frame_size; j++)
+{
+frame_data[channels * j] = (int)(sin(t) * 1);
+for (k = 1; k < channels; k++)
+frame_data[channels * j + k] = frame_data[channels * j] * 2;
+t = i * tincr + (i * (i + 1) / 2.0 * tincr2);
+}
+return 0;
+}
+
+static int init_encoder(AVCodec *enc, AVCodecContext **enc_ctx,
+int64_t ch_layout, int sample_rate)
+{
+AVCodecContext *ctx;
+int result;
+char name_buff[NAME_BUFF_SIZE];
+
+av_get_channel_layout_string(name_buff, NAME_BUFF_SIZE, 0, ch_layout);
+av_log(NULL, AV_LOG_INFO, "channel layout: %s, sample rate: %i\n", 
name_buff, sample_

[FFmpeg-devel] [PATCH v2 3/3] [GSoC] [AAC] aacdec: Use macros for constants

2015-04-13 Thread Rostislav Pehlivanov
This commit replaces the previous hardcoded constants with both new and 
previously defined macros from aac.h. This change makes it easy for anyone 
reading the code to know how encoding and decoding scalefactors works. It's 
also possibly a step in unifying some of the code across both the encoder and 
decoder.
---
 libavcodec/aacdec.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 5a0c05a..1a2ddc2 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -1394,7 +1394,7 @@ static int decode_scalefactors(AACContext *ac, float 
sf[120], GetBitContext *gb,
int band_type_run_end[120])
 {
 int g, i, idx = 0;
-int offset[3] = { global_gain, global_gain - 90, 0 };
+int offset[3] = { global_gain, global_gain - NOISE_OFFSET, 0 };
 int clipped_offset;
 int noise_flag = 1;
 for (g = 0; g < ics->num_window_groups; g++) {
@@ -1406,7 +1406,7 @@ static int decode_scalefactors(AACContext *ac, float 
sf[120], GetBitContext *gb,
 } else if ((band_type[idx] == INTENSITY_BT) ||
(band_type[idx] == INTENSITY_BT2)) {
 for (; i < run_end; i++, idx++) {
-offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 
60;
+offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 
SCALE_DIFF_ZERO;
 clipped_offset = av_clip(offset[2], -155, 100);
 if (offset[2] != clipped_offset) {
 avpriv_request_sample(ac->avctx,
@@ -1419,9 +1419,9 @@ static int decode_scalefactors(AACContext *ac, float 
sf[120], GetBitContext *gb,
 } else if (band_type[idx] == NOISE_BT) {
 for (; i < run_end; i++, idx++) {
 if (noise_flag-- > 0)
-offset[1] += get_bits(gb, 9) - 256;
+offset[1] += get_bits(gb, NOISE_PRE_BITS) - NOISE_PRE;
 else
-offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 
3) - 60;
+offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 
3) - SCALE_DIFF_ZERO;
 clipped_offset = av_clip(offset[1], -100, 155);
 if (offset[1] != clipped_offset) {
 avpriv_request_sample(ac->avctx,
@@ -1433,7 +1433,7 @@ static int decode_scalefactors(AACContext *ac, float 
sf[120], GetBitContext *gb,
 }
 } else {
 for (; i < run_end; i++, idx++) {
-offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 
60;
+offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 
SCALE_DIFF_ZERO;
 if (offset[0] > 255U) {
 av_log(ac->avctx, AV_LOG_ERROR,
"Scalefactor (%d) out of range.\n", offset[0]);
-- 
2.1.4

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


[FFmpeg-devel] [PATCH v2 2/3] [GSoC] [AAC] aacenc: Adjust the initial offset for PNS values

2015-04-13 Thread Rostislav Pehlivanov
This commit adjusts the intial offset for PNS values, introduced with commit 
f7f71b5795d708763eb0c55fe5e2cb051b2b69f4 earlier. This commit shifts the value 
in such a way that no further offsets are required in the aaccoder.c file. 
Earlier version of the PNS patch had 2 offsets in both the aaccoder and aacenc.
---
 libavcodec/aac.h| 1 +
 libavcodec/aacenc.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aac.h b/libavcodec/aac.h
index 2701386..23ec085 100644
--- a/libavcodec/aac.h
+++ b/libavcodec/aac.h
@@ -143,6 +143,7 @@ typedef struct PredictorState {
 
 #define NOISE_PRE   256///< preamble for NOISE_BT, put in bitstream 
with the first noise band
 #define NOISE_PRE_BITS9///< length of preamble
+#define NOISE_OFFSET 90///< subtracted from global gain, used as 
offset for the preamble
 
 /**
  * Long Term Prediction
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 3e92bc4..998a875 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -388,7 +388,7 @@ static void encode_band_info(AACEncContext *s, 
SingleChannelElement *sce)
 static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
  SingleChannelElement *sce)
 {
-int diff, off_sf = sce->sf_idx[0], off_pns = sce->sf_idx[0];
+int diff, off_sf = sce->sf_idx[0], off_pns = sce->sf_idx[0] - NOISE_OFFSET;
 int noise_flag = 1;
 int i, w;
 
-- 
2.1.4

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


[FFmpeg-devel] [PATCH v2 1/3] [GSoC] [AAC] aaccoder: Implement Perceptual Noise Substitution

2015-04-13 Thread Rostislav Pehlivanov
This commit implements the perceptual noise substitution AAC extension. This is 
a proof of concept implementation, and as such, is not enabled by default. This 
is the second revision of this patch, made after some discussion via non-public 
email due to a mistake. Any changes made since the first revision have been 
indicated.

In order to extend the encoder to use an additional codebook, the array holding 
each codebook has been modified with two additional entries - 13 for the 
NOISE_BT codebook and 12 which has a placeholder function. The cost system was 
modified to skip the 12th entry using an array to map the input and outputs it 
has. It also does not accept using the 13th codebook for any band which is not 
marked as containing noise, thereby restricting its ability to arbitrarily 
choose it for bands. The use of arrays allows the system to be easily extended 
to allow for intensity stereo encoding, which uses additional codebooks.

The 12th entry in the codebook function array points to a function which stops 
the execution of the program by calling an assert with an always 'false' 
argument. After a discussion, it was pointed out in an email discussion with 
Claudio Freire that having a 'NULL' entry can result in unexpected behaviour 
and could be used as a security hole. There is no danger of this function being 
called during encoding due to the codebook maps introduced.

Another change from version 1 of the patch is the addition of an argument to 
the encoder, '-aac_pns' to enable and disable the PNS. This currently defaults 
to disable the PNS, as it is experimental. The switch will be removed in the 
future, when the algorithm to select noise bands has been improved. The current 
algorithm simply compares the energy to the threshold (multiplied by a 
constant) to determine noise, however the FFPsyBand structure contains other 
useful figures to determine which bands carry noise more accurately.

Finally, the way energy values are converted to scalefactor indices has changed 
since the first commit, as per the suggestion of Claudio Freire. This may still 
have some drawbacks, but unlike the first commit it works without having 
redundant offsets and outputs what the decoder expects to have, in terms of the 
ranges of the scalefactor indices.

Some spectral comparisons: https://0x0.st/T7.png (original), 
https://0x0.st/Th.png (encoded without PNS), https://0x0.st/A1.png (encoded 
with PNS, const = 1.2), https://0x0.st/Aj.png (spectral difference). The 
constant is the value which multiplies the threshold when it gets compared to 
the energy, larger values means more noise will be substituded by PNS values. 
Example when const = 2.2: https://0x0.st/Ae.png

Comments, tips, feedback and criticism are welcome.
---
 libavcodec/aaccoder.c | 135 +++---
 libavcodec/aacenc.c   |   3 ++
 libavcodec/aacenc.h   |   1 +
 3 files changed, 100 insertions(+), 39 deletions(-)

diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 64eee32..fadb941 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -40,6 +40,12 @@
 #include "aacenc.h"
 #include "aactab.h"
 
+/** Frequency in Hz for lower limit of noise substitution **/
+#define NOISE_LOW_LIMIT 4000
+
+/** Total number of usable codebooks **/
+#define CB_TOT 13
+
 /** bits needed to code codebook run value for long windows */
 static const uint8_t run_value_bits_long[64] = {
  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
@@ -57,6 +63,10 @@ static const uint8_t * const run_value_bits[2] = {
 run_value_bits_long, run_value_bits_short
 };
 
+/** Map to convert values from BandCodingPath index to a codebook index **/
+static const uint8_t aac_cb_out_map[CB_TOT]  = {0,1,2,3,4,5,6,7,8,9,10,11,13};
+/** Inverse map to convert from codebooks to BandCodingPath indices **/
+static const uint8_t aac_cb_in_map[CB_TOT+1] = 
{0,1,2,3,4,5,6,7,8,9,10,11,0,12};
 
 /**
  * Quantize one coefficient.
@@ -108,7 +118,7 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 const float *scaled, int size, int scale_idx,
 int cb, const float lambda, const float uplim,
 int *bits, int BT_ZERO, int BT_UNSIGNED,
-int BT_PAIR, int BT_ESC)
+int BT_PAIR, int BT_ESC, int BT_NOISE)
 {
 const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
 const float Q   = ff_aac_pow2sf_tab [q_idx];
@@ -119,8 +129,6 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 float cost = 0;
 const int dim = BT_PAIR ? 2 : 4;
 int resbits = 0;
-const int range  = aac_cb_range[cb];
-const int maxval = aac_cb_maxval[cb];
 int off;
 
 if (BT_ZERO) {
@@ -130,15 +138,22 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 *bits = 0;
   

Re: [FFmpeg-devel] [PATCH]Accept 0x000001 as startcode for hevc in mpegts

2015-04-13 Thread Michael Niedermayer
On Thu, Dec 18, 2014 at 11:08:39AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #4194 for me, I did not look into 
> any specification.
> 
> Please review, Carl Eugen

no objection from me

[...]

-- 
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] Check for not synchronized packets (very small feed file, very slow client connection)

2015-04-13 Thread Michael Niedermayer
On Sun, Apr 12, 2015 at 11:30:32PM +0200, Milan Matejec wrote:
> Hi,
> 
> attached is patch for encoding/decoding .ffm format. When you set a maximum
> size of feed file to too small number (I tried 20k) and try to connect to
> ffserver from very slow connection (simulated by reading 8k chunks and then
> wait 3 seconds) .ffm decoder will after a few seconds (10 maybe more ...)
> stuck in endless "READ_HEADER" state because it got unreal size of .ffm
> data packet (it's 24bits so take some random number - usually something
> about 10MB) leading to immediately return after *ffm_is_avail_data()*. This
> patch adds a packet header with signature so after loading header it tries
> to check if signature is there. If not then it logs an error and tries to
> reset a packet and read header again. It's not a best solution but better
> than end up in an endless loop ...

please split the patch in 2, one for the demuxer and one for the muxer
make sure the code works with only one patch applied and interoperation
between versions that have and do not have the patch is fully fine
it appears its not with this patchset

also please attach patches normally and dont double encode them

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


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


[FFmpeg-devel] Accept 0x000001 as startcode for hevc in mpegts

2015-04-13 Thread Ali KIZIL
Hello All,

There is ticket #4194:
https://trac.ffmpeg.org/ticket/4194

On the below link, there is already working solution:
https://ffmpeg.org/pipermail/ffmpeg-devel/2014-December/166753.html

-- next part --
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index a32c6d6..ff15d16 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1207,7 +1207,7 @@ int ff_check_h264_startcode(AVFormatContext *s, 
const AVStream *st, const AVPack
 
 static int check_hevc_startcode(AVFormatContext *s, const AVStream *st, 
const AVPacket *pkt)
 {
-if (pkt->size < 5 || AV_RB32(pkt->data) != 0x001) {
+if (pkt->size < 5 || (AV_RB32(pkt->data) != 0x001 && 
AV_RB24(pkt->data) != 0x01)) {
 if (!st->nb_frames) {
 av_log(s, AV_LOG_ERROR, "HEVC bitstream malformed, no 
startcode found\n");
 return AVERROR_PATCHWELCOME;

This update fixes many unnecessary (according to me) log info.

(I am not expert on commiting changes, so I wrote here.)



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


Re: [FFmpeg-devel] NVENC H.265 4K Uncatchable 60fps Performance

2015-04-13 Thread Ali KIZIL
Timo Rothenpieler  rothenpieler.org> writes:

> 
> > I have a few questions.
> > I will be grateful is someone can give an idea / reply.
> >
> > 1) On nvenc.c under libavcodec, is it possible to create more than 
one
> > instance of nvenc to perform 4K 60 fps encoding using
> > nvEncodeAPICreateInstance ?
> 
> You could encode two independend video streams at 30 fps each. There 
is 
> no way two encode sessions can work on the same video stream.
> 
> > Is there any way to stack videos without re-encoding ?
> 
> No, that's not possible.
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel  ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 


BTW I got below email from Nvidia:

"My apologies… I made a mistake in my earlier response. I checked with 
the team, and confirmed that GM204 (GTX 980) should be able to do 60 fps 
H.264 at 4K x 2K (3840 x 2160) resolution.
 
I have a few questions. Are you using the nvencoder application with the 
NVENC SDK with HP preset and single pass rate control mode? Or some 
other settings?
 
How are you reading YUV file? Have you ensured that the code is 
pipelined such that there is no extra time spent in reading YUV frames 
into the video memory?"

Than I made a test:

4krun.sh file:
/root/NvEncoder -i /root/bunny.yuv -o /root/hevc -size 3840 2160 -codec 
1 -rcmode 2 -preset hp -fps 50 -goplength 50 -bitrate 4000 -
vbvMaxBitrate 4000 -vbvSize 12000

I run the above command as below:

time ./4krun.sh

Here is the output:

Encoded 1077 frames in 20533.26ms
Avergage Encode Time :  19.07ms

real0m21.821s
user0m16.157s
sys 0m5.207s

It means depending on NvEncoder time measurement FPS is 52.45 (1077 / 
20.533), depending on Linux time measurement FPS is 49.35 (1077 / 
21.821).

However, FFmpeg can go up to 32-34 fps. There may be a memory management 
issue. If I succeed on comparing of code NvEncoder and nvenc.c, I will 
write here.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] NVENC HEVC Profile Settings Errors

2015-04-13 Thread Ali KIZIL
Hello,

When setting level of HEVC in NVENC, FFmpeg gives error:

root@encoder:~# /opt/ffmpeghw/bin/ffmpeg -i /root/bunny.mp4 -aspect 16:9 
-s 3840x2160 -vcodec nvenc_h265 -preset hp -fflags +genpts -vb 25000k -
minrate 25000k -maxrate 25000k -bufsize 75000k -muxrate 25000k -r 50 -an 
-flush_packets 0 -packetsize 188 -level 5.1 -y -f mpegts /dev/null
ffmpeg version N-71430-g4d74c8d Copyright (c) 2000-2015 the FFmpeg 
developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/opt/ffmpeghw --enable-shared --enable-nonfree 
--enable-gpl --extra-cflags='-I/opt/ffmpeg/include -I/usr/local/include' 
--extra-ldflags=-L/opt/ffmpeg/lib --bindir=/opt/ffmpeghw/bin --extra-
libs=-ldl --enable-libx264 --enable-libx265 --enable-nonfree --enable-
gpl --enable-nvenc --enable-libopenjpeg --enable-vdpau
  libavutil  54. 22.101 / 54. 22.101
  libavcodec 56. 34.100 / 56. 34.100
  libavformat56. 30.100 / 56. 30.100
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 14.100 /  5. 14.100
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/root/bunny.mp4':
  Metadata:
major_brand : isom
minor_version   : 1
compatible_brands: isomavc1
creation_time   : 2013-12-17 16:40:26
title   : Big Buck Bunny, Sunflower version
artist  : Blender Foundation 2008, Janus Bager Kristensen 
2013
comment : Creative Commons Attribution 3.0 - 
http://bbb3d.renderfarming.net
genre   : Animation
composer: Sacha Goedegebure
  Duration: 00:10:34.53, start: 0.00, bitrate: 8487 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
3840x2160 [SAR 1:1 DAR 16:9], 8002 kb/s, 60 fps, 60 tbr, 60k tbn, 120 
tbc (default)
Metadata:
  creation_time   : 2013-12-17 16:40:26
  handler_name: GPAC ISO Video Handler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, 
s16p, 160 kb/s (default)
Metadata:
  creation_time   : 2013-12-17 16:40:28
  handler_name: GPAC ISO Audio Handler
Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 
5.1(side), fltp, 320 kb/s (default)
Metadata:
  creation_time   : 2013-12-17 16:40:28
  handler_name: GPAC ISO Audio Handler
Side data:
  unknown side data type 7 (4 bytes)
[nvenc_h265 @ 0xee0080] InitializeEncoder failed: 0x8
Output #0, mpegts, to '/dev/null':
  Metadata:
major_brand : isom
minor_version   : 1
compatible_brands: isomavc1
composer: Sacha Goedegebure
title   : Big Buck Bunny, Sunflower version
artist  : Blender Foundation 2008, Janus Bager Kristensen 
2013
comment : Creative Commons Attribution 3.0 - 
http://bbb3d.renderfarming.net
genre   : Animation
Stream #0:0(und): Video: hevc, none, q=2-31, 128 kb/s, SAR 1:1 DAR 
0:0, 50 fps (default)
Metadata:
  creation_time   : 2013-12-17 16:40:26
  handler_name: GPAC ISO Video Handler
  encoder : Lavc56.34.100 nvenc_h265
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (nvenc_h265))
Error while opening encoder for output stream #0:0 - maybe incorrect 
parameters such as bit_rate, rate, width or height


FYI: If I run;

root@encoder:~# /opt/ffmpeghw/bin/ffmpeg -i /root/bunny.mp4 -aspect 16:9 
-s 3840x2160 -vcodec nvenc_h265 -preset hp -fflags +genpts -vb 25000k -
minrate 25000k -maxrate 25000k -bufsize 75000k -muxrate 25000k -r 50 -an 
-flush_packets 0 -packetsize 188 -level 6.1 -y -f mpegts /dev/null

It works fine.

These values give error: 1, 2, 2.1, 3, 3.1, 4, 4.1, 5, 5.1, 5.2, 6,

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


Re: [FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 04:36:18PM -0500, David Favor wrote:
> David Favor wrote:
> >David Favor wrote:
> >>The following command:
> >>
> >>ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4 (or clip.mov)
> >>
> >>seems to incorrectly write container values for fps + tbr which
> >>causes .mp4/.mov files to play with very odd jerky movements.
> >
> >https://trac.ffmpeg.org/ticket/974 seems to be a ticket already
> >opened for this.
> 
> More jittery artifacts.
> 
> This produces no jitter:
> 
>  ffmpeg -fflags +genpts -i clip.mts -c:v copy -c:a copy clip.mp4
> 

> This produces jitter:
> 
>  ffmpeg -fflags +genpts -i clip.mts -c:v copy -c:a libfaac clip.mp4
> 
> Anytime the audio stream is transcoded (libfaac or fdk), jitter returns.
> 
> This behavior isn't mentioned in the above ticket.

if you found a bug which isnt reported yet (i dont know if that applies
here) please open a new seperate ticket

[...]
--
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


Re: [FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 04:11:41PM -0500, David Favor wrote:
> David Favor wrote:
> >The following command:
> >
> >ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4 (or clip.mov)
> >
> >seems to incorrectly write container values for fps + tbr which
> >causes .mp4/.mov files to play with very odd jerky movements.
> >
> >imac> avinfo clip.mts
> >clip.mts
> >   length: 00:01:00.03, start: 1.433367, bitrate: 24821 kb/s
> >   stream: #0:0[0x100]: Video: h264 (High) ([27][0][0][0] /
> >0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97
> >tbr, 90k tbn, 59.94 tbc
> >   stream: #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081),
> >48000 Hz, stereo, fltp, 256 kb/s
> >
> >imac> avinfo clip.mp4
> >clip.mp4
> >   length: 00:01:00.04, start: 0.00, bitrate: 22955 kb/s
> >   stream: #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
> >yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 22690 kb/s, 59.94 fps,
> >59.94 tbr, 90k tbn, 59.94 tbc (default)
> >   stream: #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz,
> >stereo, fltp, 256 kb/s (default)
> >
> >Notice both fps + tbr have changed from 29.97 to 59.94 which seems
> >the problem.
> >
> >Someone let me know if this is really a bug or if this has changed
> >+ no longer works.
> >
> >Thanks.
> >
> >___
> >
> >ffmpeg run log...
> >
> >imac> ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4
> >ffmpeg version 2.6.2-2015-04-13-71430-g4d74c8d Copyright (c)
> >2000-2015 the FFmpeg developers
> >  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
> >  configuration: --cc=/usr/bin/clang
> >--prefix=/david-favor/osx-10.9.5
> >--mandir=/david-favor/osx-10.9.5/share/man --enable-gpl
> >--enable-yasm --arch=x86_64 --enable-version3 --enable-pthreads
> >--enable-shared --disable-static --disable-debug
> >--extra-cflags='-pipe -I/david-favor/osx-10.9.5/include
> >-I/opt/local/include -I/usr/local/include -I/usr/include'
> >--extra-ldflags='-Wl,-rpath,/david-favor/osx-10.9.5/lib
> >-Wl,-rpath,/opt/local/lib -Wl,-rpath,/usr/local/lib
> >-Wl,-rpath,/usr/lib -L/david-favor/osx-10.9.5/lib -L/opt/local/lib
> >-L/usr/local/lib -L/usr/lib' --enable-ffplay --enable-ffprobe
> >--enable-ffserver --enable-indev=qtkit --enable-indev=avfoundation
> >--enable-runtime-cpudetect --enable-nonfree --enable-zlib
> >--enable-bzlib --enable-openssl --enable-gnutls --enable-swscale
> >--enable-avfilter --enable-avresample --enable-postproc
> >--enable-vda --enable-libfribidi --enable-libmp3lame
> >--enable-libfaac --enable-libfdk_aac --enable-libvpx
> >--enable-libtheora --enable-libvorbis --enable-libxvid
> >--enable-libopus --enable-libopenjpeg --enable-libschroedinger
> >--enable-libspeex --enable-libbluray --enable-libx264
> >--enable-libx265 --enable-postproc --enable-frei0r
> >--enable-libopencv --enable-libopencore-amrnb --enable-fontconfig
> >--enable-libfreetype --enable-libmodplug --enable-libass
> >  libavutil  54. 22.101 / 54. 22.101
> >  libavcodec 56. 34.100 / 56. 34.100
> >  libavformat56. 30.100 / 56. 30.100
> >  libavdevice56.  4.100 / 56.  4.100
> >  libavfilter 5. 14.100 /  5. 14.100
> >  libavresample   2.  1.  0 /  2.  1.  0
> >  libswscale  3.  1.101 /  3.  1.101
> >  libswresample   1.  1.100 /  1.  1.100
> >  libpostproc53.  3.100 / 53.  3.100
> >Input #0, mpegts, from 'clip.mts':
> >  Duration: 00:01:00.03, start: 1.433367, bitrate: 24821 kb/s
> >  Program 1
> >Metadata:
> >  service_name: Service01
> >  service_provider: FFmpeg
> >Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] /
> >0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97
> >tbr, 90k tbn, 59.94 tbc
> >Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081),
> >48000 Hz, stereo, fltp, 256 kb/s
> >File 'clip.mp4' already exists. Overwrite ? [y/N] y
> >[mp4 @ 0x7f8d5e81dc00] Codec for stream 0 does not use global
> >headers but container format requires global headers
> >[mp4 @ 0x7f8d5e81dc00] Codec for stream 1 does not use global
> >headers but container format requires global headers
> >[mp4 @ 0x7f8d5e81dc00] track 1: codec frame size is not set
> >Output #0, mp4, to 'clip.mp4':
> >  Metadata:
> >encoder : Lavf56.30.100
> >Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p,
> >1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k
> >tbn, 90k tbc
> >Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz,
> >stereo, 256 kb/s
> >Stream mapping:
> >  Stream #0:0 -> #0:0 (copy)
> >  Stream #0:1 -> #0:1 (copy)
> >Press [q] to stop, [?] for help
> >[mp4 @ 0x7f8d5e81dc00] pts has no value
> >Last message repeated 392 times
> >[mp4 @ 0x7f8d5e81dc00] pts has no value1kB time=00:00:13.12
> >bitrate=23053.4kbits/s
> >Last message repeated 308 times
> >[mp4 @ 0x7f8d5e81dc00] pts has no value65kB time=00:00:23.42
> >bitrate=22964.7kbits/s
> >Last message repeated 279 times
> >[mp4 @ 0x7f8d5e81dc00] pts has no value11kB time=00:00:32.76
> >bitrate=22977.7kbits/s
> >   

Re: [FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread compn
On Mon, 13 Apr 2015 16:36:18 -0500
David Favor  wrote:

> > https://trac.ffmpeg.org/ticket/974 seems to be a ticket already
> > opened for this.
> This behavior isn't mentioned in the above ticket.

your problem is remuxing h264 from mpegts to mp4
that ticket is for remuxing mpeg2 from mpegts to mp4.

what player displays jerky movements? vlc? what ver vlc are you using?

why convert from mpegts to mp4 in the first place? what player or
software isnt handling mpegts?

i know these problems may be ffmpeg fault. but i want some answers! :)

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


Re: [FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread David Favor

David Favor wrote:

David Favor wrote:

The following command:

ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4 (or clip.mov)

seems to incorrectly write container values for fps + tbr which
causes .mp4/.mov files to play with very odd jerky movements.


https://trac.ffmpeg.org/ticket/974 seems to be a ticket already
opened for this.


More jittery artifacts.

This produces no jitter:

 ffmpeg -fflags +genpts -i clip.mts -c:v copy -c:a copy clip.mp4

This produces jitter:

 ffmpeg -fflags +genpts -i clip.mts -c:v copy -c:a libfaac clip.mp4

Anytime the audio stream is transcoded (libfaac or fdk), jitter returns.

This behavior isn't mentioned in the above ticket.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread David Favor

David Favor wrote:

The following command:

ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4 (or clip.mov)

seems to incorrectly write container values for fps + tbr which
causes .mp4/.mov files to play with very odd jerky movements.


https://trac.ffmpeg.org/ticket/974 seems to be a ticket already
opened for this.

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


Re: [FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread David Favor

David Favor wrote:

The following command:

ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4 (or clip.mov)

seems to incorrectly write container values for fps + tbr which
causes .mp4/.mov files to play with very odd jerky movements.

imac> avinfo clip.mts
clip.mts
   length: 00:01:00.03, start: 1.433367, bitrate: 24821 kb/s
   stream: #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 
59.94 tbc
   stream: #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 
stereo, fltp, 256 kb/s


imac> avinfo clip.mp4
clip.mp4
   length: 00:01:00.04, start: 0.00, bitrate: 22955 kb/s
   stream: #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1920x1080 [SAR 1:1 DAR 16:9], 22690 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 
59.94 tbc (default)
   stream: #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, 
fltp, 256 kb/s (default)


Notice both fps + tbr have changed from 29.97 to 59.94 which seems the 
problem.


Someone let me know if this is really a bug or if this has changed + no 
longer works.


Thanks.

___

ffmpeg run log...

imac> ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4
ffmpeg version 2.6.2-2015-04-13-71430-g4d74c8d Copyright (c) 2000-2015 
the FFmpeg developers

  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=/usr/bin/clang --prefix=/david-favor/osx-10.9.5 
--mandir=/david-favor/osx-10.9.5/share/man --enable-gpl --enable-yasm 
--arch=x86_64 --enable-version3 --enable-pthreads --enable-shared 
--disable-static --disable-debug --extra-cflags='-pipe 
-I/david-favor/osx-10.9.5/include -I/opt/local/include 
-I/usr/local/include -I/usr/include' 
--extra-ldflags='-Wl,-rpath,/david-favor/osx-10.9.5/lib 
-Wl,-rpath,/opt/local/lib -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/lib 
-L/david-favor/osx-10.9.5/lib -L/opt/local/lib -L/usr/local/lib 
-L/usr/lib' --enable-ffplay --enable-ffprobe --enable-ffserver 
--enable-indev=qtkit --enable-indev=avfoundation 
--enable-runtime-cpudetect --enable-nonfree --enable-zlib --enable-bzlib 
--enable-openssl --enable-gnutls --enable-swscale --enable-avfilter 
--enable-avresample --enable-postproc --enable-vda --enable-libfribidi 
--enable-libmp3lame --enable-libfaac --enable-libfdk_aac --enable-libvpx 
--enable-libtheora --enable-libvorbis --enable-libxvid --enable-libopus 
--enable-libopenjpeg --enable-libschroedinger --enable-libspeex 
--enable-libbluray --enable-libx264 --enable-libx265 --enable-postproc 
--enable-frei0r --enable-libopencv --enable-libopencore-amrnb 
--enable-fontconfig --enable-libfreetype --enable-libmodplug 
--enable-libass

  libavutil  54. 22.101 / 54. 22.101
  libavcodec 56. 34.100 / 56. 34.100
  libavformat56. 30.100 / 56. 30.100
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 14.100 /  5. 14.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc53.  3.100 / 53.  3.100
Input #0, mpegts, from 'clip.mts':
  Duration: 00:01:00.03, start: 1.433367, bitrate: 24821 kb/s
  Program 1
Metadata:
  service_name: Service01
  service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 
59.94 tbc
Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 
stereo, fltp, 256 kb/s

File 'clip.mp4' already exists. Overwrite ? [y/N] y
[mp4 @ 0x7f8d5e81dc00] Codec for stream 0 does not use global headers 
but container format requires global headers
[mp4 @ 0x7f8d5e81dc00] Codec for stream 1 does not use global headers 
but container format requires global headers

[mp4 @ 0x7f8d5e81dc00] track 1: codec frame size is not set
Output #0, mp4, to 'clip.mp4':
  Metadata:
encoder : Lavf56.30.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k 
tbc
Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, 
256 kb/s

Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x7f8d5e81dc00] pts has no value
Last message repeated 392 times
[mp4 @ 0x7f8d5e81dc00] pts has no value1kB time=00:00:13.12 
bitrate=23053.4kbits/s

Last message repeated 308 times
[mp4 @ 0x7f8d5e81dc00] pts has no value65kB time=00:00:23.42 
bitrate=22964.7kbits/s

Last message repeated 279 times
[mp4 @ 0x7f8d5e81dc00] pts has no value11kB time=00:00:32.76 
bitrate=22977.7kbits/s

Last message repeated 222 times
[mp4 @ 0x7f8d5e81dc00] pts has no value29kB time=00:00:40.19 
bitrate=22976.6kbits/s

Last message repeated 311 times
[mp4 @ 0x7f8d5e81dc00] pts has no value63kB time=00:00:50.62 
bitrate=22972.5kbits/s

Last message repeated 279 times
[mp4 @ 0x7f8d5e81dc00] pts has no value52kB time=00:00:59.96 
bitrate=2

Re: [FFmpeg-devel] [PATCH 1/2] webdashenc: Add failure check for av_malloc.

2015-04-13 Thread Vignesh Venkatasubramanian
On Mon, Apr 13, 2015 at 12:46 PM, Michael Niedermayer  wrote:
> On Mon, Apr 13, 2015 at 12:16:31PM -0700, Vignesh Venkatasubramanian wrote:
>> Add a missing failure check for av_malloc call.
>>
>> Signed-off-by: Vignesh Venkatasubramanian 
>> ---
>>  libavformat/webmdashenc.c | 6 --
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
>> index c5347a9..80266f7 100644
>> --- a/libavformat/webmdashenc.c
>> +++ b/libavformat/webmdashenc.c
>> @@ -87,7 +87,7 @@ static double get_duration(AVFormatContext *s)
>>  return max / 1000;
>>  }
>>
>> -static void write_header(AVFormatContext *s)
>> +static int write_header(AVFormatContext *s)
>>  {
>>  WebMDashMuxContext *w = s->priv_data;
>>  double min_buffer_time = 1.0;
>> @@ -110,6 +110,7 @@ static void write_header(AVFormatContext *s)
>>  struct tm gmt_buffer;
>>  struct tm *gmt = gmtime_r(&local_time, &gmt_buffer);
>>  char *gmt_iso = av_malloc(21);
>> +if (!gmt_iso) return AVERROR(ENOMEM);
>>  strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt);
>>  if (w->debug_mode) {
>>  av_strlcpy(gmt_iso, "", 1);
>> @@ -124,6 +125,7 @@ static void write_header(AVFormatContext *s)
>>  w->utc_timing_url ? w->utc_timing_url : gmt_iso);
>>  av_free(gmt_iso);
>>  }
>> +return 0;
>>  }
>>
>>  static void write_footer(AVFormatContext *s)
>> @@ -456,7 +458,7 @@ static int 
>> webm_dash_manifest_write_header(AVFormatContext *s)
>>  double start = 0.0;
>>  WebMDashMuxContext *w = s->priv_data;
>>  parse_adaptation_sets(s);
>> -write_header(s);
>> +if (write_header(s) < 0) return -1;
>
> is it intended that this does not forward the error code from
> write_header() ?
>

no it is not. please ignore this patch. i'm reworking the error
handling in this file and will fix this along with that patch.

> [...]
> --
> 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
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>



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


[FFmpeg-devel] ffmpeg latest git - rewrapping (codec copy) breaks container fps/tbr values

2015-04-13 Thread David Favor

The following command:

ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4 (or clip.mov)

seems to incorrectly write container values for fps + tbr which
causes .mp4/.mov files to play with very odd jerky movements.

imac> avinfo clip.mts
clip.mts
   length: 00:01:00.03, start: 1.433367, bitrate: 24821 kb/s
   stream: #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 
1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
   stream: #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 
fltp, 256 kb/s

imac> avinfo clip.mp4
clip.mp4
   length: 00:01:00.04, start: 0.00, bitrate: 22955 kb/s
   stream: #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1920x1080 [SAR 1:1 DAR 16:9], 22690 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 
tbc (default)
   stream: #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 
256 kb/s (default)

Notice both fps + tbr have changed from 29.97 to 59.94 which seems the problem.

Someone let me know if this is really a bug or if this has changed + no longer 
works.

Thanks.

___

ffmpeg run log...

imac> ffmpeg -i clip.mts -c:v copy -c:a copy clip.mp4
ffmpeg version 2.6.2-2015-04-13-71430-g4d74c8d Copyright (c) 2000-2015 the 
FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=/usr/bin/clang --prefix=/david-favor/osx-10.9.5 --mandir=/david-favor/osx-10.9.5/share/man --enable-gpl --enable-yasm --arch=x86_64 --enable-version3 --enable-pthreads 
--enable-shared --disable-static --disable-debug --extra-cflags='-pipe -I/david-favor/osx-10.9.5/include -I/opt/local/include -I/usr/local/include -I/usr/include' 
--extra-ldflags='-Wl,-rpath,/david-favor/osx-10.9.5/lib -Wl,-rpath,/opt/local/lib -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/lib -L/david-favor/osx-10.9.5/lib -L/opt/local/lib -L/usr/local/lib 
-L/usr/lib' --enable-ffplay --enable-ffprobe --enable-ffserver --enable-indev=qtkit --enable-indev=avfoundation --enable-runtime-cpudetect --enable-nonfree --enable-zlib --enable-bzlib 
--enable-openssl --enable-gnutls --enable-swscale --enable-avfilter --enable-avresample --enable-postproc --enable-vda --enable-libfribidi --enable-libmp3lame --enable-libfaac --enable-libfdk_aac 
--enable-libvpx --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libopus --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libbluray --enable-libx264 
--enable-libx265 --enable-postproc --enable-frei0r --enable-libopencv --enable-libopencore-amrnb --enable-fontconfig --enable-libfreetype --enable-libmodplug --enable-libass

  libavutil  54. 22.101 / 54. 22.101
  libavcodec 56. 34.100 / 56. 34.100
  libavformat56. 30.100 / 56. 30.100
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 14.100 /  5. 14.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc53.  3.100 / 53.  3.100
Input #0, mpegts, from 'clip.mts':
  Duration: 00:01:00.03, start: 1.433367, bitrate: 24821 kb/s
  Program 1
Metadata:
  service_name: Service01
  service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 
1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 
fltp, 256 kb/s
File 'clip.mp4' already exists. Overwrite ? [y/N] y
[mp4 @ 0x7f8d5e81dc00] Codec for stream 0 does not use global headers but 
container format requires global headers
[mp4 @ 0x7f8d5e81dc00] Codec for stream 1 does not use global headers but 
container format requires global headers
[mp4 @ 0x7f8d5e81dc00] track 1: codec frame size is not set
Output #0, mp4, to 'clip.mp4':
  Metadata:
encoder : Lavf56.30.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 
1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, 256 
kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x7f8d5e81dc00] pts has no value
Last message repeated 392 times
[mp4 @ 0x7f8d5e81dc00] pts has no value1kB time=00:00:13.12 
bitrate=23053.4kbits/s
Last message repeated 308 times
[mp4 @ 0x7f8d5e81dc00] pts has no value65kB time=00:00:23.42 
bitrate=22964.7kbits/s
Last message repeated 279 times
[mp4 @ 0x7f8d5e81dc00] pts has no value11kB time=00:00:32.76 
bitrate=22977.7kbits/s
Last message repeated 222 times
[mp4 @ 0x7f8d5e81dc00] pts has no value29kB time=00:00:40.19 
bitrate=22976.6kbits/s
Last message repeated 311 times
[mp4 @ 0x7f8d5e81dc00] pts has no value63kB time=00:00:50.62 
bitrate=22972.5kbits/s
Last message repeated 279 times
[mp4 @ 0x7f8d5e81dc00] pts has no value52kB time=00:00:59.96 
bitrate=22956.9kbits/s
[mp4 @ 0x7f8d5e81dc00] pts has no val

Re: [FFmpeg-devel] [PATCH 2/2] webmdashenc: Fix potential leak in realloc

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 12:16:44PM -0700, Vignesh Venkatasubramanian wrote:
> Fix potential leak in av_realloc call where the output was being
> overwritten by using a temporary variable.
> 
> Signed-off-by: Vignesh Venkatasubramanian 
> ---
>  libavformat/webmdashenc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
> index 80266f7..0f915fd 100644
> --- a/libavformat/webmdashenc.c
> +++ b/libavformat/webmdashenc.c
> @@ -419,9 +419,10 @@ static int parse_adaptation_sets(AVFormatContext *s)
>  if (*p == ' ')
>  continue;
>  else if (state == new_set && !strncmp(p, "id=", 3)) {
> -w->as = av_realloc(w->as, sizeof(*w->as) * ++w->nb_as);
> -if (w->as == NULL)
> +void *mem = av_realloc(w->as, sizeof(*w->as) * ++w->nb_as);
> +if (mem == NULL)
>  return AVERROR(ENOMEM);

nb_as will be 1 larger than the array in the return case
is that intended / safe ?

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

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please


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


Re: [FFmpeg-devel] [PATCH 1/2] webdashenc: Add failure check for av_malloc.

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 12:16:31PM -0700, Vignesh Venkatasubramanian wrote:
> Add a missing failure check for av_malloc call.
> 
> Signed-off-by: Vignesh Venkatasubramanian 
> ---
>  libavformat/webmdashenc.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
> index c5347a9..80266f7 100644
> --- a/libavformat/webmdashenc.c
> +++ b/libavformat/webmdashenc.c
> @@ -87,7 +87,7 @@ static double get_duration(AVFormatContext *s)
>  return max / 1000;
>  }
>  
> -static void write_header(AVFormatContext *s)
> +static int write_header(AVFormatContext *s)
>  {
>  WebMDashMuxContext *w = s->priv_data;
>  double min_buffer_time = 1.0;
> @@ -110,6 +110,7 @@ static void write_header(AVFormatContext *s)
>  struct tm gmt_buffer;
>  struct tm *gmt = gmtime_r(&local_time, &gmt_buffer);
>  char *gmt_iso = av_malloc(21);
> +if (!gmt_iso) return AVERROR(ENOMEM);
>  strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt);
>  if (w->debug_mode) {
>  av_strlcpy(gmt_iso, "", 1);
> @@ -124,6 +125,7 @@ static void write_header(AVFormatContext *s)
>  w->utc_timing_url ? w->utc_timing_url : gmt_iso);
>  av_free(gmt_iso);
>  }
> +return 0;
>  }
>  
>  static void write_footer(AVFormatContext *s)
> @@ -456,7 +458,7 @@ static int 
> webm_dash_manifest_write_header(AVFormatContext *s)
>  double start = 0.0;
>  WebMDashMuxContext *w = s->priv_data;
>  parse_adaptation_sets(s);
> -write_header(s);
> +if (write_header(s) < 0) return -1;

is it intended that this does not forward the error code from
write_header() ?

[...]
-- 
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


Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: use av_malloc(z)_array()

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 06:49:04PM +, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/alsdec.c | 61 
> ++---
>  1 file changed, 30 insertions(+), 31 deletions(-)

LGTM

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

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


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


[FFmpeg-devel] [PATCH 1/2] webdashenc: Add failure check for av_malloc.

2015-04-13 Thread Vignesh Venkatasubramanian
Add a missing failure check for av_malloc call.

Signed-off-by: Vignesh Venkatasubramanian 
---
 libavformat/webmdashenc.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index c5347a9..80266f7 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -87,7 +87,7 @@ static double get_duration(AVFormatContext *s)
 return max / 1000;
 }
 
-static void write_header(AVFormatContext *s)
+static int write_header(AVFormatContext *s)
 {
 WebMDashMuxContext *w = s->priv_data;
 double min_buffer_time = 1.0;
@@ -110,6 +110,7 @@ static void write_header(AVFormatContext *s)
 struct tm gmt_buffer;
 struct tm *gmt = gmtime_r(&local_time, &gmt_buffer);
 char *gmt_iso = av_malloc(21);
+if (!gmt_iso) return AVERROR(ENOMEM);
 strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt);
 if (w->debug_mode) {
 av_strlcpy(gmt_iso, "", 1);
@@ -124,6 +125,7 @@ static void write_header(AVFormatContext *s)
 w->utc_timing_url ? w->utc_timing_url : gmt_iso);
 av_free(gmt_iso);
 }
+return 0;
 }
 
 static void write_footer(AVFormatContext *s)
@@ -456,7 +458,7 @@ static int webm_dash_manifest_write_header(AVFormatContext 
*s)
 double start = 0.0;
 WebMDashMuxContext *w = s->priv_data;
 parse_adaptation_sets(s);
-write_header(s);
+if (write_header(s) < 0) return -1;
 avio_printf(s->pb, "pb, " start=\"PT%gS\"", start);
 if (!w->is_live) {
-- 
2.2.0.rc0.207.ga3a616c

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


[FFmpeg-devel] [PATCH 2/2] webmdashenc: Fix potential leak in realloc

2015-04-13 Thread Vignesh Venkatasubramanian
Fix potential leak in av_realloc call where the output was being
overwritten by using a temporary variable.

Signed-off-by: Vignesh Venkatasubramanian 
---
 libavformat/webmdashenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index 80266f7..0f915fd 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -419,9 +419,10 @@ static int parse_adaptation_sets(AVFormatContext *s)
 if (*p == ' ')
 continue;
 else if (state == new_set && !strncmp(p, "id=", 3)) {
-w->as = av_realloc(w->as, sizeof(*w->as) * ++w->nb_as);
-if (w->as == NULL)
+void *mem = av_realloc(w->as, sizeof(*w->as) * ++w->nb_as);
+if (mem == NULL)
 return AVERROR(ENOMEM);
+w->as = mem;
 w->as[w->nb_as - 1].nb_streams = 0;
 w->as[w->nb_as - 1].streams = NULL;
 p += 3; // consume "id="
-- 
2.2.0.rc0.207.ga3a616c

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


[FFmpeg-devel] [PATCH] avcodec/alsdec: use av_malloc(z)_array()

2015-04-13 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavcodec/alsdec.c | 61 ++---
 1 file changed, 30 insertions(+), 31 deletions(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index bac434f..65aa7d2 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -352,7 +352,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
 if (get_bits_left(&gb) < bits_needed)
 return AVERROR_INVALIDDATA;
 
-if (!(sconf->chan_pos = av_malloc(avctx->channels * 
sizeof(*sconf->chan_pos
+if (!(sconf->chan_pos = av_malloc_array(avctx->channels, 
sizeof(*sconf->chan_pos
 return AVERROR(ENOMEM);
 
 ctx->cs_switch = 1;
@@ -1680,14 +1680,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
 // allocate quantized parcor coefficient buffer
 num_buffers = sconf->mc_coding ? avctx->channels : 1;
 
-ctx->quant_cof= av_malloc(sizeof(*ctx->quant_cof) * num_buffers);
-ctx->lpc_cof  = av_malloc(sizeof(*ctx->lpc_cof)   * num_buffers);
-ctx->quant_cof_buffer = av_malloc(sizeof(*ctx->quant_cof_buffer) *
-  num_buffers * sconf->max_order);
-ctx->lpc_cof_buffer   = av_malloc(sizeof(*ctx->lpc_cof_buffer) *
-  num_buffers * sconf->max_order);
-ctx->lpc_cof_reversed_buffer = av_malloc(sizeof(*ctx->lpc_cof_buffer) *
- sconf->max_order);
+ctx->quant_cof= av_malloc_array(num_buffers, 
sizeof(*ctx->quant_cof));
+ctx->lpc_cof  = av_malloc_array(num_buffers, 
sizeof(*ctx->lpc_cof));
+ctx->quant_cof_buffer = av_malloc_array(num_buffers * sconf->max_order,
+sizeof(*ctx->quant_cof_buffer));
+ctx->lpc_cof_buffer   = av_malloc_array(num_buffers * sconf->max_order,
+sizeof(*ctx->lpc_cof_buffer));
+ctx->lpc_cof_reversed_buffer = av_malloc_array(sconf->max_order,
+   
sizeof(*ctx->lpc_cof_buffer));
 
 if (!ctx->quant_cof  || !ctx->lpc_cof||
 !ctx->quant_cof_buffer   || !ctx->lpc_cof_buffer ||
@@ -1704,15 +1704,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
 }
 
 // allocate and assign lag and gain data buffer for ltp mode
-ctx->const_block = av_malloc (sizeof(*ctx->const_block) * num_buffers);
-ctx->shift_lsbs  = av_malloc (sizeof(*ctx->shift_lsbs)  * num_buffers);
-ctx->opt_order   = av_malloc (sizeof(*ctx->opt_order)   * num_buffers);
-ctx->store_prev_samples = av_malloc(sizeof(*ctx->store_prev_samples) * 
num_buffers);
-ctx->use_ltp = av_mallocz(sizeof(*ctx->use_ltp)  * num_buffers);
-ctx->ltp_lag = av_malloc (sizeof(*ctx->ltp_lag)  * num_buffers);
-ctx->ltp_gain= av_malloc (sizeof(*ctx->ltp_gain) * num_buffers);
-ctx->ltp_gain_buffer = av_malloc (sizeof(*ctx->ltp_gain_buffer) *
-  num_buffers * 5);
+ctx->const_block = av_malloc_array(num_buffers, 
sizeof(*ctx->const_block));
+ctx->shift_lsbs  = av_malloc_array(num_buffers, 
sizeof(*ctx->shift_lsbs));
+ctx->opt_order   = av_malloc_array(num_buffers, 
sizeof(*ctx->opt_order));
+ctx->store_prev_samples = av_malloc_array(num_buffers, 
sizeof(*ctx->store_prev_samples));
+ctx->use_ltp = av_mallocz_array(num_buffers, 
sizeof(*ctx->use_ltp));
+ctx->ltp_lag = av_malloc_array(num_buffers, sizeof(*ctx->ltp_lag));
+ctx->ltp_gain= av_malloc_array(num_buffers, 
sizeof(*ctx->ltp_gain));
+ctx->ltp_gain_buffer = av_malloc_array(num_buffers * 5, 
sizeof(*ctx->ltp_gain_buffer));
 
 if (!ctx->const_block || !ctx->shift_lsbs ||
 !ctx->opt_order || !ctx->store_prev_samples ||
@@ -1728,12 +1727,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
 // allocate and assign channel data buffer for mcc mode
 if (sconf->mc_coding) {
-ctx->chan_data_buffer  = av_malloc(sizeof(*ctx->chan_data_buffer) *
-   num_buffers * num_buffers);
-ctx->chan_data = av_malloc(sizeof(*ctx->chan_data) *
-   num_buffers);
-ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
-   num_buffers);
+ctx->chan_data_buffer  = av_malloc_array(num_buffers * num_buffers,
+ 
sizeof(*ctx->chan_data_buffer));
+ctx->chan_data = av_malloc_array(num_buffers,
+ sizeof(*ctx->chan_data));
+ctx->reverted_channels = av_malloc_array(num_buffers,
+ 
sizeof(*ctx->reverted_channels));
 
 if (!ctx->chan_data_buffer || !ctx->chan_da

Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Thomas Volkert


Am 13.04.2015 um 12:21 schrieb Stefano Sabatini:

On date Monday 2015-04-13 12:19:36 +0200, Michael Niedermayer encoded:

On Mon, Apr 13, 2015 at 11:37:39AM +0200, Thomas Volkert wrote:

Hi,

My expenses consist of:
- 5 x t-shirt: 116,49 € (the shirts were given to our team, one
stays with me)
- 1 x tablecloth: 81,61 €
- 1 x traveling: 147 €
- no hotel costs
---
total: 345,1 €

LGTM

Fine with me. I'll forward the request to the SPI treasurer.


Thx.

BR,
Thomas.

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


Re: [FFmpeg-devel] [PATCH 2/2] Using dynamic arrays for multiple style records

2015-04-13 Thread Philip Langdale

On 2015-04-13 07:57, Niklesh Lalwani wrote:

From: Niklesh 

This patch attempts to use dynamic arrays to support multiple style
records. However, I am unable to get proper output with using
av_dynamic_array(). It seems I am not using this function properly.
Can anyone explain?
Signed-off-by: Niklesh 
---
 libavcodec/movtextdec.c | 65 
+++--

 1 file changed, 41 insertions(+), 24 deletions(-)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 4e463ed..2220cf9 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -25,24 +25,28 @@
 #include "libavutil/common.h"
 #include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
+ #include "libavutil/mem.h"

 #define STYLE_FLAG_BOLD 1
 #define STYLE_FLAG_ITALIC   2
 #define STYLE_FLAG_UNDERLINE4

 static int text_to_ass(AVBPrint *buf, const char *text, const char 
*text_end,
-const char *style_start, const char 
*style_end,

-const int style_flags)
+const char **style_start, const char 
**style_end,
+const int **style_flags, const int 
style_entries)

 {
 while (text < text_end) {
-if (style_flags && text == style_start)
+for (int i=0; i@@ -89,9 +96,13 @@ static int mov_text_decode_frame(AVCodecContext 
*avctx,

 AVBPrint buf;
 const char *ptr = avpkt->data;
 const char *end;
-int text_length, tsmb_type, style_entries, style_flags, tsmb_size;
-const char *style_start, *style_end;
+int text_length, tsmb_type, style_entries, tsmb_size;
+char **style_start={0,};
+char **style_end={0,};
+int **style_flags={0,};


1) You need to free these at the end, otherwise you're leaking them.

2) The style_flags is an integer array, not a pointer-to-integer array.

3) I think it would be clearer to store style_start and style_end as 
indices, rather
than computing pointers. You already pass the start/end of the string to 
text_to_ass,

so just pass the indicies as well.


 const uint8_t *tsmb;
+int index, flag=0;;
+char *ptr_temp;

 if (!ptr || avpkt->size < 2)
 return AVERROR_INVALIDDATA;
@@ -143,26 +154,32 @@ static int mov_text_decode_frame(AVCodecContext 
*avctx,

 tsmb += 2;

 for(int i = 0; i < style_entries;i++)
-{
-style_start = ptr + AV_RB16(tsmb);
+{
+ptr_temp= ptr + AV_RB16(tsmb);
+index=i;
+av_dynarray_add(&style_start, &index, ptr_temp);
 tsmb += 2;
-style_end = ptr + AV_RB16(tsmb);
+ptr_temp= ptr+ AV_RB16(tsmb);
+index=i;
+av_dynarray_add(&style_end, &index, ptr_temp);
 tsmb += 2;
 // fontID = AV_RB16(tsmb);
 tsmb += 2;
-style_flags = AV_RB8(tsmb);
+flag=AV_RB16(tsmb);
+index=i;
+av_dynarray_add(&style_flags, &index, &flag);
 //fontsize=AV_RB8(tsmb);
 //tsmb += 2;
 // text-color-rgba
 //tsmb += 4;
-text_to_ass(&buf, ptr, end, style_start, style_end,
style_flags);
 }
+text_to_ass(&buf, ptr, end, style_start, style_end,
style_flags,style_entries);
 }

 }
 }
 else
-text_to_ass(&buf, ptr, end, NULL, NULL, 0);
+text_to_ass(&buf, ptr, end, NULL, NULL, 0, 0);

 ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end - 
ts_start);

 av_bprint_finalize(&buf, NULL);


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


Re: [FFmpeg-devel] [PATCH 1/2] Decoding of Bold Italic and Underlined styles for 3GPP timed text subtitles

2015-04-13 Thread Philip Langdale

On 2015-04-13 07:56, Niklesh Lalwani wrote:

From: Niklesh 

This patch is a part of my qualification task to implement support for
Bold, Italic, and Underlined style records for 3GPP timed text
subtitles. I am continuing Wesley's work. This patch supports decoding
of no more than one style record. Patch[2/2] attempts to use dynamic
arrays to support multiple style records.
Signed-off-by: Niklesh 
---
 libavcodec/movtextdec.c | 81 
+

 1 file changed, 75 insertions(+), 6 deletions(-)


Thank you for posting this.



diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 1c7ffea..4e463ed 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -26,9 +26,25 @@
 #include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"

-static int text_to_ass(AVBPrint *buf, const char *text, const char 
*text_end)

+#define STYLE_FLAG_BOLD 1
+#define STYLE_FLAG_ITALIC   2
+#define STYLE_FLAG_UNDERLINE4
+
+static int text_to_ass(AVBPrint *buf, const char *text, const char 
*text_end,
+const char *style_start, const char 
*style_end,

+const int style_flags)
 {
-while (text < text_end) {
+while (text < text_end) {
+if (style_flags && text == style_start)
+{
+if (style_flags & STYLE_FLAG_BOLD)
+av_bprintf(buf, "{\\b1}");
+if (style_flags & STYLE_FLAG_ITALIC)
+av_bprintf(buf, "{\\i1}");
+if (style_flags & STYLE_FLAG_UNDERLINE)
+av_bprintf(buf, "{\\u1}");
+}
+
 switch (*text) {
 case '\r':
 break;
@@ -39,6 +55,16 @@ static int text_to_ass(AVBPrint *buf, const char
*text, const char *text_end)
 av_bprint_chars(buf, *text, 1);
 break;
 }
+
+if (style_flags && text == style_end)
+{
+if (style_flags & STYLE_FLAG_BOLD)
+av_bprintf(buf, "{\\b0}");
+if (style_flags & STYLE_FLAG_ITALIC)
+av_bprintf(buf, "{\\i0}");
+if (style_flags & STYLE_FLAG_UNDERLINE)
+av_bprintf(buf, "{\\u0}");
+}
 text++;
 }

@@ -63,6 +89,9 @@ static int mov_text_decode_frame(AVCodecContext 
*avctx,

 AVBPrint buf;
 const char *ptr = avpkt->data;
 const char *end;
+int text_length, tsmb_type, style_entries, style_flags, tsmb_size;
+const char *style_start, *style_end;
+const uint8_t *tsmb;

 if (!ptr || avpkt->size < 2)
 return AVERROR_INVALIDDATA;
@@ -74,6 +103,7 @@ static int mov_text_decode_frame(AVCodecContext 
*avctx,

  * already. If the value is non-zero, then it's technically a
  * bad packet.
  */
+
 if (avpkt->size == 2)
 return AV_RB16(ptr) == 0 ? 0 : AVERROR_INVALIDDATA;

@@ -82,7 +112,10 @@ static int mov_text_decode_frame(AVCodecContext 
*avctx,
  * In complex cases, there are style descriptors appended to the 
string

  * so we can't just assume the packet size is the string size.
  */
-end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);
+//end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);
+text_length = AV_RB16(ptr);
+
+end = ptr + FFMIN(2 + text_length, avpkt->size);
 ptr += 2;

 ts_start = av_rescale_q(avpkt->pts,
@@ -91,11 +124,47 @@ static int mov_text_decode_frame(AVCodecContext 
*avctx,

 ts_end   = av_rescale_q(avpkt->pts + avpkt->duration,
 avctx->time_base,
 (AVRational){1,100});
-
+tsmb_size=0;
 // Note that the spec recommends lines be no longer than 2048 
characters.

 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
-text_to_ass(&buf, ptr, end);
-ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, 
ts_end-ts_start);

+if (text_length + 2 != avpkt->size)
+{
+while (text_length + 2 + tsmb_size < avpkt->size)
+{
+tsmb = ptr + text_length+tsmb_size;
+tsmb_size = AV_RB32(tsmb);
+tsmb += 4;
+tsmb_type = AV_RB32(tsmb);
+tsmb += 4;


Remember that you need to account for large (> 32bit) boxes here. I 
guess it's
almost impossible to get a large box, but it's better to be correct than 
to blow

up in the future.


+
+if (tsmb_type == MKBETAG('s','t','y','l'))
+{
+style_entries = AV_RB16(tsmb);
+tsmb += 2;
+
+for(int i = 0; i < style_entries;i++)
+{
+style_start = ptr + AV_RB16(tsmb);
+tsmb += 2;
+style_end = ptr + AV_RB16(tsmb);
+tsmb += 2;
+// fontID = AV_RB16(tsmb);
+tsmb += 2;
+style_flags = AV_RB8(tsmb);
+//fontsize=AV_RB8(tsmb);
+//tsmb += 2;
+// text-color-rgba
+//tsmb += 4;
+text_to_ass(&buf, ptr, end, style_start, style_e

Re: [FFmpeg-devel] [PATCH 2/2] Using dynamic arrays for multiple style records

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 08:27:59PM +0530, Niklesh Lalwani wrote:
> From: Niklesh 
> 
> This patch attempts to use dynamic arrays to support multiple style records. 
> However, I am unable to get proper output with using av_dynamic_array(). It 
> seems I am not using this function properly. Can anyone explain?

please look at other existing uses of av_dynamic_array()
its documentation and implementation
or print the contents of the arrays to see what happens

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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


Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Thilo Borgmann
Am 13.04.15 um 12:22 schrieb Stefano Sabatini:
> On date Monday 2015-04-13 12:19:21 +0200, Michael Niedermayer encoded:
>> On Fri, Apr 10, 2015 at 08:58:13PM +0200, Thilo Borgmann wrote:
>>> Hi!
>>>
>>> I'd like to request refunds for merchandise expenses at the Chemnitzer
>>> Linux Tage 2015, where we had manned a booth for FFmpeg.
>>>
>>> I wonder why there seems to be nothing else on the list because expenses
>>> were higher than last time afaik - I'm sorry if I just missed the
>>> corresponding thread on the list.
>>>
>>> My expenses are just for the merchandise basecaps: 166.42 €
>>
>> LGTM
> 
> Approved by me as well. I'll forward the request to SPI.

Thanks!

-Thilo

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


Re: [FFmpeg-devel] [RFC][PATCH] avformat/flvdec: avoid reseting eof_reached to 0 silently

2015-04-13 Thread wm4
On Mon, 13 Apr 2015 12:02:29 +0800
Zhang Rui  wrote:

> 2015-04-12 22:45 GMT+08:00 Michael Niedermayer :
> > On Sun, Apr 12, 2015 at 12:00:18PM +0800, Zhang Rui wrote:
> >> 2015-04-10 22:04 GMT+08:00 wm4 :
> >> > On Fri, 10 Apr 2015 21:17:42 +0800
> >> > Zhang Rui  wrote:
> >> >>
> >> >> This kind of error handling need some more work in aviobuf.c,
> >> >> and more advises from ffmpeg developers.
> >> >> And i prefer this way than the patch I posted.
> >> >
> >> > stdio.h does it this way: FILE has an error flag that is set when
> >> > something goes wrong.
> >>
> >> AVIOContext has an error field, too. But I don't think it's enough
> >> for EAGAIN situation without some convention.
> >> At least, ffplay doesn't show that.
> >>
> >> >> > Also, why doesn't avio_skip() return an error if the skip count is not
> >> >> > 0 and the stream has reached EOF?
> >> >>
> >> >> The eof handling is quite confusing in ffplay for me. AVERROR_EOF is
> >> >> clear enough.
> >> >
> >> > Well, I have no idea what avio_skip() even returns... it just calls
> >> > avio_seek(), which is a goddamn fucked up mess thanks to years of
> >> > people adding hacks.
> >>
> >> Is there any correct direction to fix it?
> >>
> >> > ffplay probably does it wrong. Wouldn't be surprising. It checks
> >> > avio_feof() after a av_read_frame() call, which doesn't look correct.
> >> > File EOF has absolutely nothing to do with whether a demuxer still has
> >> > data.
> >> >
> >> > On a side note, I'm not sure whether av_read_frame() returning
> >> > AVERROR_EOF is an error at all, or just signals that the end of the
> >> > file was reached. The doxygen on this function isn't helpful either.
> >>
> >> Is there any ideas, or any helpful keywords or threads in mail list 
> >> archive?
> >
> > a simple error_count field could be added that way one could easily
> > check if the count increased over any series of function call(s)

Seems like a good idea.

> Good enough for internal use of avio_r8().
> 
> > it also could be presented at verbose level by the user application,
> > showing how many io errors where encountered which where not fatal
> 
> Two problems for application:
> 
> 1. Which error should be defined as fatal?
> For avio_r8(), even an EAGAIN can be a fatal.
> The error_count has no more information than error field for application.

Well, EAGAIN is fatal isn't it? Virtually nothing checks the avio_r8()
return value to retry (and expecting it that would be totally
unreasonable), so this has to be handled on a deeper level, possibly
before the error is even set. (Or in other words, EAGAIN is not an
error in some contexts. Although it could be - if you setup a signal
handler to interrupt system calls instead of retrying them
transparently, you probably really want to unblock all blocking calls,
instead of having code to block immediately again by retrying.)

> 2. Nested format, e.g. hls, concatdec.
> The error_count field is supposed to be added to AVIOContext.
> But if the internal input failed, it's weired to set error to the
> outer AVIOContext,
> since it has nothing todo with the outer http/file/... protocol.

What do nested protocols have to do anything with this? In cases when a
protocol reads from another protocol, the error would obviously be
naturally passed along.

> 
> In my opinion, we could stop returning avio error code directly from
> av_read_frame(),
> and limit the error code which could return from av_read_frame(), explicitly.
> e.g.
> 
> // Map various error codes to limited error codes.
> int av_read_frame2(AVFormatContext *s, AVPacket *pkt) {
> int ret = av_read_frame(s, pkt);
> switch (ret) {
> case AVERROR_EOS: // end of stream.
> case AVERROR_AGAIN: // error can be recovered.
> case AVERROR_EXIT: // interrupted by user.
> case AVERROR_FAIL: // generic error
> return ret;
> case AVERROR(EAGAIN):
> return AVERROR_AGAIN;
> case AVERROR(EOF):
> return AVERROR_EOS;
> default:
> return AVERROR_FAIL;
> }
> }
> 
> Detailed error code could be obtained from new API av_get_error(),
> as errno/WSAGetLastError() does.

This looks terrible, and also AVERROR(EOF) makes no sense (EOF is
returned by fgetc() and the likes, it's not used for errno). I'm not
sure what this error code mapping is supposed to achieve, and it has
absolutely nothing to do with AVIO errors, unless I'm misunderstanding
you. I maintain that av_read_frame() has absolutely nothing to do with
AVIO, other than the fact that sometimes AVIO error codes are returned
by it (which is awful and makes everything confusing and also makes the
error codes completely meaningless, but business as usual).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Fixed remuxing of HDMV PGS subtitles

2015-04-13 Thread Philip Langdale

On 2015-04-13 03:39, Petri Hintukainen wrote:


I don't know if it is a good idea to use HDMV stream types without HDMV
program registration descriptor. If this is fixed incrementally, fixing
should be started from the opposite direction:
- Using HDMV stream type requires HDMV registration descriptor
- using HDMV registration descriptor requires HDMV conforming stream

I've attached a simple patch to add HDMV registration descriptor to the
program. With it streams are correctly detected with ffmpeg. But, I
don't think the patch should be applied: using HDMV registration
descriptor in a stream that is not HDMV conforming is a really bad
idea.


Your patch is equivalent to the first thing I tried and it had no 
visible

effect in so far as how ffmpeg decoded the resulting m2ts file. It still
marked the subtitle streams as unknown. I guess, you don't get any 
useful

progress until the whole stream is conforming, and we are along way from
that.

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


Re: [FFmpeg-devel] [PATCH 1/2] Decoding of Bold Italic and Underlined styles for 3GPP timed text subtitles

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 08:26:59PM +0530, Niklesh Lalwani wrote:
> From: Niklesh 
> 
> This patch is a part of my qualification task to implement support for Bold, 
> Italic, and Underlined style records for 3GPP timed text subtitles. I am 
> continuing Wesley's work. This patch supports decoding of no more than one 
> style record. Patch[2/2] attempts to use dynamic arrays to support multiple 
> style records.
> Signed-off-by: Niklesh 
> ---
>  libavcodec/movtextdec.c | 81 
> +
>  1 file changed, 75 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
> index 1c7ffea..4e463ed 100644
> --- a/libavcodec/movtextdec.c
> +++ b/libavcodec/movtextdec.c
> @@ -26,9 +26,25 @@
>  #include "libavutil/bprint.h"
>  #include "libavutil/intreadwrite.h"
>  
> -static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end)
> +#define STYLE_FLAG_BOLD 1
> +#define STYLE_FLAG_ITALIC   2
> +#define STYLE_FLAG_UNDERLINE4
> +
> +static int text_to_ass(AVBPrint *buf, const char *text, const char 
> *text_end, 
> +const char *style_start, const char *style_end, 
> +const int style_flags)
>  {
> -while (text < text_end) {
> +while (text < text_end) {
> +if (style_flags && text == style_start)
> +{
> +if (style_flags & STYLE_FLAG_BOLD)
> +av_bprintf(buf, "{\\b1}");
> +if (style_flags & STYLE_FLAG_ITALIC)
> +av_bprintf(buf, "{\\i1}");
> +if (style_flags & STYLE_FLAG_UNDERLINE)
> +av_bprintf(buf, "{\\u1}");
> +}
> +
>  switch (*text) {
>  case '\r':
>  break;
> @@ -39,6 +55,16 @@ static int text_to_ass(AVBPrint *buf, const char *text, 
> const char *text_end)
>  av_bprint_chars(buf, *text, 1);
>  break;
>  }
> +
> +if (style_flags && text == style_end)
> +{
> +if (style_flags & STYLE_FLAG_BOLD)
> +av_bprintf(buf, "{\\b0}");
> +if (style_flags & STYLE_FLAG_ITALIC)
> +av_bprintf(buf, "{\\i0}");
> +if (style_flags & STYLE_FLAG_UNDERLINE)
> +av_bprintf(buf, "{\\u0}");
> +}
>  text++;
>  }
>  
> @@ -63,6 +89,9 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
>  AVBPrint buf;
>  const char *ptr = avpkt->data;
>  const char *end;
> +int text_length, tsmb_type, style_entries, style_flags, tsmb_size;
> +const char *style_start, *style_end;
> +const uint8_t *tsmb;
>  
>  if (!ptr || avpkt->size < 2)
>  return AVERROR_INVALIDDATA;

> @@ -74,6 +103,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
>   * already. If the value is non-zero, then it's technically a
>   * bad packet.
>   */
> +
>  if (avpkt->size == 2)
>  return AV_RB16(ptr) == 0 ? 0 : AVERROR_INVALIDDATA;
>  

doesnt belong in this patch


> @@ -82,7 +112,10 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
>   * In complex cases, there are style descriptors appended to the string
>   * so we can't just assume the packet size is the string size.
>   */

> -end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);
> +//end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);

either remove code or leave it, dont just comment it out


> +text_length = AV_RB16(ptr);
> +
> +end = ptr + FFMIN(2 + text_length, avpkt->size); 
>  ptr += 2;
>  
>  ts_start = av_rescale_q(avpkt->pts,
> @@ -91,11 +124,47 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
>  ts_end   = av_rescale_q(avpkt->pts + avpkt->duration,
>  avctx->time_base,
>  (AVRational){1,100});
> -
> +tsmb_size=0;
>  // Note that the spec recommends lines be no longer than 2048 characters.
>  av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
> -text_to_ass(&buf, ptr, end);
> -ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end-ts_start);

> +if (text_length + 2 != avpkt->size)
> +{
> +while (text_length + 2 + tsmb_size < avpkt->size)
> +{

please indent the code somehow


> +tsmb = ptr + text_length+tsmb_size;
> +tsmb_size = AV_RB32(tsmb);  
> +tsmb += 4;
> +tsmb_type = AV_RB32(tsmb);
> +tsmb += 4;
> +
> +if (tsmb_type == MKBETAG('s','t','y','l'))
> +{
> +style_entries = AV_RB16(tsmb);
> +tsmb += 2;
> +

> +for(int i = 0; i < style_entries;i++)

the int i should be at the begin of a block with other declarations
some compilers have problems with this style


[...]

> +}
> +}


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking O

Re: [FFmpeg-devel] [PATCH] fate: add tta encoder test

2015-04-13 Thread Paul B Mahol
On 4/13/15, Nicolas George  wrote:
> Le quartidi 24 germinal, an CCXXIII, Paul B Mahol a ecrit :
>> TTA muxer is impossible to write without using temporary file instead of
>> caching
>> all frames in memory.
>
> Can you shortly explain why (or give a link to where it was already done)?

http://en.true-audio.com/TTA_Lossless_Audio_Codec_-_Format_Description
look where seek table is.

> Regards,
>
> --
>   Nicolas George
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] Using dynamic arrays for multiple style records

2015-04-13 Thread Niklesh Lalwani
From: Niklesh 

This patch attempts to use dynamic arrays to support multiple style records. 
However, I am unable to get proper output with using av_dynamic_array(). It 
seems I am not using this function properly. Can anyone explain?
Signed-off-by: Niklesh 
---
 libavcodec/movtextdec.c | 65 +++--
 1 file changed, 41 insertions(+), 24 deletions(-)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 4e463ed..2220cf9 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -25,24 +25,28 @@
 #include "libavutil/common.h"
 #include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
+ #include "libavutil/mem.h"
 
 #define STYLE_FLAG_BOLD 1
 #define STYLE_FLAG_ITALIC   2
 #define STYLE_FLAG_UNDERLINE4
 
 static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end, 
-const char *style_start, const char *style_end, 
-const int style_flags)
+const char **style_start, const char **style_end, 
+const int **style_flags, const int style_entries)
 {
 while (text < text_end) {
-if (style_flags && text == style_start)
+for (int i=0; idata;
 const char *end;
-int text_length, tsmb_type, style_entries, style_flags, tsmb_size;
-const char *style_start, *style_end;
+int text_length, tsmb_type, style_entries, tsmb_size;
+char **style_start={0,}; 
+char **style_end={0,};
+int **style_flags={0,};
 const uint8_t *tsmb;
+int index, flag=0;;
+char *ptr_temp;
 
 if (!ptr || avpkt->size < 2)
 return AVERROR_INVALIDDATA;
@@ -143,26 +154,32 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
 tsmb += 2;
 
 for(int i = 0; i < style_entries;i++)
-{
-style_start = ptr + AV_RB16(tsmb);
+{   
+ptr_temp= ptr + AV_RB16(tsmb);
+index=i;
+av_dynarray_add(&style_start, &index, ptr_temp);
 tsmb += 2;
-style_end = ptr + AV_RB16(tsmb);
+ptr_temp= ptr+ AV_RB16(tsmb);
+index=i;
+av_dynarray_add(&style_end, &index, ptr_temp);
 tsmb += 2;
 // fontID = AV_RB16(tsmb);
 tsmb += 2;
-style_flags = AV_RB8(tsmb);
+flag=AV_RB16(tsmb);
+index=i;
+av_dynarray_add(&style_flags, &index, &flag);
 //fontsize=AV_RB8(tsmb);
 //tsmb += 2;
 // text-color-rgba
 //tsmb += 4;
-text_to_ass(&buf, ptr, end, style_start, style_end, 
style_flags);
 }
+text_to_ass(&buf, ptr, end, style_start, style_end, 
style_flags,style_entries);
 }

 }
 }
 else
-text_to_ass(&buf, ptr, end, NULL, NULL, 0);
+text_to_ass(&buf, ptr, end, NULL, NULL, 0, 0);
 
 ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end - ts_start);
 av_bprint_finalize(&buf, NULL);
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 1/2] Decoding of Bold Italic and Underlined styles for 3GPP timed text subtitles

2015-04-13 Thread Niklesh Lalwani
From: Niklesh 

This patch is a part of my qualification task to implement support for Bold, 
Italic, and Underlined style records for 3GPP timed text subtitles. I am 
continuing Wesley's work. This patch supports decoding of no more than one 
style record. Patch[2/2] attempts to use dynamic arrays to support multiple 
style records.
Signed-off-by: Niklesh 
---
 libavcodec/movtextdec.c | 81 +
 1 file changed, 75 insertions(+), 6 deletions(-)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 1c7ffea..4e463ed 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -26,9 +26,25 @@
 #include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
 
-static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end)
+#define STYLE_FLAG_BOLD 1
+#define STYLE_FLAG_ITALIC   2
+#define STYLE_FLAG_UNDERLINE4
+
+static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end, 
+const char *style_start, const char *style_end, 
+const int style_flags)
 {
-while (text < text_end) {
+while (text < text_end) {
+if (style_flags && text == style_start)
+{
+if (style_flags & STYLE_FLAG_BOLD)
+av_bprintf(buf, "{\\b1}");
+if (style_flags & STYLE_FLAG_ITALIC)
+av_bprintf(buf, "{\\i1}");
+if (style_flags & STYLE_FLAG_UNDERLINE)
+av_bprintf(buf, "{\\u1}");
+}
+
 switch (*text) {
 case '\r':
 break;
@@ -39,6 +55,16 @@ static int text_to_ass(AVBPrint *buf, const char *text, 
const char *text_end)
 av_bprint_chars(buf, *text, 1);
 break;
 }
+
+if (style_flags && text == style_end)
+{
+if (style_flags & STYLE_FLAG_BOLD)
+av_bprintf(buf, "{\\b0}");
+if (style_flags & STYLE_FLAG_ITALIC)
+av_bprintf(buf, "{\\i0}");
+if (style_flags & STYLE_FLAG_UNDERLINE)
+av_bprintf(buf, "{\\u0}");
+}
 text++;
 }
 
@@ -63,6 +89,9 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
 AVBPrint buf;
 const char *ptr = avpkt->data;
 const char *end;
+int text_length, tsmb_type, style_entries, style_flags, tsmb_size;
+const char *style_start, *style_end;
+const uint8_t *tsmb;
 
 if (!ptr || avpkt->size < 2)
 return AVERROR_INVALIDDATA;
@@ -74,6 +103,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
  * already. If the value is non-zero, then it's technically a
  * bad packet.
  */
+
 if (avpkt->size == 2)
 return AV_RB16(ptr) == 0 ? 0 : AVERROR_INVALIDDATA;
 
@@ -82,7 +112,10 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
  * In complex cases, there are style descriptors appended to the string
  * so we can't just assume the packet size is the string size.
  */
-end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);
+//end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);
+text_length = AV_RB16(ptr);
+
+end = ptr + FFMIN(2 + text_length, avpkt->size); 
 ptr += 2;
 
 ts_start = av_rescale_q(avpkt->pts,
@@ -91,11 +124,47 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
 ts_end   = av_rescale_q(avpkt->pts + avpkt->duration,
 avctx->time_base,
 (AVRational){1,100});
-
+tsmb_size=0;
 // Note that the spec recommends lines be no longer than 2048 characters.
 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
-text_to_ass(&buf, ptr, end);
-ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end-ts_start);
+if (text_length + 2 != avpkt->size)
+{
+while (text_length + 2 + tsmb_size < avpkt->size)
+{
+tsmb = ptr + text_length+tsmb_size; 
+tsmb_size = AV_RB32(tsmb);  
+tsmb += 4;
+tsmb_type = AV_RB32(tsmb);
+tsmb += 4;
+
+if (tsmb_type == MKBETAG('s','t','y','l'))
+{
+style_entries = AV_RB16(tsmb);
+tsmb += 2;
+
+for(int i = 0; i < style_entries;i++)
+{
+style_start = ptr + AV_RB16(tsmb);
+tsmb += 2;
+style_end = ptr + AV_RB16(tsmb);
+tsmb += 2;
+// fontID = AV_RB16(tsmb);
+tsmb += 2;
+style_flags = AV_RB8(tsmb);
+//fontsize=AV_RB8(tsmb);
+//tsmb += 2;
+// text-color-rgba
+//tsmb += 4;
+text_to_ass(&buf, ptr, end, style_start, style_end, 
style_flags);
+}
+}
+   
+}
+}
+else
+text_to_ass(&buf, ptr, end, NULL, NULL, 0);
+
+ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end - ts_start);
 av_bprint_finalize(&buf, NULL);
 if (r

Re: [FFmpeg-devel] Question on tbr, tbn, tbc

2015-04-13 Thread Kamaldeep Tumkur
Thanks for the detailed answer. Needs no more clarifications. I will pursue
such questions on the user list.

Thanks

On Mon, Apr 13, 2015 at 7:09 PM, Jean First  wrote:

> On Mon Apr 13 2015 15:30:03 GMT+0200 (CEST), Kamaldeep Tumkur wrote:
> > I have an mpeg4 transcoded from an mov source that has the following:
> >
> > Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
> > yuv420p(tv, bt709), 480x270 [SAR 1:1 DAR 16:9], 462 kb/s, 25 fps, 25 tbr,
> > 12800 tbn, 50 tbc (default)
> >
> > Why is tbn value so high? Why do the tbc and tbn values not match the
> tbr?
> > And what kind of irregularities can this potentially cause during
> playback?
> > How can it be corrected?
> >
> > When used in http based streaming with flash, this mp4 results in a black
> > screen right at start up that continues till the end. On seeking, the
> video
> > displays back again.
> >
> > Thanks for your inputs and guidance.
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> Hi,
>
> Please continue this conversation on the ffmpeg-user mailinglist !
>
> The default value is set so high so you can combine multiple streams
> with different timebases in the same container without having to worry
> for offsets. It should not cause any problems during playback. If you
> want to set it to a specific value during encoding you can set the
> video_track_timescale option to a specific value.
>
> Jean
> ___
> 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] Question on tbr, tbn, tbc

2015-04-13 Thread Jean First
On Mon Apr 13 2015 15:30:03 GMT+0200 (CEST), Kamaldeep Tumkur wrote:
> I have an mpeg4 transcoded from an mov source that has the following:
>
> Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
> yuv420p(tv, bt709), 480x270 [SAR 1:1 DAR 16:9], 462 kb/s, 25 fps, 25 tbr,
> 12800 tbn, 50 tbc (default)
>
> Why is tbn value so high? Why do the tbc and tbn values not match the tbr?
> And what kind of irregularities can this potentially cause during playback?
> How can it be corrected?
>
> When used in http based streaming with flash, this mp4 results in a black
> screen right at start up that continues till the end. On seeking, the video
> displays back again.
>
> Thanks for your inputs and guidance.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Hi,

Please continue this conversation on the ffmpeg-user mailinglist !

The default value is set so high so you can combine multiple streams
with different timebases in the same container without having to worry
for offsets. It should not cause any problems during playback. If you
want to set it to a specific value during encoding you can set the
video_track_timescale option to a specific value.

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


[FFmpeg-devel] Question on tbr, tbn, tbc

2015-04-13 Thread Kamaldeep Tumkur
I have an mpeg4 transcoded from an mov source that has the following:

Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
yuv420p(tv, bt709), 480x270 [SAR 1:1 DAR 16:9], 462 kb/s, 25 fps, 25 tbr,
12800 tbn, 50 tbc (default)

Why is tbn value so high? Why do the tbc and tbn values not match the tbr?
And what kind of irregularities can this potentially cause during playback?
How can it be corrected?

When used in http based streaming with flash, this mp4 results in a black
screen right at start up that continues till the end. On seeking, the video
displays back again.

Thanks for your inputs and guidance.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: add tta encoder test

2015-04-13 Thread Nicolas George
Le quartidi 24 germinal, an CCXXIII, Paul B Mahol a écrit :
> TTA muxer is impossible to write without using temporary file instead of 
> caching
> all frames in memory.

Can you shortly explain why (or give a link to where it was already done)?

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] fate: add tta encoder test

2015-04-13 Thread Paul B Mahol
On 4/13/15, James Almer  wrote:
> Signed-off-by: James Almer 
> ---
> This should be updated whenever a TTA muxer is written and commited since
> Matroska is not ideal for the format.
>

TTA muxer is impossible to write without using temporary file instead of caching
all frames in memory.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Remove codec specific metadata inside MDAT

2015-04-13 Thread Kamaldeep Tumkur
Ok, thank you for the info.

On Mon, Apr 13, 2015 at 5:22 PM, Kieran Kunhya  wrote:

> On 13 April 2015 at 12:49, Kamaldeep Tumkur 
> wrote:
> > I don't want to hide the x264 settings. If this is part of the bitstream,
> > are all decoders going to understand it? Will it be used in some way? For
> > decoders that do not understand it, will it cause issues or will it be
> > ignored?
>
> It is a legal part of a h264 bitstream (SEI) and so decoders will
> ignore it as per the spec.
>
> Kieran
> ___
> 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] h264: remove bogus YCgCo warning message

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 01:03:35PM +0200, wm4 wrote:
> YCgCo decoding works just fine. It depends on the API user what is done
> with the output. Some API users might support it, some not. Some users
> might support it under certain circumstances only.
> 
> It is not the job of the decoder to print this message. If the API user
> supports it, this message is extremely unhelpful.
> ---
> Resent because I accidentally posted this as a reply to an old thread.
> ---
>  libavcodec/h264_slice.c | 2 --
>  1 file changed, 2 deletions(-)

applied

in the future, please move code that is bad where it is to where it
should be instead of removing it

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


Re: [FFmpeg-devel] Remove codec specific metadata inside MDAT

2015-04-13 Thread Kieran Kunhya
On 13 April 2015 at 12:49, Kamaldeep Tumkur  wrote:
> I don't want to hide the x264 settings. If this is part of the bitstream,
> are all decoders going to understand it? Will it be used in some way? For
> decoders that do not understand it, will it cause issues or will it be
> ignored?

It is a legal part of a h264 bitstream (SEI) and so decoders will
ignore it as per the spec.

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


Re: [FFmpeg-devel] Remove codec specific metadata inside MDAT

2015-04-13 Thread Kamaldeep Tumkur
I don't want to hide the x264 settings. If this is part of the bitstream,
are all decoders going to understand it? Will it be used in some way? For
decoders that do not understand it, will it cause issues or will it be
ignored?

Thanks

On Mon, Apr 13, 2015 at 4:47 PM, Kieran Kunhya  wrote:

> > Is there a way for me to remove the x264 specific metadata from the MDAT
> > box of the mp4? Right now, my MDAT has the following as the first few
> > bytes. Is this length accounted for as part of MDAT headers?
>
> This data is part of the video bitstream. If you want to hide your
> x264 settings please ask elsewhere.
>
> Kieran
> ___
> 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] Remove codec specific metadata inside MDAT

2015-04-13 Thread Kieran Kunhya
> Is there a way for me to remove the x264 specific metadata from the MDAT
> box of the mp4? Right now, my MDAT has the following as the first few
> bytes. Is this length accounted for as part of MDAT headers?

This data is part of the video bitstream. If you want to hide your
x264 settings please ask elsewhere.

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


[FFmpeg-devel] Remove codec specific metadata inside MDAT

2015-04-13 Thread Kamaldeep Tumkur
Hello,

I have an mov file encoded as an mp4 MBR stream at 3-4 different bitrates
with x264 encoding.

Is there a way for me to remove the x264 specific metadata from the MDAT
box of the mp4? Right now, my MDAT has the following as the first few
bytes. Is this length accounted for as part of MDAT headers?

x264 - core 132 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 -
http://www.videolan.org/x264.html - options:  cabac=0 ref=1 deblock=1:0:0
analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0
me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=0 threads=48 lookahead_threads=2
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=28.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00


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


[FFmpeg-devel] [PATCH] h264: remove bogus YCgCo warning message

2015-04-13 Thread wm4
YCgCo decoding works just fine. It depends on the API user what is done
with the output. Some API users might support it, some not. Some users
might support it under certain circumstances only.

It is not the job of the decoder to print this message. If the API user
supports it, this message is extremely unhelpful.
---
Resent because I accidentally posted this as a reply to an old thread.
---
 libavcodec/h264_slice.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index d3c57eb..7a55e02 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1004,8 +1004,6 @@ static enum AVPixelFormat get_pixel_format(H264Context 
*h, int force_callback)
 *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
 if (CHROMA444(h)) {
-if (h->avctx->colorspace == AVCOL_SPC_YCGCO)
-av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo 
colorspace.\n");
 if (h->avctx->colorspace == AVCOL_SPC_RGB)
 *fmt++ = AV_PIX_FMT_GBRP;
 else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] Fixed remuxing of HDMV PGS subtitles

2015-04-13 Thread Petri Hintukainen
On su, 2015-04-12 at 16:40 -0700, Philip Langdale wrote:
> On Sun, 12 Apr 2015 08:13:39 + (UTC)
> Carl Eugen Hoyos  wrote:
> > 
> > I tested with samples from the following directories:
> > http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket598/
> > http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1722/
> > http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3820/
> > 
> > None of them work for me with the patch. It seems I am 
> > doing something wrong, could you explain how I should 
> > test?
>
> OK.
> 
> I used:
> 
> http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket598/2_nosubs_detected.m2ts
> 
> Then I did:
> 
> ffmpeg -i 2_nosubs_detected.m2ts -map 0 -c:v copy -c:a copy -c:s \
> copy remux.m2ts
>
> and I played remux.m2ts successfully in mplayer with working subtitles.
> 
> Now, the ffmpeg probe output will not look the same as the original
> file. You'll see:
> 
> Stream #0:7[0x107], 0, 1/9: Unknown: none ([144][0][0][0] / 0x0090)
> Stream #0:8[0x108], 0, 1/9: Unknown: none ([144][0][0][0] / 0x0090)
> Stream #0:9[0x109], 0, 1/9: Unknown: none ([144][0][0][0] / 0x0090)
> Stream #0:10[0x10a], 0, 1/9: Unknown: none ([144][0][0][0] / 0x0090)
> Stream #0:11[0x10b], 0, 1/9: Unknown: none ([144][0][0][0] / 0x0090)

0x90 stream type is not detected as PGS because of there's no HDMV
registration descriptor in the program. Without it HDMV stream types are
not "valid", and most demuxers (ffmpeg, vlc, ...) ignore those.

> This change makes sure the 0x0090 type ID at the end is carried over
> during the copy operation. There is a bunch of separate metadata which
> needs to be copied for the 'Unknown' to be replaced by the right info
> for the pgs subtitles, but that's a separate lower level problem in the
> muxer - it doesn't appear to copy that info correctly in a whole class
> of types, where pgs is just one example.
>
> It does have implications. You can remux from a proper bluray m2ts and
> get a working file, but if you try and remux that output into a new
> file, everything fails because ffmpeg can't identify the subtitle
> tracks any more.
> 
> So, this change is not a complete fix, but it's one of the necessary
> steps.

I don't know if it is a good idea to use HDMV stream types without HDMV
program registration descriptor. If this is fixed incrementally, fixing
should be started from the opposite direction:
- Using HDMV stream type requires HDMV registration descriptor
- using HDMV registration descriptor requires HDMV conforming stream

I've attached a simple patch to add HDMV registration descriptor to the
program. With it streams are correctly detected with ffmpeg. But, I
don't think the patch should be applied: using HDMV registration
descriptor in a stream that is not HDMV conforming is a really bad
idea. 

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

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 7670fc6..2e98d2a 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -233,7 +233,7 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
 {
 MpegTSWrite *ts = s->priv_data;
 uint8_t data[SECTION_LENGTH], *q, *desc_length_ptr, *program_info_length_ptr;
-int val, stream_type, i, err = 0;
+int val, stream_type, i, err = 0, hdmv = 0;
 
 q = data;
 put16(&q, 0xe000 | service->pcr_pid);
@@ -241,8 +241,27 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
 program_info_length_ptr = q;
 q += 2; /* patched after */
 
+for (i = 0; i < s->nb_streams; i++) {
+switch (s->streams[i]->codec->codec_id) {
+case AV_CODEC_ID_PCM_BLURAY:
+case AV_CODEC_ID_HDMV_PGS_SUBTITLE:
+hdmv = 1;
+break;
+}
+}
+
 /* put program info here */
 
+/* add HDMV registration descriptor */
+if (hdmv) {
+*q++ = 0x05; /* tag: registration descriptor */
+*q++ = 4;/* length: 4 */
+*q++ = 'H';
+*q++ = 'D';
+*q++ = 'M';
+*q++ = 'V';
+}
+
 val = 0xf000 | (q - program_info_length_ptr - 2);
 program_info_length_ptr[0] = val >> 8;
 program_info_length_ptr[1] = val;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Pixel format 12bit grayscale

2015-04-13 Thread Carl Eugen Hoyos
wm4  googlemail.com> writes:

> GRAY12 would be something different from GRAY16 with
> bits_per_raw_sample set. The former sets MSBs to zero,

> the latter zeros LSBs.

It should not zero them, white should not be gray.
(But there is of course no difference between the two.)

Carl Eugen

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


Re: [FFmpeg-devel] Pixel format 12bit grayscale

2015-04-13 Thread wm4
On Mon, 13 Apr 2015 10:19:15 + (UTC)
Carl Eugen Hoyos  wrote:

> Michael Niedermayer  gmx.at> writes:
> 
> > On Mon, Apr 13, 2015 at 09:59:57AM +, Marco Porsch wrote:
> 
> > > Previously we had regular 16bit RAW that worked like a 
> > > charm as input to FFmpeg. The naïve approach of upscaling 
> > > the 12bit to 16bit destroys the compression efficiency of 
> > > course...
> > 
> > add a AV_PIX_FMT_GRAY12BE / AV_PIX_FMT_GRAY12LE similar to 
> > the existing planar 12 bit YUV formats, and add a decoder 
> > which decodes this odd packing above into it, then add 12bit 
> > gray support to FFVHUFF theres alreeadyy support for other 
> > 12bit planar formats in it
> 
> Whats wrong with using GRAY16 and setting bits_per_raw_sample?
> I believe ffv1 already supports reading bits_per_raw_sample, 
> ffvhuff could be patched and no additional colour space will 
> be needed. Or is there hardware or an external library that 
> supports GRAY12?

GRAY12 would be something different from GRAY16 with
bits_per_raw_sample set. The former sets MSBs to zero,
the latter zeros LSBs.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Stefano Sabatini
On date Monday 2015-04-13 12:19:21 +0200, Michael Niedermayer encoded:
> On Fri, Apr 10, 2015 at 08:58:13PM +0200, Thilo Borgmann wrote:
> > Hi!
> > 
> > I'd like to request refunds for merchandise expenses at the Chemnitzer
> > Linux Tage 2015, where we had manned a booth for FFmpeg.
> > 
> > I wonder why there seems to be nothing else on the list because expenses
> > were higher than last time afaik - I'm sorry if I just missed the
> > corresponding thread on the list.
> > 
> > My expenses are just for the merchandise basecaps: 166.42 €
> 
> LGTM

Approved by me as well. I'll forward the request to SPI.
-- 
FFmpeg = Fast & Freak Mystic Perfectionist Eretic Gnome
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Stefano Sabatini
On date Monday 2015-04-13 12:19:36 +0200, Michael Niedermayer encoded:
> On Mon, Apr 13, 2015 at 11:37:39AM +0200, Thomas Volkert wrote:
> > Hi,
> > 
> > My expenses consist of:
> > - 5 x t-shirt: 116,49 € (the shirts were given to our team, one
> > stays with me)
> > - 1 x tablecloth: 81,61 €
> > - 1 x traveling: 147 €
> > - no hotel costs
> > ---
> > total: 345,1 €
> 
> LGTM

Fine with me. I'll forward the request to the SPI treasurer.
-- 
FFmpeg = Faithful Fabulous Multipurpose Pure Elastic Gargoyle
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Pixel format 12bit grayscale

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 10:19:15AM +, Carl Eugen Hoyos wrote:
> Michael Niedermayer  gmx.at> writes:
> 
> > On Mon, Apr 13, 2015 at 09:59:57AM +, Marco Porsch wrote:
> 
> > > Previously we had regular 16bit RAW that worked like a 
> > > charm as input to FFmpeg. The naïve approach of upscaling 
> > > the 12bit to 16bit destroys the compression efficiency of 
> > > course...
> > 
> > add a AV_PIX_FMT_GRAY12BE / AV_PIX_FMT_GRAY12LE similar to 
> > the existing planar 12 bit YUV formats, and add a decoder 
> > which decodes this odd packing above into it, then add 12bit 
> > gray support to FFVHUFF theres alreeadyy support for other 
> > 12bit planar formats in it
> 
> Whats wrong with using GRAY16 and setting bits_per_raw_sample?
> I believe ffv1 already supports reading bits_per_raw_sample, 
> ffvhuff could be patched and no additional colour space will 
> be needed. Or is there hardware or an external library that 
> supports GRAY12?

yes GRAY16 with bits_per_raw_sample can be used too

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Michael Niedermayer
On Fri, Apr 10, 2015 at 08:58:13PM +0200, Thilo Borgmann wrote:
> Hi!
> 
> I'd like to request refunds for merchandise expenses at the Chemnitzer
> Linux Tage 2015, where we had manned a booth for FFmpeg.
> 
> I wonder why there seems to be nothing else on the list because expenses
> were higher than last time afaik - I'm sorry if I just missed the
> corresponding thread on the list.
> 
> My expenses are just for the merchandise basecaps: 166.42 €

LGTM

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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


Re: [FFmpeg-devel] Pixel format 12bit grayscale

2015-04-13 Thread Carl Eugen Hoyos
Michael Niedermayer  gmx.at> writes:

> On Mon, Apr 13, 2015 at 09:59:57AM +, Marco Porsch wrote:

> > Previously we had regular 16bit RAW that worked like a 
> > charm as input to FFmpeg. The naïve approach of upscaling 
> > the 12bit to 16bit destroys the compression efficiency of 
> > course...
> 
> add a AV_PIX_FMT_GRAY12BE / AV_PIX_FMT_GRAY12LE similar to 
> the existing planar 12 bit YUV formats, and add a decoder 
> which decodes this odd packing above into it, then add 12bit 
> gray support to FFVHUFF theres alreeadyy support for other 
> 12bit planar formats in it

Whats wrong with using GRAY16 and setting bits_per_raw_sample?
I believe ffv1 already supports reading bits_per_raw_sample, 
ffvhuff could be patched and no additional colour space will 
be needed. Or is there hardware or an external library that 
supports GRAY12?

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


Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 11:37:39AM +0200, Thomas Volkert wrote:
> Hi,
> 
> My expenses consist of:
> - 5 x t-shirt: 116,49 € (the shirts were given to our team, one
> stays with me)
> - 1 x tablecloth: 81,61 €
> - 1 x traveling: 147 €
> - no hotel costs
> ---
> total: 345,1 €

LGTM

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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


Re: [FFmpeg-devel] Pixel format 12bit grayscale

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 09:59:57AM +, Marco Porsch wrote:
> Hi,
> 
> our automotive cameras generate a weird kind of 12bit RAW format that I would 
> like to encode using FFVHUFF. Unfortunately, the 12bit grayscale pixel format 
> is not yet supported.
> Can you point me on the right track to implement this pixel format? And will 
> the encoder be able to handle the 12bit depth?
> 
> I'll draw a little ASCII art concerning the bit mapping below. Basically a 
> group of 4x8bit MSBs are given as block followed by a 4x4bit LSBs block. The 
> pattern continues correspondingly.
> 
> |-|-|-|-|
> |  P0[11..4]  |  P1[11..4]  |  P2[11..4]  |  
> P3[11..4]  |
> |-|-|-|-|
> | P0[0..3] | P1[0..3] | P2[0..3] | P3[0..3] |  P4[11..4]  |  
> P5[11..4]  |
> |-|-|-|-|
> |  P6[11..4]  |  P7[11..4]  | P4[0..3] | P5[0..3] | P6[0..3] 
> | P7[0..3] |
> |-|-|-|-|
> |  P8[11..4]  |  P9[11..4]  | P10[11..4]  | 
> P11[11..4]  |
> |-|-|-|-|
> | P8[0..3] | P9[0..3] |P10[0..3] |P11[0..3] |
> |-|-|
> 
> Previously we had regular 16bit RAW that worked like a charm as input to 
> FFmpeg. The naïve approach of upscaling the 12bit to 16bit destroys the 
> compression efficiency of course...

add a AV_PIX_FMT_GRAY12BE / AV_PIX_FMT_GRAY12LE similar to the existing
planar 12 bit YUV formats, and add a decoder which decodes this
odd packing above into it, then add 12bit gray support to FFVHUFF
theres alreeadyy support for other 12bit planar formats in it

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH] lavf/mpeg: vobsub add an option to specify the .sub's URI

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 01:17:28AM -0500, Rodger Combs wrote:
> ---
>  libavformat/mpeg.c | 52 +---
>  1 file changed, 37 insertions(+), 15 deletions(-)

applied

maybe you want to add a fate test for this or add a sub file to an
existing fate test

thanks

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

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


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


[FFmpeg-devel] Pixel format 12bit grayscale

2015-04-13 Thread Marco Porsch
Hi,

our automotive cameras generate a weird kind of 12bit RAW format that I would 
like to encode using FFVHUFF. Unfortunately, the 12bit grayscale pixel format 
is not yet supported.
Can you point me on the right track to implement this pixel format? And will 
the encoder be able to handle the 12bit depth?

I'll draw a little ASCII art concerning the bit mapping below. Basically a 
group of 4x8bit MSBs are given as block followed by a 4x4bit LSBs block. The 
pattern continues correspondingly.

|-|-|-|-|
|  P0[11..4]  |  P1[11..4]  |  P2[11..4]  |  
P3[11..4]  |
|-|-|-|-|
| P0[0..3] | P1[0..3] | P2[0..3] | P3[0..3] |  P4[11..4]  |  
P5[11..4]  |
|-|-|-|-|
|  P6[11..4]  |  P7[11..4]  | P4[0..3] | P5[0..3] | P6[0..3] | 
P7[0..3] |
|-|-|-|-|
|  P8[11..4]  |  P9[11..4]  | P10[11..4]  | 
P11[11..4]  |
|-|-|-|-|
| P8[0..3] | P9[0..3] |P10[0..3] |P11[0..3] |
|-|-|

Previously we had regular 16bit RAW that worked like a charm as input to 
FFmpeg. The naïve approach of upscaling the 12bit to 16bit destroys the 
compression efficiency of course...

Thanks and best regards,
--Marco
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: add tta encoder test

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 04:12:28AM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
> Now with the ref file.
> 
> This should be updated whenever a TTA muxer is written and commited since 
> Matroska is not ideal for the format.
> 
>  tests/fate/acodec.mak | 3 +++
>  tests/ref/acodec/tta  | 4 
>  2 files changed, 7 insertions(+)
>  create mode 100644 tests/ref/acodec/tta

applied

thanks

[...]
-- 
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


[FFmpeg-devel] [PATCH] h264: remove bogus YCgCo warning message

2015-04-13 Thread wm4
YCgCo decoding works just fine. It depends on the API user what is done
with the output. Some API users might support it, some not. Some users
might support it under certain circumstances only.

It is not the job of the decoder to print this message. If the API user
supports it, this message is extremely unhelpful.
---
 libavcodec/h264_slice.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index d3c57eb..7a55e02 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1004,8 +1004,6 @@ static enum AVPixelFormat get_pixel_format(H264Context 
*h, int force_callback)
 *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
 if (CHROMA444(h)) {
-if (h->avctx->colorspace == AVCOL_SPC_YCGCO)
-av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo 
colorspace.\n");
 if (h->avctx->colorspace == AVCOL_SPC_RGB)
 *fmt++ = AV_PIX_FMT_GBRP;
 else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
-- 
2.1.4

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


Re: [FFmpeg-devel] Refund request for Chemnitzer Linux Tage 2015

2015-04-13 Thread Thomas Volkert

Hi,

My expenses consist of:
- 5 x t-shirt: 116,49 € (the shirts were given to our team, one stays 
with me)

- 1 x tablecloth: 81,61 €
- 1 x traveling: 147 €
- no hotel costs
---
total: 345,1 €

(The invoices were sent to Stefano.)

Best regards,
Thomas.

Am 10.04.2015 um 20:58 schrieb Thilo Borgmann:

Hi!

I'd like to request refunds for merchandise expenses at the Chemnitzer
Linux Tage 2015, where we had manned a booth for FFmpeg.

I wonder why there seems to be nothing else on the list because expenses
were higher than last time afaik - I'm sorry if I just missed the
corresponding thread on the list.

My expenses are just for the merchandise basecaps: 166.42 €

Anyone on the team got one, one should already have been delivered to
Michael and on is left for the next event to be given away to one of us
devs.

As I said before the CLT, I'm fine if any dev vetos on this refunds or
if our budget is stretched too much.

I've send a copy of the invoice to Stefano for handling refunds if granted.

Thanks,
Thilo
___
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] lavf/http: handle case where the server returns a redirect during a seek

2015-04-13 Thread Michael Niedermayer
On Mon, Apr 13, 2015 at 12:39:44AM -0500, Rodger Combs wrote:
> txoffer (e.g. http://tori.aoi-chan.com/ ) redirects to the same URI on your
> first request, and serves the actual file on the second. It's stupid, but 
> AFAIK
> technically compliant. We'd previously see the server not handing back a Range
> header and return an error; now, instead, we see that there's a redirect and
> keep track of the offset we want while trying again at the new URL.
> ---
>  libavformat/http.c | 3 +++
>  1 file changed, 3 insertions(+)

applied

thanks

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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


[FFmpeg-devel] [PATCH] fate: add tta encoder test

2015-04-13 Thread James Almer
Signed-off-by: James Almer 
---
Now with the ref file.

This should be updated whenever a TTA muxer is written and commited since 
Matroska is not ideal for the format.

 tests/fate/acodec.mak | 3 +++
 tests/ref/acodec/tta  | 4 
 2 files changed, 7 insertions(+)
 create mode 100644 tests/ref/acodec/tta

diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
index b7e510c..56301d3 100644
--- a/tests/fate/acodec.mak
+++ b/tests/fate/acodec.mak
@@ -150,6 +150,9 @@ FATE_ACODEC-$(call ENCDEC, WAVPACK, WV) += 
fate-acodec-wavpack
 fate-acodec-wavpack: FMT = wv
 fate-acodec-wavpack: CODEC = wavpack -compression_level 1
 
+FATE_ACODEC-$(call ENCDEC, TTA, MATROSKA) += fate-acodec-tta
+fate-acodec-tta: FMT = matroska
+
 FATE_ACODEC += $(FATE_ACODEC-yes)
 
 $(FATE_ACODEC): tests/data/asynth-44100-2.wav
diff --git a/tests/ref/acodec/tta b/tests/ref/acodec/tta
new file mode 100644
index 000..5cf6b9a
--- /dev/null
+++ b/tests/ref/acodec/tta
@@ -0,0 +1,4 @@
+aeeb0f2e75d044dbe2f89b7e70a54c82 *tests/data/fate/acodec-tta.matroska
+331080 tests/data/fate/acodec-tta.matroska
+95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-tta.out.wav
+stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  1058400/  1058400
-- 
2.3.5

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


[FFmpeg-devel] [PATCH] fate: add tta encoder test

2015-04-13 Thread James Almer
Signed-off-by: James Almer 
---
This should be updated whenever a TTA muxer is written and commited since 
Matroska is not ideal for the format.

 tests/fate/acodec.mak | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
index b7e510c..56301d3 100644
--- a/tests/fate/acodec.mak
+++ b/tests/fate/acodec.mak
@@ -150,6 +150,9 @@ FATE_ACODEC-$(call ENCDEC, WAVPACK, WV) += 
fate-acodec-wavpack
 fate-acodec-wavpack: FMT = wv
 fate-acodec-wavpack: CODEC = wavpack -compression_level 1
 
+FATE_ACODEC-$(call ENCDEC, TTA, MATROSKA) += fate-acodec-tta
+fate-acodec-tta: FMT = matroska
+
 FATE_ACODEC += $(FATE_ACODEC-yes)
 
 $(FATE_ACODEC): tests/data/asynth-44100-2.wav
-- 
2.3.5

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