[FFmpeg-devel] video fps filter problem

2018-08-08 Thread 홍석진
Hi.
​
I have something to discuss with you about vf_fps.c in FFmpeg 4.
​
When I tried to encode a video which has only one video frame, a encoded video 
(result) had no video stream.
I used video fps filter to adjust fps from 25 to 12 (ffmpeg argument 
fps=fps=12.00).
​
I know that vf_fps.c was newly rewritten in FFmpeg 4.
I tried to analyze vf_fps.c source code and finally realized that fps filter 
remove frame few conditions as below
/* There are two conditions where we want to drop a frame:
* - If we have two buffered frames and the second frame is acceptable
* as the next output frame, then drop the first buffered frame.
* - If we have status (EOF) set, drop frames when we hit the
* status timestamp. */​
In that case, video frame of my video contents can't be passed to 
ff_filter_frame function because this video contents has only one frame.
​
So, I wonder if I should think of this video as unusual. Because when I use 
FFmpeg 3, encoded result video has video stream.
​
See video metadata extracted by ffprobe (ffprobe -select_streams v:0 
-show_frames 144p_issue_only_1frame.mp4)

 
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '144p_issue_only_1frame.mp4':
Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2mp41
encoder : Lavf57.25.100
Duration: 00:04:34.69, start: 0.00, bitrate: 129 kb/s
Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 
1280x720 [SAR 1:1 DAR 16:9], 5726 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc 
(default)
Metadata:
handler_name: VideoHandler
Stream #0:1(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, 
fltp, 126 kb/s (default)
Metadata:
handler_name: SoundHandler
[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.00
pkt_dts=0
pkt_dts_time=0.00
best_effort_timestamp=0
best_effort_timestamp_time=0.00
pkt_duration=512
pkt_duration_time=0.04
pkt_pos=44
pkt_size=28633
width=1280
height=720
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
color_range=unknown
color_space=unknown
color_primaries=unknown
color_transfer=unknown
chroma_location=left
[/FRAME]​


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


Re: [FFmpeg-devel] [PATCH] lavfi: update xbr filter url

2018-08-08 Thread Gyan Doshi



On 09-08-2018 10:31 AM, Gyan Doshi wrote:



On 09-08-2018 01:19 AM, Mina wrote:


This patch update the existing url with the newly found one.


Will apply.

Thanks,
Gyan


Pushed as e0539f0349e945793c11cd88c468d9a2f3fedce9 with 
modified/shortened commit msg.


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


Re: [FFmpeg-devel] [PATCH] lavfi: update xbr filter url

2018-08-08 Thread Gyan Doshi



On 09-08-2018 01:19 AM, Mina wrote:


This patch update the existing url with the newly found one.


Will apply.

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


Re: [FFmpeg-devel] [PATCH] ffmpeg: correct units for raw pts in -progress report

2018-08-08 Thread Gyan Doshi



On 08-08-2018 12:47 AM, Nicolas George wrote:

Gyan Doshi (2018-08-08):

That will just defer the breaking change.


That will leave people time to notice the change and allow old and new
scripts to work during the transition.


Will do it this way.

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


[FFmpeg-devel] [PATCH] lavfi: add erosion_opencl, dilation_opencl filters

2018-08-08 Thread Danil Iashchenko
Add erosion_opencl, dilation_opencl filters. Behave like existing erosion and 
dilation filters.
---

Thanks! Fixed.

 configure|   2 +
 libavfilter/Makefile |   4 +
 libavfilter/allfilters.c |   2 +
 libavfilter/opencl/neighbor.cl   |  87 +++
 libavfilter/opencl_source.h  |   1 +
 libavfilter/vf_neighbor_opencl.c | 327 +++
 6 files changed, 423 insertions(+)
 create mode 100644 libavfilter/opencl/neighbor.cl
 create mode 100644 libavfilter/vf_neighbor_opencl.c

diff --git a/configure b/configure
index 5783407..9ab2e9f 100755
--- a/configure
+++ b/configure
@@ -,10 +,12 @@ deinterlace_vaapi_filter_deps="vaapi"
 delogo_filter_deps="gpl"
 denoise_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
 deshake_filter_select="pixelutils"
+dilation_opencl_filter_deps="opencl"
 drawtext_filter_deps="libfreetype"
 drawtext_filter_suggest="libfontconfig libfribidi"
 elbg_filter_deps="avcodec"
 eq_filter_deps="gpl"
+erosion_opencl_filter_deps="opencl"
 fftfilt_filter_deps="avcodec"
 fftfilt_filter_select="rdft"
 fftdnoiz_filter_deps="avcodec"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 5d4549e..03df93b 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -196,6 +196,8 @@ OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
 OBJS-$(CONFIG_DESPILL_FILTER)+= vf_despill.o
 OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DILATION_FILTER)   += vf_neighbor.o
+OBJS-$(CONFIG_DILATION_OPENCL_FILTER)+= vf_neighbor_opencl.o opencl.o \
+opencl/neighbor.o
 OBJS-$(CONFIG_DISPLACE_FILTER)   += vf_displace.o framesync.o
 OBJS-$(CONFIG_DOUBLEWEAVE_FILTER)+= vf_weave.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
@@ -207,6 +209,8 @@ OBJS-$(CONFIG_ELBG_FILTER)   += vf_elbg.o
 OBJS-$(CONFIG_ENTROPY_FILTER)+= vf_entropy.o
 OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
 OBJS-$(CONFIG_EROSION_FILTER)+= vf_neighbor.o
+OBJS-$(CONFIG_EROSION_OPENCL_FILTER) += vf_neighbor_opencl.o opencl.o \
+opencl/neighbor.o
 OBJS-$(CONFIG_EXTRACTPLANES_FILTER)  += vf_extractplanes.o
 OBJS-$(CONFIG_FADE_FILTER)   += vf_fade.o
 OBJS-$(CONFIG_FFTDNOIZ_FILTER)   += vf_fftdnoiz.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 521bc53..f33129c 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -185,6 +185,7 @@ extern AVFilter ff_vf_deshake;
 extern AVFilter ff_vf_despill;
 extern AVFilter ff_vf_detelecine;
 extern AVFilter ff_vf_dilation;
+extern AVFilter ff_vf_dilation_opencl;
 extern AVFilter ff_vf_displace;
 extern AVFilter ff_vf_doubleweave;
 extern AVFilter ff_vf_drawbox;
@@ -196,6 +197,7 @@ extern AVFilter ff_vf_elbg;
 extern AVFilter ff_vf_entropy;
 extern AVFilter ff_vf_eq;
 extern AVFilter ff_vf_erosion;
+extern AVFilter ff_vf_erosion_opencl;
 extern AVFilter ff_vf_extractplanes;
 extern AVFilter ff_vf_fade;
 extern AVFilter ff_vf_fftdnoiz;
diff --git a/libavfilter/opencl/neighbor.cl b/libavfilter/opencl/neighbor.cl
new file mode 100644
index 000..2235e3e
--- /dev/null
+++ b/libavfilter/opencl/neighbor.cl
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018 Danil Iashchenko
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+__kernel void erosion_global(__write_only image2d_t dst,
+ __read_only  image2d_t src,
+ float threshold,
+ __constant int *coord)
+{
+const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
+CLK_ADDRESS_CLAMP_TO_EDGE   |
+CLK_FILTER_NEAREST);
+
+int2 loc = (int2)(get_global_id(0), get_global_id(1));
+
+float4 px = read_imagef(src, sampler, loc);
+float limit = px.x - threshold;
+if (limit < 0) {
+limit = 0;
+}
+
+for (int i = -1; i <= 1; i++) {
+for (int j = -1; j <= 1; j++) {
+if (coord[(j + 1) * 3 + (i + 1)] == 1) {
+float4 

Re: [FFmpeg-devel] [PATCH] lavfi: add erosion_opencl, dilation_opencl filters

2018-08-08 Thread Michael Niedermayer
On Thu, Aug 09, 2018 at 03:20:53AM +0300, Danil Iashchenko wrote:
> Add erosion_opencl, dilation_opencl filters. Behave like existing erosion and 
> dilation filters.
> 
> ---
>  configure|   1 +
>  libavfilter/Makefile |   4 +
>  libavfilter/allfilters.c |   2 +
>  libavfilter/opencl/neighbor.cl   |  87 +++
>  libavfilter/opencl_source.h  |   1 +
>  libavfilter/vf_neighbor_opencl.c | 327 
> +++
>  6 files changed, 422 insertions(+)
>  create mode 100644 libavfilter/opencl/neighbor.cl
>  create mode 100644 libavfilter/vf_neighbor_opencl.c

breaks build:
make 
LD  ffmpeg_g
/usr/bin/ld: warning: libx264.so.142, needed by 
//usr/lib/x86_64-linux-gnu/libavcodec.so.54, may conflict with libx264.so.146
/usr/bin/ld: warning: libvpx.so.1, needed by 
//usr/lib/x86_64-linux-gnu/libavcodec.so.54, may conflict with libvpx.so.4
libavfilter/libavfilter.a(vf_neighbor_opencl.o): In function 
`neighbor_opencl_filter_frame':
vf_neighbor_opencl.c:(.text+0x168): undefined reference to `clEnqueueCopyImage'
vf_neighbor_opencl.c:(.text+0x1c2): undefined reference to `clSetKernelArg'
vf_neighbor_opencl.c:(.text+0x1e2): undefined reference to `clSetKernelArg'
vf_neighbor_opencl.c:(.text+0x200): undefined reference to `clSetKernelArg'
vf_neighbor_opencl.c:(.text+0x222): undefined reference to `clSetKernelArg'
vf_neighbor_opencl.c:(.text+0x2a1): undefined reference to 
`clEnqueueNDRangeKernel'
vf_neighbor_opencl.c:(.text+0x2e4): undefined reference to 
`clReleaseCommandQueue'
vf_neighbor_opencl.c:(.text+0x2f2): undefined reference to `clReleaseKernel'
vf_neighbor_opencl.c:(.text+0x2fb): undefined reference to `clFinish'
vf_neighbor_opencl.c:(.text+0x360): undefined reference to 
`clCreateCommandQueue'
vf_neighbor_opencl.c:(.text+0x3c5): undefined reference to `clCreateKernel'
vf_neighbor_opencl.c:(.text+0x524): undefined reference to `clCreateBuffer'
vf_neighbor_opencl.c:(.text+0x56d): undefined reference to `clFinish'
libavfilter/libavfilter.a(vf_neighbor_opencl.o): In function 
`neighbor_opencl_uninit':
vf_neighbor_opencl.c:(.text.unlikely+0x14): undefined reference to 
`clReleaseKernel'
vf_neighbor_opencl.c:(.text.unlikely+0x3c): undefined reference to 
`clReleaseCommandQueue'
libavfilter/libavfilter.a(opencl.o): In function `ff_opencl_filter_uninit':
opencl.c:(.text+0x2a7): undefined reference to `clReleaseProgram'
libavfilter/libavfilter.a(opencl.o): In function 
`ff_opencl_filter_load_program':
opencl.c:(.text+0x317): undefined reference to `clCreateProgramWithSource'
opencl.c:(.text+0x339): undefined reference to `clBuildProgram'
opencl.c:(.text+0x372): undefined reference to `clReleaseProgram'
opencl.c:(.text+0x3bd): undefined reference to `clGetProgramBuildInfo'
opencl.c:(.text+0x3ef): undefined reference to `clGetProgramBuildInfo'
libavfilter/libavfilter.a(opencl.o): In function 
`ff_opencl_filter_work_size_from_image':
opencl.c:(.text+0x5dd): undefined reference to `clGetMemObjectInfo'
opencl.c:(.text+0x60d): undefined reference to `clGetImageInfo'
opencl.c:(.text+0x63a): undefined reference to `clGetImageInfo'
collect2: error: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

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

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


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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vp9: Check in decode_tiles() if there is data remaining

2018-08-08 Thread James Almer
On 8/8/2018 9:30 PM, Michael Niedermayer wrote:
> On Tue, Aug 07, 2018 at 09:07:11PM -0400, Ronald S. Bultje wrote:
>> Hi,
>>
>> On Tue, Aug 7, 2018 at 7:15 PM, Michael Niedermayer 
>> wrote:
>>
>>> On Mon, Aug 06, 2018 at 09:50:57PM -0400, Ronald S. Bultje wrote:
 Hi,

 On Mon, Aug 6, 2018 at 3:00 PM, Michael Niedermayer
>>> 
 wrote:

> On Tue, Aug 07, 2018 at 01:05:51AM +0800, Ronald S. Bultje wrote:
>> Hi,
>>
>> On Sun, Aug 5, 2018, 9:17 AM Michael Niedermayer
>>> >
>> wrote:
>>
>>> Fixes: Timeout
>>> Fixes:
>>> 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_
> VP9_fuzzer-5707345857347584
>>>
>>> Found-by: continuous fuzzing process
>>> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
>>> Signed-off-by
>>>  ffmpegSigned-off-by>:
>>> Michael Niedermayer 
>>> ---
>>>  libavcodec/vp9.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
>>> index b1178c9c0c..4ca51ec108 100644
>>> --- a/libavcodec/vp9.c
>>> +++ b/libavcodec/vp9.c
>>> @@ -1302,6 +1302,9 @@ static int decode_tiles(AVCodecContext
>>> *avctx,
>>>  memset(lflvl_ptr->mask, 0,
>>> sizeof(lflvl_ptr->mask));
>>>  }
>>>
>>> +if (td->c->end <= td->c->buffer &&
>>> td->c->bits >=
> 0) {
>>> +return AVERROR_INVALIDDATA;
>>> +}
>>>  if (s->pass == 2) {
>>>  decode_sb_mem(td, row, col, lflvl_ptr,
>>>yoff2, uvoff2, BL_64X64);
>>>
>>
>> I don't think this matches spec. Implementations could use this to
>>> store
>> auxiliary data.
>
> This checks, or rather is intended to check for a premature end of the
> input.
> Am i missing something? because a premature end of input seems not to
>>> lead
> to more (auxiliary or other) data in the input.


 Hm, I misread it, sorry about that, my bad. Please ignore my first
>>> review.

>>>
 Is end == buffer && bits == 0 something that can happen on valid input if
 things just align properly? Otherwise looks OK.
>>>
>>> The same condition is used in vp5/6/8.
>>> I think this condition only occurs if the input ends. The part i do not
>>> know
>>> is if such premature ends might be a "valid compression"
>>>
>>> Either way, if this check misbehaves for a valid file then it should be
>>> reverted/removed unless its improv-able and improved.
>>
>>
> 
>>  Yes, that's how production grade software works.  
> 
> yes ;)
> but seriously, It only needs a single user hitting a bug and reporting it
> for us to know its a issue and revert. This is not in a release just git
> master.
> Its my oppinion that this is wiser than to never attempt to fix the issue.
> Which ultimatly is the alternative. That is unless you know that this is
> correct or incorrect for all cases.
> Maybe we have very differnt views of how to do software development.
> My goal is to minimize the amount of issues in the code per developer time
> spend. Time is a limited resource. Doing anything else simply leads to worse 
> code.
> If i spend a week testing code that i know is 99.8% right to make it
> 99.9% right just to save a single user from once hitting and reporting a
> non security bug. That is a loss as i could have spend that week fixing
> many other issues.
> Its even worse if the 99.9% still hits one user and gets reverted, in this
> case there is no improvment in user experience at all for the time spend.
> In either the 99.8 and 99.9% cases one user ultimatly hits a file that breaks
> and teh change gets reverted. but in one case we would have spend alot more
> time. 
> 
> So yes, it is my philosophy to use our users as beta testers. Not as a
> default no absolutely not, but in the rare cases where the extra work
> we cause our users is comparably tiny compared to how much work we would
> have to do to avoid it. Or if we can never really match user testing anyway
> And we also did and do this all over the place. For example, if we do not
> know how to handle some case and have no sample, we print a message and ask
> the user for a sample. 
> This is comparable to the case here. "Is there a sample out there for which 
> this
> check misbehaves" vs. "Is there a file out there that uses a special feature"
> Either is a question about global file existence and search

The end user is not a beta tester. A user knowingly and willingly acting
as one is a beta tester.
Firefox doesn't use git master, it uses the latest release, and that
means that a sizable bulk of users testing a wide array of vp9 streams
in order to find out if this change breaks any of them will not happen
until it's deployed to the general 

Re: [FFmpeg-devel] [PATCH] lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.

2018-08-08 Thread myp...@gmail.com
On Wed, Aug 8, 2018 at 9:50 PM James Almer  wrote:

> On 8/8/2018 7:56 AM, Jun Zhao wrote:
> > add add ONLY_IF_THREADS_ENABLED where it is missing.
> >
> > Signed-off-by: Jun Zhao 
> > ---
> >  libavcodec/hevcdec.c |4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> > index 409e77f..fec9218 100644
> > --- a/libavcodec/hevcdec.c
> > +++ b/libavcodec/hevcdec.c
> > @@ -3529,8 +3529,8 @@ AVCodec ff_hevc_decoder = {
> >  .close = hevc_decode_free,
> >  .decode= hevc_decode_frame,
> >  .flush = hevc_decode_flush,
> > -.update_thread_context = hevc_update_thread_context,
> > -.init_thread_copy  = hevc_init_thread_copy,
> > +.update_thread_context =
> ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
> > +.init_thread_copy  =
> ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
> >  .capabilities  = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
> >   AV_CODEC_CAP_SLICE_THREADS |
> AV_CODEC_CAP_FRAME_THREADS,
> >  .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
> FF_CODEC_CAP_EXPORTS_CROPPING,
>
> You should also wrap the two functions in question with HAVE_THREADS
> checks.
>
> Will update the patch as the comment, Thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for all sterams (in case of edit lists).

2018-08-08 Thread isasi-at-google . com
From: Sasi Inguva 

Fixes vorbis mp4 audio files, with edit list specified. Since
st->skip_samples is not set in case of vorbis , ffmpeg computes the
start_time as negative.

Signed-off-by: Sasi Inguva 
---
 libavformat/mov.c  | 4 ++--
 tests/fate/mov.mak | 5 +
 tests/ref/fate/mov-neg-firstpts-discard-vorbis | 3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 tests/ref/fate/mov-neg-firstpts-discard-vorbis

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 82cd410a72..c0f90edef7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3684,9 +3684,9 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 st->index_entries[i].timestamp -= msc->min_corrected_pts;
 }
 }
-// Start time should be equal to zero or the duration of any empty 
edits.
-st->start_time = empty_edits_sum_duration;
 }
+// Start time should be equal to zero or the duration of any empty edits.
+st->start_time = empty_edits_sum_duration;
 
 // Update av stream length, if it ends up shorter than the track's media 
duration
 st->duration = FFMIN(st->duration, edit_list_dts_entry_end - start_dts);
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 6f0e28d21e..3d9e4280bb 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -19,6 +19,7 @@ FATE_MOV = fate-mov-3elist \
fate-mov-stream-shorter-than-movie \
 
 FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \
+   fate-mov-neg-firstpts-discard-vorbis \
fate-mov-aac-2048-priming \
fate-mov-zombie \
fate-mov-init-nonkeyframe \
@@ -89,6 +90,10 @@ fate-mov-bbi-elst-starts-b: CMD = framemd5 -flags +bitexact 
-acodec aac_fixed -i
 # Makes sure that the stream start_time is not negative when the first packet 
is a DISCARD packet with negative timestamp.
 fate-mov-neg-firstpts-discard: CMD = run ffprobe$(PROGSSUF)$(EXESUF) 
-show_entries stream=start_time -bitexact 
$(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard.mov
 
+# Makes sure that the VORBIS audio stream start_time is not negative when the 
first few packets are DISCARD packets
+# with negative timestamps (skip_samples is not set for Vorbis, so ffmpeg 
computes start_time as negative if not specified by demuxer).
+fate-mov-neg-firstpts-discard-vorbis: CMD = run ffprobe$(PROGSSUF)$(EXESUF) 
-show_entries stream=start_time -bitexact 
$(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard_vorbis.mp4
+
 # Makes sure that expected frames are generated for 
mov_neg_first_pts_discard.mov with -vsync 1
 fate-mov-neg-firstpts-discard-frames: CMD = framemd5 -flags +bitexact -i 
$(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard.mov -vsync 1
 
diff --git a/tests/ref/fate/mov-neg-firstpts-discard-vorbis 
b/tests/ref/fate/mov-neg-firstpts-discard-vorbis
new file mode 100644
index 00..2e295e3b68
--- /dev/null
+++ b/tests/ref/fate/mov-neg-firstpts-discard-vorbis
@@ -0,0 +1,3 @@
+[STREAM]
+start_time=0.00
+[/STREAM]
-- 
2.18.0.597.ga71716f1ad-goog

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


Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for audio too (in case of edit lists).

2018-08-08 Thread Sasi Inguva
Ok. i'll correct the commit message.

On Wed, Aug 8, 2018 at 4:25 PM Michael Niedermayer 
wrote:

> On Wed, Aug 08, 2018 at 12:20:34PM -0700, Sasi Inguva wrote:
> > i intended it only for audio, but i don't see any harm if it gets applied
> > to subtitle tracks also .
>
> if you want subs incldued then the commit message is wrong at least
> if you dont want subs incldued the change is wrong
>
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If you drop bombs on a foreign country and kill a hundred thousand
> innocent people, expect your government to call the consequence
> "unprovoked inhuman terrorist attacks" and use it to justify dropping
> more bombs and killing more people. The technology changed, the idea is
> old.
> ___
> 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 1/2] avcodec/vp9: Check in decode_tiles() if there is data remaining

2018-08-08 Thread Michael Niedermayer
On Tue, Aug 07, 2018 at 09:07:11PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Aug 7, 2018 at 7:15 PM, Michael Niedermayer 
> wrote:
> 
> > On Mon, Aug 06, 2018 at 09:50:57PM -0400, Ronald S. Bultje wrote:
> > > Hi,
> > >
> > > On Mon, Aug 6, 2018 at 3:00 PM, Michael Niedermayer
> > 
> > > wrote:
> > >
> > > > On Tue, Aug 07, 2018 at 01:05:51AM +0800, Ronald S. Bultje wrote:
> > > > > Hi,
> > > > >
> > > > > On Sun, Aug 5, 2018, 9:17 AM Michael Niedermayer
> >  > > > >
> > > > > wrote:
> > > > >
> > > > > > Fixes: Timeout
> > > > > > Fixes:
> > > > > > 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_
> > > > VP9_fuzzer-5707345857347584
> > > > > >
> > > > > > Found-by: continuous fuzzing process
> > > > > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > > > > Signed-off-by
> > > > > >  > > > ffmpegSigned-off-by>:
> > > > > > Michael Niedermayer 
> > > > > > ---
> > > > > >  libavcodec/vp9.c | 3 +++
> > > > > >  1 file changed, 3 insertions(+)
> > > > > >
> > > > > > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > > > > > index b1178c9c0c..4ca51ec108 100644
> > > > > > --- a/libavcodec/vp9.c
> > > > > > +++ b/libavcodec/vp9.c
> > > > > > @@ -1302,6 +1302,9 @@ static int decode_tiles(AVCodecContext
> > *avctx,
> > > > > >  memset(lflvl_ptr->mask, 0,
> > > > > > sizeof(lflvl_ptr->mask));
> > > > > >  }
> > > > > >
> > > > > > +if (td->c->end <= td->c->buffer &&
> > td->c->bits >=
> > > > 0) {
> > > > > > +return AVERROR_INVALIDDATA;
> > > > > > +}
> > > > > >  if (s->pass == 2) {
> > > > > >  decode_sb_mem(td, row, col, lflvl_ptr,
> > > > > >yoff2, uvoff2, BL_64X64);
> > > > > >
> > > > >
> > > > > I don't think this matches spec. Implementations could use this to
> > store
> > > > > auxiliary data.
> > > >
> > > > This checks, or rather is intended to check for a premature end of the
> > > > input.
> > > > Am i missing something? because a premature end of input seems not to
> > lead
> > > > to more (auxiliary or other) data in the input.
> > >
> > >
> > > Hm, I misread it, sorry about that, my bad. Please ignore my first
> > review.
> > >
> >
> > > Is end == buffer && bits == 0 something that can happen on valid input if
> > > things just align properly? Otherwise looks OK.
> >
> > The same condition is used in vp5/6/8.
> > I think this condition only occurs if the input ends. The part i do not
> > know
> > is if such premature ends might be a "valid compression"
> >
> > Either way, if this check misbehaves for a valid file then it should be
> > reverted/removed unless its improv-able and improved.
> 
> 

>  Yes, that's how production grade software works.  

yes ;)
but seriously, It only needs a single user hitting a bug and reporting it
for us to know its a issue and revert. This is not in a release just git
master.
Its my oppinion that this is wiser than to never attempt to fix the issue.
Which ultimatly is the alternative. That is unless you know that this is
correct or incorrect for all cases.
Maybe we have very differnt views of how to do software development.
My goal is to minimize the amount of issues in the code per developer time
spend. Time is a limited resource. Doing anything else simply leads to worse 
code.
If i spend a week testing code that i know is 99.8% right to make it
99.9% right just to save a single user from once hitting and reporting a
non security bug. That is a loss as i could have spend that week fixing
many other issues.
Its even worse if the 99.9% still hits one user and gets reverted, in this
case there is no improvment in user experience at all for the time spend.
In either the 99.8 and 99.9% cases one user ultimatly hits a file that breaks
and teh change gets reverted. but in one case we would have spend alot more
time. 

So yes, it is my philosophy to use our users as beta testers. Not as a
default no absolutely not, but in the rare cases where the extra work
we cause our users is comparably tiny compared to how much work we would
have to do to avoid it. Or if we can never really match user testing anyway
And we also did and do this all over the place. For example, if we do not
know how to handle some case and have no sample, we print a message and ask
the user for a sample. 
This is comparable to the case here. "Is there a sample out there for which this
check misbehaves" vs. "Is there a file out there that uses a special feature"
Either is a question about global file existence and search


> Can
> you just make it not error out on the end == buffer && bits == 0 condition?
> Or does that somehow not fix your timeout?

If the code continues processing "nothing" and does alot of computations on it,
it will need a long time to complete that. Thats the issue.
Its like a network router 

[FFmpeg-devel] [PATCH] lavfi: add erosion_opencl, dilation_opencl filters

2018-08-08 Thread Danil Iashchenko
Add erosion_opencl, dilation_opencl filters. Behave like existing erosion and 
dilation filters.

---
 configure|   1 +
 libavfilter/Makefile |   4 +
 libavfilter/allfilters.c |   2 +
 libavfilter/opencl/neighbor.cl   |  87 +++
 libavfilter/opencl_source.h  |   1 +
 libavfilter/vf_neighbor_opencl.c | 327 +++
 6 files changed, 422 insertions(+)
 create mode 100644 libavfilter/opencl/neighbor.cl
 create mode 100644 libavfilter/vf_neighbor_opencl.c

diff --git a/configure b/configure
index 5783407..211f05f 100755
--- a/configure
+++ b/configure
@@ -3363,6 +3363,7 @@ mpdecimate_filter_deps="gpl"
 mpdecimate_filter_select="pixelutils"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
+neighbor_opencl_filter_deps="opencl"
 nnedi_filter_deps="gpl"
 ocr_filter_deps="libtesseract"
 ocv_filter_deps="libopencv"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 5d4549e..03df93b 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -196,6 +196,8 @@ OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
 OBJS-$(CONFIG_DESPILL_FILTER)+= vf_despill.o
 OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DILATION_FILTER)   += vf_neighbor.o
+OBJS-$(CONFIG_DILATION_OPENCL_FILTER)+= vf_neighbor_opencl.o opencl.o \
+opencl/neighbor.o
 OBJS-$(CONFIG_DISPLACE_FILTER)   += vf_displace.o framesync.o
 OBJS-$(CONFIG_DOUBLEWEAVE_FILTER)+= vf_weave.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
@@ -207,6 +209,8 @@ OBJS-$(CONFIG_ELBG_FILTER)   += vf_elbg.o
 OBJS-$(CONFIG_ENTROPY_FILTER)+= vf_entropy.o
 OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
 OBJS-$(CONFIG_EROSION_FILTER)+= vf_neighbor.o
+OBJS-$(CONFIG_EROSION_OPENCL_FILTER) += vf_neighbor_opencl.o opencl.o \
+opencl/neighbor.o
 OBJS-$(CONFIG_EXTRACTPLANES_FILTER)  += vf_extractplanes.o
 OBJS-$(CONFIG_FADE_FILTER)   += vf_fade.o
 OBJS-$(CONFIG_FFTDNOIZ_FILTER)   += vf_fftdnoiz.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 521bc53..f33129c 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -185,6 +185,7 @@ extern AVFilter ff_vf_deshake;
 extern AVFilter ff_vf_despill;
 extern AVFilter ff_vf_detelecine;
 extern AVFilter ff_vf_dilation;
+extern AVFilter ff_vf_dilation_opencl;
 extern AVFilter ff_vf_displace;
 extern AVFilter ff_vf_doubleweave;
 extern AVFilter ff_vf_drawbox;
@@ -196,6 +197,7 @@ extern AVFilter ff_vf_elbg;
 extern AVFilter ff_vf_entropy;
 extern AVFilter ff_vf_eq;
 extern AVFilter ff_vf_erosion;
+extern AVFilter ff_vf_erosion_opencl;
 extern AVFilter ff_vf_extractplanes;
 extern AVFilter ff_vf_fade;
 extern AVFilter ff_vf_fftdnoiz;
diff --git a/libavfilter/opencl/neighbor.cl b/libavfilter/opencl/neighbor.cl
new file mode 100644
index 000..2235e3e
--- /dev/null
+++ b/libavfilter/opencl/neighbor.cl
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018 Danil Iashchenko
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+__kernel void erosion_global(__write_only image2d_t dst,
+ __read_only  image2d_t src,
+ float threshold,
+ __constant int *coord)
+{
+const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
+CLK_ADDRESS_CLAMP_TO_EDGE   |
+CLK_FILTER_NEAREST);
+
+int2 loc = (int2)(get_global_id(0), get_global_id(1));
+
+float4 px = read_imagef(src, sampler, loc);
+float limit = px.x - threshold;
+if (limit < 0) {
+limit = 0;
+}
+
+for (int i = -1; i <= 1; i++) {
+for (int j = -1; j <= 1; j++) {
+if (coord[(j + 1) * 3 + (i + 1)] == 1) {
+float4 cur = read_imagef(src, sampler, loc + (int2)(i, j));
+if (cur.x < px.x) {
+px = cur;
+}
+}
+}
+}
+if (limit > px.x) {
+px = (float4)(limit);
+}

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for audio too (in case of edit lists).

2018-08-08 Thread Michael Niedermayer
On Wed, Aug 08, 2018 at 12:20:34PM -0700, Sasi Inguva wrote:
> i intended it only for audio, but i don't see any harm if it gets applied
> to subtitle tracks also .

if you want subs incldued then the commit message is wrong at least
if you dont want subs incldued the change is wrong


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

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


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


Re: [FFmpeg-devel] [PATCH]lavf/mov: Force hevc codec_id for code-point hvc1 and hvcC extradata

2018-08-08 Thread Carl Eugen Hoyos
2018-08-07 0:41 GMT+02:00, Carl Eugen Hoyos :

> Attached patch fixes ticket #7347 for me.

Patch applied.

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


Re: [FFmpeg-devel] [PATCH] avcodec/libopusenc: allow encoding channel mapping 2

2018-08-08 Thread Felicia Lim
I've attached the patch with the updated description, please let me know if
I should make any other changes.

Thanks,
Felicia


On Mon, Jul 30, 2018 at 10:50 AM Felicia Lim  wrote:

> On Sat, Jul 28, 2018 at 10:46 AM Rostislav Pehlivanov 
> wrote:
>
>> On 27 July 2018 at 20:44, Felicia Lim 
>> wrote:
>>
>> > ---
>> >  libavcodec/libopusenc.c | 22 ++
>> >  1 file changed, 22 insertions(+)
>> >
>> > diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
>> > index 4ae81b0bb2..6b450ec317 100644
>> > --- a/libavcodec/libopusenc.c
>> > +++ b/libavcodec/libopusenc.c
>> > @@ -27,6 +27,7 @@
>> >  #include "bytestream.h"
>> >  #include "internal.h"
>> >  #include "libopus.h"
>> > +#include "mathops.h"
>> >  #include "vorbis.h"
>> >  #include "audio_frame_queue.h"
>> >
>> > @@ -200,6 +201,21 @@ static int
>> libopus_check_vorbis_layout(AVCodecContext
>> > *avctx, int mapping_family
>> >  return 0;
>> >  }
>> >
>> > +static int libopus_check_ambisonics_channels(AVCodecContext *avctx) {
>> > +int channels = avctx->channels;
>> > +int ambisonic_order = ff_sqrt(channels) - 1;
>> > +if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) &&
>> > +channels != ((ambisonic_order + 1) * (ambisonic_order + 1) +
>> 2)) {
>> > +av_log(avctx, AV_LOG_ERROR,
>> > +   "Ambisonics coding is only specified for channel counts"
>> > +   " which can be written as (n + 1)^2 or (n + 1)^2 + 2"
>> > +   " for nonnegative integer n\n");
>> > +return AVERROR_INVALIDDATA;
>> > +}
>> > +
>> > +return 0;
>> > +}
>> > +
>> >  static int libopus_validate_layout_and_get_channel_map(
>> >  AVCodecContext *avctx,
>> >  int mapping_family,
>> > @@ -231,6 +247,12 @@ static int libopus_validate_layout_and_
>> > get_channel_map(
>> >  channel_map =
>> ff_vorbis_channel_layout_offsets[avctx->channels
>> > - 1];
>> >  }
>> >  break;
>> > +case 2:
>> > +ret = libopus_check_max_channels(avctx, 227);
>> > +if (ret == 0) {
>> > +ret = libopus_check_ambisonics_channels(avctx);
>> > +}
>> >
>>
>> No brackets needed, also if (ret) looks better imo.
>>
>
> Thanks for reviewing. Would this change would break with the style
> elsewhere in this function? I'm happy to change if you still think I should
> do it.
>
> I also just realized the patch description should be "Remove warning when
> trying to encode channel mapping 2": it already encodes even without this
> patch. Will send an update after the above comment is resolved.
>
>
>> Does libopus understand channel mapping 2 as ambisonics? What about the
>> libopus_generic_encoder_() API? Doesn't that need to be used to encode
>> ambisonics, like the patch by Drew did?
>>
>
> Yes, libopus also understands channel mapping 2 as ambisonics by default
> now.
>
> Ch map 2 uses the normal opus_multistream_encode(), so no further changes
> are needed. On the other hand, ch map 3 uses the new
> opus_projection_encode(), hence Drew's introduction of
> libopus_generic_encoder_() to handle the switch as needed.
>
>
> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
From 75a2470f26ea0d4c5bf8482001ce7d32212ba06f Mon Sep 17 00:00:00 2001
From: Felicia Lim 
Date: Mon, 30 Jul 2018 12:59:44 -0700
Subject: [PATCH] avcodec/libopusenc: Fix warning when encoding ambisonics with
 channel mapping 2

Also adds checks on the number of channels.
---
 libavcodec/libopusenc.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index 4ae81b0bb2..6b450ec317 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -27,6 +27,7 @@
 #include "bytestream.h"
 #include "internal.h"
 #include "libopus.h"
+#include "mathops.h"
 #include "vorbis.h"
 #include "audio_frame_queue.h"
 
@@ -200,6 +201,21 @@ static int libopus_check_vorbis_layout(AVCodecContext *avctx, int mapping_family
 return 0;
 }
 
+static int libopus_check_ambisonics_channels(AVCodecContext *avctx) {
+int channels = avctx->channels;
+int ambisonic_order = ff_sqrt(channels) - 1;
+if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) &&
+channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) {
+av_log(avctx, AV_LOG_ERROR,
+   "Ambisonics coding is only specified for channel counts"
+   " which can be written as (n + 1)^2 or (n + 1)^2 + 2"
+   " for nonnegative integer n\n");
+return AVERROR_INVALIDDATA;
+}
+
+return 0;
+}
+
 static int libopus_validate_layout_and_get_channel_map(
 AVCodecContext *avctx,
 int mapping_family,
@@ -231,6 +247,12 @@ static int libopus_validate_layout_and_get_channel_map(
 channel_map = ff_vorbis_channel_layout_offsets[avctx->channels - 1];

Re: [FFmpeg-devel] First Patch for hlsenc.c for https://trac.ffmpeg.org/ticket/7281

2018-08-08 Thread Ronak


> On Aug 8, 2018, at 3:52 PM, Ronak  wrote:
> 
> 
> 
>> On Aug 6, 2018, at 10:20 AM, Steven Liu  wrote:
>> 
>> 
>> 
>>> On Aug 6, 2018, at 19:29, Ronak Patel  
>>> wrote:
>>> 
 
 On Aug 6, 2018, at 7:19 AM, Liu Steven  wrote:
 
 
 
>> 在 2018年8月6日,下午7:12,Ronak Patel  写道:
>> 
>> 
>> On Aug 5, 2018, at 10:54 PM, Liu Steven  wrote:
>> 
>> 
>> 
>>> 在 2018年8月4日,上午2:17,Ronak  写道:
>>> 
> I have read this patch some problem for this patch.
> 
> 1. maybe there will have a problem when duration is not same when 
> every fragment, for example:
> liuqideMacBook-Pro:xxx liuqi$ ./ffmpeg -v quiet -i 
> ~/Movies/Test/bbb_sunflower_1080p_30fps_normal.mp4 -c copy -f hls 
> -hls_list_size 0 output_test.m3u8
> liuqideMacBook-Pro:xxx liuqi$ head -n 10  output_test.m3u8
> #EXTM3U
> #EXT-X-VERSION:3
> #EXT-X-TARGETDURATION:8
> #EXT-X-MEDIA-SEQUENCE:0
> #EXTINF:3.87,
> output_test0.ts
> #EXTINF:7.30,
> output_test1.ts
> #EXTINF:8.33,
> output_test2.ts
> 
> the output_test0.ts’s duration is short than output_test1.ts, the 
> #EXT-X-TARGETDURATION need update to the longest duration.
> this operation (check the longest duration) will happen at every 
> fragment write complete.
> it will not update when move the update option to the 
> hls_write_header,
> 
 
 This is a problem in the code that splits the mpegts files. I've 
 filed a separate issue for this here: 
 https://trac.ffmpeg.org/ticket/7341. Mpegts segmentation should be 
 following the hls_time parameter (or the default length).
>>> This is whatever hls_time, is decide by keyframe position, this is 
>>> happen when GOP size is not a permanent t position.
>>> 
 
 This is happening now with fMP4 assets, but not with mpegts.
>>> Whatever fmp4 or mpegts, all of them need fix the problem of 
>>> duration refresh.
>>> 
>>> for example:
>>> 
>>> liuqideMacBook-Pro:xxx liuqi$ ./ffmpeg -ss -v quiet -i 
>>> ~/Movies/Test/bbb_sunflower_1080p_30fps_normal.mp4 -c copy -f hls 
>>> -hls_list_size 0 -hls_segment_type fmp4 -hls_time 3 output_test.m3u8
>>> liuqideMacBook-Pro:xxx liuqi$ head -n 10  output_test.m3u8
>>> #EXTM3U
>>> #EXT-X-VERSION:7
>>> #EXT-X-TARGETDURATION:8
>>> #EXT-X-MEDIA-SEQUENCE:0
>>> #EXT-X-MAP:URI="init.mp4"
>>> #EXTINF:3.87,
>>> output_test0.m4s
>>> #EXTINF:7.30,
>>> output_test1.m4s
>>> #EXTINF:8.33,
>>> liuqideMacBook-Pro:xxx liuqi$
>> 
>> This is after your patch:
>> liuqideMacBook-Pro:xxx liuqi$  ./ffmpeg -ss 17 -v quiet -i 
>> ~/Movies/Test/bbb_sunflower_1080p_30fps_normal.mp4 -c copy -f hls 
>> -hls_list_size 0 -hls_segment_type fmp4 -hls_time 3 output_test.m3u8
>> liuqideMacBook-Pro:xxx liuqi$ head -n 10  output_test.m3u8
>> #EXTM3U
>> #EXT-X-VERSION:7
>> #EXT-X-TARGETDURATION:3
>> #EXT-X-MEDIA-SEQUENCE:0
>> #EXT-X-MAP:URI="init.mp4"
>> #EXTINF:3.87,
>> output_test0.m4s
>> #EXTINF:7.30,
>> output_test1.m4s
>> #EXTINF:8.33,
>> 
>> The RFC https://www.rfc-editor.org/rfc/rfc8216.txt describe:
>> 
>> 4.3.3.1.  EXT-X-TARGETDURATION
>> 
>> The EXT-X-TARGETDURATION tag specifies the maximum Media Segment
>> duration.  The EXTINF duration of each Media Segment in the Playlist
>> file, when rounded to the nearest integer, MUST be less than or equal
>> to the target duration; longer segments can trigger playback stalls
>> or other errors.  It applies to the entire Playlist file.  Its format
>> is:
>> 
>> #EXT-X-TARGETDURATION:
>> 
>> where s is a decimal-integer indicating the target duration in
>> seconds.  The EXT-X-TARGETDURATION tag is REQUIRED.
>> 
>> your patch make the EXT-X-TARGETDURATION less than EXTINF:7.30 
>> EXTINF:8.33
> 
> 
> 2. the version maybe will update when use hls_segment_type or 
> append_list etc. when the operation is support from different 
> version m3u8.
 
 I don't follow what you mean here. The version number is known up 
 front, based on the options that were passed in. It should be 
 illegal to switch between versions when trying to update an 
 existing manifest. When can this legitimately 

Re: [FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for un-free memory - bug # 7338

2018-08-08 Thread Carl Eugen Hoyos
2018-08-08 19:27 GMT+02:00, Colin NG :
> ---
>  libavformat/dashdec.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 09b06ef..5730252 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -1879,7 +1879,6 @@ static int is_common_init_section_exist(struct
> representation **pls, int n_pls)
>
>  static void copy_init_section(struct representation *rep_dest, struct
> representation *rep_src)
>  {
> -*rep_dest->init_section = *rep_src->init_section;

Patch applied.

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


Re: [FFmpeg-devel] [PATCH] lavfi/vf_libvmaf: update to use libvmaf v1.3.9

2018-08-08 Thread Carl Eugen Hoyos
2018-08-08 5:02 GMT+02:00, James Almer :

> It would be ideal if this library could stop breaking the API so often.

Not that I care much but don't we have a requirement
for external libs to have a stable api?

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


Re: [FFmpeg-devel] First Patch for hlsenc.c for https://trac.ffmpeg.org/ticket/7281

2018-08-08 Thread Ronak


> On Aug 6, 2018, at 10:20 AM, Steven Liu  wrote:
> 
> 
> 
>> On Aug 6, 2018, at 19:29, Ronak Patel  
>> wrote:
>> 
>>> 
>>> On Aug 6, 2018, at 7:19 AM, Liu Steven  wrote:
>>> 
>>> 
>>> 
> 在 2018年8月6日,下午7:12,Ronak Patel  写道:
> 
> 
> On Aug 5, 2018, at 10:54 PM, Liu Steven  wrote:
> 
> 
> 
>> 在 2018年8月4日,上午2:17,Ronak  写道:
>> 
 I have read this patch some problem for this patch.
 
 1. maybe there will have a problem when duration is not same when 
 every fragment, for example:
 liuqideMacBook-Pro:xxx liuqi$ ./ffmpeg -v quiet -i 
 ~/Movies/Test/bbb_sunflower_1080p_30fps_normal.mp4 -c copy -f hls 
 -hls_list_size 0 output_test.m3u8
 liuqideMacBook-Pro:xxx liuqi$ head -n 10  output_test.m3u8
 #EXTM3U
 #EXT-X-VERSION:3
 #EXT-X-TARGETDURATION:8
 #EXT-X-MEDIA-SEQUENCE:0
 #EXTINF:3.87,
 output_test0.ts
 #EXTINF:7.30,
 output_test1.ts
 #EXTINF:8.33,
 output_test2.ts
 
 the output_test0.ts’s duration is short than output_test1.ts, the 
 #EXT-X-TARGETDURATION need update to the longest duration.
 this operation (check the longest duration) will happen at every 
 fragment write complete.
 it will not update when move the update option to the 
 hls_write_header,
 
>>> 
>>> This is a problem in the code that splits the mpegts files. I've 
>>> filed a separate issue for this here: 
>>> https://trac.ffmpeg.org/ticket/7341. Mpegts segmentation should be 
>>> following the hls_time parameter (or the default length).
>> This is whatever hls_time, is decide by keyframe position, this is 
>> happen when GOP size is not a permanent t position.
>> 
>>> 
>>> This is happening now with fMP4 assets, but not with mpegts.
>> Whatever fmp4 or mpegts, all of them need fix the problem of 
>> duration refresh.
>> 
>> for example:
>> 
>> liuqideMacBook-Pro:xxx liuqi$ ./ffmpeg -ss -v quiet -i 
>> ~/Movies/Test/bbb_sunflower_1080p_30fps_normal.mp4 -c copy -f hls 
>> -hls_list_size 0 -hls_segment_type fmp4 -hls_time 3 output_test.m3u8
>> liuqideMacBook-Pro:xxx liuqi$ head -n 10  output_test.m3u8
>> #EXTM3U
>> #EXT-X-VERSION:7
>> #EXT-X-TARGETDURATION:8
>> #EXT-X-MEDIA-SEQUENCE:0
>> #EXT-X-MAP:URI="init.mp4"
>> #EXTINF:3.87,
>> output_test0.m4s
>> #EXTINF:7.30,
>> output_test1.m4s
>> #EXTINF:8.33,
>> liuqideMacBook-Pro:xxx liuqi$
> 
> This is after your patch:
> liuqideMacBook-Pro:xxx liuqi$  ./ffmpeg -ss 17 -v quiet -i 
> ~/Movies/Test/bbb_sunflower_1080p_30fps_normal.mp4 -c copy -f hls 
> -hls_list_size 0 -hls_segment_type fmp4 -hls_time 3 output_test.m3u8
> liuqideMacBook-Pro:xxx liuqi$ head -n 10  output_test.m3u8
> #EXTM3U
> #EXT-X-VERSION:7
> #EXT-X-TARGETDURATION:3
> #EXT-X-MEDIA-SEQUENCE:0
> #EXT-X-MAP:URI="init.mp4"
> #EXTINF:3.87,
> output_test0.m4s
> #EXTINF:7.30,
> output_test1.m4s
> #EXTINF:8.33,
> 
> The RFC https://www.rfc-editor.org/rfc/rfc8216.txt describe:
> 
> 4.3.3.1.  EXT-X-TARGETDURATION
> 
> The EXT-X-TARGETDURATION tag specifies the maximum Media Segment
> duration.  The EXTINF duration of each Media Segment in the Playlist
> file, when rounded to the nearest integer, MUST be less than or equal
> to the target duration; longer segments can trigger playback stalls
> or other errors.  It applies to the entire Playlist file.  Its format
> is:
> 
> #EXT-X-TARGETDURATION:
> 
> where s is a decimal-integer indicating the target duration in
> seconds.  The EXT-X-TARGETDURATION tag is REQUIRED.
> 
> your patch make the EXT-X-TARGETDURATION less than EXTINF:7.30 
> EXTINF:8.33
 
 
 2. the version maybe will update when use hls_segment_type or 
 append_list etc. when the operation is support from different 
 version m3u8.
>>> 
>>> I don't follow what you mean here. The version number is known up 
>>> front, based on the options that were passed in. It should be 
>>> illegal to switch between versions when trying to update an 
>>> existing manifest. When can this legitimately happen?
>> there maybe have some player cannot support high version of m3u8, 
>> for example old parser or player just support the VERSION 3,
>> this 

Re: [FFmpeg-devel] [PATCH] lavfi: update xbr filter url

2018-08-08 Thread Thilo Borgmann
Am 08.08.18 um 21:49 schrieb Mina:
> From 1193d48dfbb572ebbe5e3849950079f0af5765ed Mon Sep 17 00:00:00 2001
> From: Mina 
> Date: Wed, 8 Aug 2018 21:43:18 +0200
> Subject: [PATCH] lavfi: update xbr filter url
> 
> Signed-off-by: Mina 
> ---
>  doc/filters.texi | 2 +-
>  libavfilter/vf_xbr.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

LGTM

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


[FFmpeg-devel] [PATCH] lavfi: update xbr filter url

2018-08-08 Thread Mina

Hi,

  While adding documentation in doc/filters.texi as part of [GSOC]Color 
Constancy Filter project, I found the url for xbr filter giving an 
internal server error. After some search I found another link where the 
author of the filter(and algorithm) posts a tutorial for the algorithm. 
This patch update the existing url with the newly found one.


Thanks,
Mina

>From 1193d48dfbb572ebbe5e3849950079f0af5765ed Mon Sep 17 00:00:00 2001
From: Mina 
Date: Wed, 8 Aug 2018 21:43:18 +0200
Subject: [PATCH] lavfi: update xbr filter url

Signed-off-by: Mina 
---
 doc/filters.texi | 2 +-
 libavfilter/vf_xbr.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 0b0903e5a7..792edfd2e1 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -17148,7 +17148,7 @@ separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
 @section xbr
 Apply the xBR high-quality magnification filter which is designed for pixel
 art. It follows a set of edge-detection rules, see
-@url{http://www.libretro.com/forums/viewtopic.php?f=6=134}.
+@url{https://forums.libretro.com/t/xbr-algorithm-tutorial/123}.
 
 It accepts the following option:
 
diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c
index 78094e0287..2c71871d22 100644
--- a/libavfilter/vf_xbr.c
+++ b/libavfilter/vf_xbr.c
@@ -24,7 +24,7 @@
  * XBR Filter is used for depixelization of image.
  * This is based on Hyllian's xBR shader.
  *
- * @see http://www.libretro.com/forums/viewtopic.php?f=6=134
+ * @see https://forums.libretro.com/t/xbr-algorithm-tutorial/123
  * @see https://github.com/yoyofr/iFBA/blob/master/fba_src/src/intf/video/scalers/xbr.cpp
  */
 
-- 
2.17.0

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


Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for audio too (in case of edit lists).

2018-08-08 Thread Sasi Inguva
i intended it only for audio, but i don't see any harm if it gets applied
to subtitle tracks also .

On Tue, Aug 7, 2018 at 3:23 PM Michael Niedermayer 
wrote:

> On Mon, Aug 06, 2018 at 04:32:29PM -0700, isasi-at-google@ffmpeg.org
> wrote:
> > From: Sasi Inguva 
> >
> > Fixes vorbis mp4 audio files, with edit list specified. Since
> > st->skip_samples is not set in case of vorbis , ffmpeg computes the
> > start_time as negative.
> >
> > Signed-off-by: Sasi Inguva 
> > ---
> >  libavformat/mov.c  | 4 ++--
> >  tests/fate/mov.mak | 5 +
> >  tests/ref/fate/mov-neg-firstpts-discard-vorbis | 3 +++
> >  3 files changed, 10 insertions(+), 2 deletions(-)
> >  create mode 100644 tests/ref/fate/mov-neg-firstpts-discard-vorbis
>
> The commit message speaks of audio, this changes subtitles too
> is this intended ?
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I have often repented speaking, but never of holding my tongue.
> -- Xenocrates
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/dashdec: Add a re-entrance check point after an interrupt operation

2018-08-08 Thread Colin NG
---
 libavformat/dashdec.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 5730252..310dc20 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1764,6 +1764,12 @@ static int reopen_demux_for_component(AVFormatContext 
*s, struct representation
 if (pls->ctx) {
 close_demux_for_component(pls);
 }
+
+if (ff_check_interrupt(>interrupt_callback)) {
+ret = AVERROR_EXIT;
+goto fail;
+}
+
 if (!(pls->ctx = avformat_alloc_context())) {
 ret = AVERROR(ENOMEM);
 goto fail;
-- 
2.7.4

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


[FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for un-free memory - bug # 7338

2018-08-08 Thread Colin NG
---
 libavformat/dashdec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 09b06ef..5730252 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1879,7 +1879,6 @@ static int is_common_init_section_exist(struct 
representation **pls, int n_pls)
 
 static void copy_init_section(struct representation *rep_dest, struct 
representation *rep_src)
 {
-*rep_dest->init_section = *rep_src->init_section;
 rep_dest->init_sec_buf = av_mallocz(rep_src->init_sec_buf_size);
 memcpy(rep_dest->init_sec_buf, rep_src->init_sec_buf, 
rep_src->init_sec_data_len);
 rep_dest->init_sec_buf_size = rep_src->init_sec_buf_size;
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add quality status to side_data

2018-08-08 Thread James Almer
On 8/8/2018 11:51 AM, Zhong Li wrote:
> Add fix a memory leak issue as James's comments.
> 
> Signed-off-by: Zhong Li 
> ---
>  libavcodec/qsvenc.c  | 18 ++
>  libavcodec/qsvenc_h264.c |  5 -
>  2 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index 65dae31..2107c5b 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -1200,8 +1200,10 @@ static int encode_frame(AVCodecContext *avctx, 
> QSVEncContext *q,
>  if (!sync) {
>  av_freep();
>   #if QSV_VERSION_ATLEAST(1, 26)
> -if (avctx->codec_id == AV_CODEC_ID_H264)
> +if (avctx->codec_id == AV_CODEC_ID_H264) {
>  av_freep(_info);
> +av_freep(_buf);
> +}
>   #endif
>  av_packet_unref(_pkt);
>  return AVERROR(ENOMEM);
> @@ -1220,8 +1222,10 @@ static int encode_frame(AVCodecContext *avctx, 
> QSVEncContext *q,
>  av_packet_unref(_pkt);
>  av_freep();
>  #if QSV_VERSION_ATLEAST(1, 26)
> -if (avctx->codec_id == AV_CODEC_ID_H264)
> +if (avctx->codec_id == AV_CODEC_ID_H264) {
>  av_freep(_info);
> +av_freep(_buf);
> +}
>  #endif
>  av_freep();
>  return (ret == MFX_ERR_MORE_DATA) ?
> @@ -1240,8 +1244,10 @@ static int encode_frame(AVCodecContext *avctx, 
> QSVEncContext *q,
>  av_packet_unref(_pkt);
>  av_freep();
>  #if QSV_VERSION_ATLEAST(1, 26)
> -if (avctx->codec_id == AV_CODEC_ID_H264)
> +if (avctx->codec_id == AV_CODEC_ID_H264) {
>  av_freep(_info);
> +av_freep(_buf);
> +}
>  #endif
>  }
>  
> @@ -1264,6 +1270,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext 
> *q,
>  mfxSyncPoint *sync;
>  #if QSV_VERSION_ATLEAST(1, 26)
>  mfxExtAVCEncodedFrameInfo *enc_info;
> +mfxExtBuffer **enc_buf;
>  #endif
>  
>  av_fifo_generic_read(q->async_fifo, _pkt, sizeof(new_pkt), NULL);
> @@ -1295,10 +1302,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  
>  #if QSV_VERSION_ATLEAST(1, 26)
>  if (avctx->codec_id == AV_CODEC_ID_H264) {
> +enc_buf = bs->ExtParam;
>  enc_info = (mfxExtAVCEncodedFrameInfo *)(*bs->ExtParam);
> -av_log(avctx, AV_LOG_DEBUG, "QP is %d\n", enc_info->QP);
> +ff_side_data_set_encoder_stats(_pkt,
> +enc_info->QP * FF_QP2LAMBDA, NULL, 0, 
> avctx->coded_frame->pict_type);

This will generate a deprecated warning and will need to be changed once
coded_frame is removed.

Add a local pict_type variable instead and set it using the existing
checks. Then use it here and to set avctx->coded_frame->pict_type.

>  q->sum_frame_qp += enc_info->QP;

This is unused now that you removed the log message below.

>  av_freep(_info);
> +av_freep(_buf);
>  }
>  #endif
>  av_freep();
> diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
> index b87bef6..5c262e5 100644
> --- a/libavcodec/qsvenc_h264.c
> +++ b/libavcodec/qsvenc_h264.c
> @@ -95,11 +95,6 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)
>  {
>  QSVH264EncContext *q = avctx->priv_data;
>  
> -#if QSV_VERSION_ATLEAST(1, 26)
> -av_log(avctx, AV_LOG_VERBOSE, "encoded %d frames, avarge qp is %.2f\n",
> -avctx->frame_number,(double)q->qsv.sum_frame_qp / 
> avctx->frame_number);
> -#endif
> -
>  return ff_qsv_enc_close(avctx, >qsv);
>  }
>  
> 

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


[FFmpeg-devel] [PATCH] lavc/qsvenc: add quality status to side_data

2018-08-08 Thread Zhong Li
Add fix a memory leak issue as James's comments.

Signed-off-by: Zhong Li 
---
 libavcodec/qsvenc.c  | 18 ++
 libavcodec/qsvenc_h264.c |  5 -
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 65dae31..2107c5b 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1200,8 +1200,10 @@ static int encode_frame(AVCodecContext *avctx, 
QSVEncContext *q,
 if (!sync) {
 av_freep();
  #if QSV_VERSION_ATLEAST(1, 26)
-if (avctx->codec_id == AV_CODEC_ID_H264)
+if (avctx->codec_id == AV_CODEC_ID_H264) {
 av_freep(_info);
+av_freep(_buf);
+}
  #endif
 av_packet_unref(_pkt);
 return AVERROR(ENOMEM);
@@ -1220,8 +1222,10 @@ static int encode_frame(AVCodecContext *avctx, 
QSVEncContext *q,
 av_packet_unref(_pkt);
 av_freep();
 #if QSV_VERSION_ATLEAST(1, 26)
-if (avctx->codec_id == AV_CODEC_ID_H264)
+if (avctx->codec_id == AV_CODEC_ID_H264) {
 av_freep(_info);
+av_freep(_buf);
+}
 #endif
 av_freep();
 return (ret == MFX_ERR_MORE_DATA) ?
@@ -1240,8 +1244,10 @@ static int encode_frame(AVCodecContext *avctx, 
QSVEncContext *q,
 av_packet_unref(_pkt);
 av_freep();
 #if QSV_VERSION_ATLEAST(1, 26)
-if (avctx->codec_id == AV_CODEC_ID_H264)
+if (avctx->codec_id == AV_CODEC_ID_H264) {
 av_freep(_info);
+av_freep(_buf);
+}
 #endif
 }
 
@@ -1264,6 +1270,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
 mfxSyncPoint *sync;
 #if QSV_VERSION_ATLEAST(1, 26)
 mfxExtAVCEncodedFrameInfo *enc_info;
+mfxExtBuffer **enc_buf;
 #endif
 
 av_fifo_generic_read(q->async_fifo, _pkt, sizeof(new_pkt), NULL);
@@ -1295,10 +1302,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
 #if QSV_VERSION_ATLEAST(1, 26)
 if (avctx->codec_id == AV_CODEC_ID_H264) {
+enc_buf = bs->ExtParam;
 enc_info = (mfxExtAVCEncodedFrameInfo *)(*bs->ExtParam);
-av_log(avctx, AV_LOG_DEBUG, "QP is %d\n", enc_info->QP);
+ff_side_data_set_encoder_stats(_pkt,
+enc_info->QP * FF_QP2LAMBDA, NULL, 0, 
avctx->coded_frame->pict_type);
 q->sum_frame_qp += enc_info->QP;
 av_freep(_info);
+av_freep(_buf);
 }
 #endif
 av_freep();
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index b87bef6..5c262e5 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -95,11 +95,6 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)
 {
 QSVH264EncContext *q = avctx->priv_data;
 
-#if QSV_VERSION_ATLEAST(1, 26)
-av_log(avctx, AV_LOG_VERBOSE, "encoded %d frames, avarge qp is %.2f\n",
-avctx->frame_number,(double)q->qsv.sum_frame_qp / avctx->frame_number);
-#endif
-
 return ff_qsv_enc_close(avctx, >qsv);
 }
 
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.

2018-08-08 Thread James Almer
On 8/8/2018 7:56 AM, Jun Zhao wrote:
> add add ONLY_IF_THREADS_ENABLED where it is missing.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavcodec/hevcdec.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 409e77f..fec9218 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -3529,8 +3529,8 @@ AVCodec ff_hevc_decoder = {
>  .close = hevc_decode_free,
>  .decode= hevc_decode_frame,
>  .flush = hevc_decode_flush,
> -.update_thread_context = hevc_update_thread_context,
> -.init_thread_copy  = hevc_init_thread_copy,
> +.update_thread_context = 
> ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
> +.init_thread_copy  = ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
>  .capabilities  = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
>   AV_CODEC_CAP_SLICE_THREADS | 
> AV_CODEC_CAP_FRAME_THREADS,
>  .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | 
> FF_CODEC_CAP_EXPORTS_CROPPING,

You should also wrap the two functions in question with HAVE_THREADS checks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.

2018-08-08 Thread Jun Zhao
add add ONLY_IF_THREADS_ENABLED where it is missing.

Signed-off-by: Jun Zhao 
---
 libavcodec/hevcdec.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 409e77f..fec9218 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3529,8 +3529,8 @@ AVCodec ff_hevc_decoder = {
 .close = hevc_decode_free,
 .decode= hevc_decode_frame,
 .flush = hevc_decode_flush,
-.update_thread_context = hevc_update_thread_context,
-.init_thread_copy  = hevc_init_thread_copy,
+.update_thread_context = 
ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
+.init_thread_copy  = ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
 .capabilities  = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
  AV_CODEC_CAP_SLICE_THREADS | 
AV_CODEC_CAP_FRAME_THREADS,
 .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | 
FF_CODEC_CAP_EXPORTS_CROPPING,
-- 
1.7.1

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


Re: [FFmpeg-devel] [PATCH] Fixed incorrect timestamps and initialization issues in transcoding.c example.

2018-08-08 Thread Michael Niedermayer
On Tue, Jul 24, 2018 at 10:18:17PM +, Brian C. Wiles wrote:
> ---
>  doc/examples/transcoding.c | 10 +-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 

[...]

> @@ -517,6 +518,11 @@ int main(int argc, char **argv)
>  return 1;
>  }
>  
> +av_register_all();
> +avcodec_register_all();
> +avfilter_register_all();

These are deprecated functions

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

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


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


Re: [FFmpeg-devel] [PATCH] aadec: alternate mp3 seek handling

2018-08-08 Thread Karsten Otto
Ping. Any thoughts on this?

Cheers, Karsten

> Am 31.07.2018 um 21:16 schrieb Karsten Otto :
> 
> After seeking, determine the offset of the next frame in the decrypted
> buffer by scanning the first few bytes for a valid mp3 header.
> This significantly improves the listening experience for audio content
> with untypical encoding.
> ---
> This is a refinement of an earlier patch iteration, according to lessons
> learned and discussions on the mailing list: Scan a limited range to find
> the first shifted frame only, check for a very specific bit pattern, and
> add extra checks and guards for better code maintainability.
> 
> Unfortunately, this variant violates the architectural layering between
> demuxer and codec. But I did some more testing with untypical encodings,
> where the current estimation mechanism fails, and the resulting audio on
> seek was just too horribly annoying.
> 
> I believe the better listening experience outweighs the architectural
> uglyness, so this should be in the official code base. But if you think
> otherwise, just let me know, and I will keep this a private patch.
> 
> libavformat/aadec.c | 45 -
> 1 file changed, 28 insertions(+), 17 deletions(-)
> 
> diff --git a/libavformat/aadec.c b/libavformat/aadec.c
> index d83f283ffe..9b1495c218 100644
> --- a/libavformat/aadec.c
> +++ b/libavformat/aadec.c
> @@ -37,7 +37,7 @@
> #define TEA_BLOCK_SIZE 8
> #define CHAPTER_HEADER_SIZE 8
> #define TIMEPREC 1000
> -#define MP3_FRAME_SIZE 104
> +#define MP3_FRAME_SIZE 105
> 
> typedef struct AADemuxContext {
> AVClass *class;
> @@ -51,7 +51,7 @@ typedef struct AADemuxContext {
> int64_t current_chapter_size;
> int64_t content_start;
> int64_t content_end;
> -int seek_offset;
> +int did_seek;
> } AADemuxContext;
> 
> static int get_second_size(char *codec_name)
> @@ -179,7 +179,7 @@ static int aa_read_header(AVFormatContext *s)
> st->codecpar->sample_rate = 22050;
> st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
> avpriv_set_pts_info(st, 64, 8, 32000 * TIMEPREC);
> -// encoded audio frame is MP3_FRAME_SIZE bytes (+1 with padding, 
> unlikely)
> +// encoded audio frame is MP3_FRAME_SIZE bytes (-1 without padding)
> } else if (!strcmp(codec_name, "acelp85")) {
> st->codecpar->codec_id = AV_CODEC_ID_SIPR;
> st->codecpar->block_align = 19;
> @@ -231,7 +231,7 @@ static int aa_read_header(AVFormatContext *s)
> ff_update_cur_dts(s, st, 0);
> avio_seek(pb, start, SEEK_SET);
> c->current_chapter_size = 0;
> -c->seek_offset = 0;
> +c->did_seek = 0;
> 
> return 0;
> }
> @@ -244,7 +244,7 @@ static int aa_read_packet(AVFormatContext *s, AVPacket 
> *pkt)
> int trailing_bytes;
> int blocks;
> uint8_t buf[MAX_CODEC_SECOND_SIZE * 2];
> -int written = 0;
> +int written = 0, offset = 0;
> int ret;
> AADemuxContext *c = s->priv_data;
> uint64_t pos = avio_tell(s->pb);
> @@ -297,16 +297,33 @@ static int aa_read_packet(AVFormatContext *s, AVPacket 
> *pkt)
> if (c->current_chapter_size <= 0)
> c->current_chapter_size = 0;
> 
> -if (c->seek_offset > written)
> -c->seek_offset = 0; // ignore wrong estimate
> +if (c->did_seek) {
> +c->did_seek = 0;
> +
> +if (s->streams[0]->codecpar->codec_id == AV_CODEC_ID_MP3 && written 
> >= MP3_FRAME_SIZE + 3) {
> +for (offset = 0; offset < MP3_FRAME_SIZE; ++offset) {
> +// find mp3 header: sync, v2, layer3, no crc, 32kbps, 22kHz, 
> mono
> +if ((buf[offset + 0]   ) == 0xff &&
> +(buf[offset + 1]   ) == 0xf3 &&
> +(buf[offset + 2] & 0xfc) == 0x40 &&
> +(buf[offset + 3] & 0xf0) == 0xc0)
> +break;
> +}
> +if (offset == MP3_FRAME_SIZE) offset = 0; // not found, just use 
> as is
> +}
> +
> +ff_update_cur_dts(s, s->streams[0],
> +(pos + offset - c->content_start - CHAPTER_HEADER_SIZE * 
> (c->chapter_idx - 1))
> +* TIMEPREC);
> +}
> 
> -ret = av_new_packet(pkt, written - c->seek_offset);
> +if (offset > written) offset = 0;
> +ret = av_new_packet(pkt, written - offset);
> if (ret < 0)
> return ret;
> -memcpy(pkt->data, buf + c->seek_offset, written - c->seek_offset);
> +memcpy(pkt->data, buf + offset, written - offset);
> pkt->pos = pos;
> 
> -c->seek_offset = 0;
> return 0;
> }
> 
> @@ -349,13 +366,7 @@ static int aa_read_seek(AVFormatContext *s,
> c->current_codec_second_size = c->codec_second_size;
> c->current_chapter_size = chapter_size - chapter_pos;
> c->chapter_idx = 1 + chapter_idx;
> -
> -// for unaligned frames, estimate offset of first frame in block (assume 
> no padding)
> -if (s->streams[0]->codecpar->codec_id == AV_CODEC_ID_MP3) {
> -c->seek_offset = (MP3_FRAME_SIZE - 

Re: [FFmpeg-devel] +R on channel

2018-08-08 Thread Dominik 'Rathann' Mierzejewski
On Wednesday, 08 August 2018 at 09:48, Gagandeep Singh wrote:
> Hi,
> I have been working on cineform under GSOC and recently due to the spam the
> irc has restricted unregistered users and I can't send the message on irc.
> Please advise on what I need to do to continue on the channel.

Register your nick:
https://freenode.net/kb/answer/registration

Regards,
Dominik
-- 
Fedora   https://getfedora.org  |  RPMFusion   http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/dashdec: Support negative value of the @r attrbute of S in SegmentTimeline element

2018-08-08 Thread Moritz Barsnick
On Mon, Aug 06, 2018 at 19:18:27 -0700, sanil wrote:
> The following patch supports parsing negative value of the @r attribute of S 
> in SegmentTimeline element.
> 
> Example streams:
> 1. http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/1/MultiRate.mpd
> 2. http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd

I can confirm that the patch makes these streams (seem to) work, albeit
with one warning message:
[dash @ 0xba72680] Could not read complete fragment.

But, for one, your patch doesn't apply to master anymore, due to recent
changes. That's due to this change:

> @@ -1952,7 +1964,7 @@ static int dash_read_header(AVFormatContext *s)
>  ++stream_index;
>  }
>  
> -  c->is_init_section_common_audio = is_common_init_section_exist(c->audios, 
> c->n_audios);
> +c->is_init_section_common_audio = 
> is_common_init_section_exist(c->audios, c->n_audios);
>  
>  for (i = 0; i < c->n_audios; i++) {
>  struct representation *cur_audio = c->audios[i];

While this indentation fix is correct, it doesn't belong into a
functional fix patch. And it's not required anymore anyway, since
commit 2f45378ba14417cbb4fc9494ba941cb06443c4f9.

Furthermore:

>  num = pls->first_seq_no + pls->n_timelines - 1;
> -for (i = 0; i < pls->n_timelines; i++) {
> -num += pls->timelines[i]->repeat;
> + for (i = 0; i < pls->n_timelines; i++) {
> +if (pls->timelines[i]->repeat == -1) {

This also changes indentation, but incorrectly.

> +int length_of_each_segment = 
> pls->timelines[i]->duration/pls->fragment_timescale;
> +num =  c->period_duration/length_of_each_segment;

Operators are surrounded by spaces, e.g. "pls->timelines[i]->duration / 
pls->fragment_timescale".

>  }
> +
>  } else if (c->is_live && pls->fragment_duration) {

And here you're adding an empty line, which you also shouldn't do.

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


[FFmpeg-devel] +R on channel

2018-08-08 Thread Gagandeep Singh
Hi,
I have been working on cineform under GSOC and recently due to the spam the
irc has restricted unregistered users and I can't send the message on irc.
Please advise on what I need to do to continue on the channel.

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