Re: [FFmpeg-devel] [PATCH] libavfilter/vf_drawtext: Avoid undefined behavior from GET_UTF8
Can I get a review on this. Anywhere we have code calling out and performing undefined behavior we should clean that up. Aaron On Sat, Jul 27, 2019 at 7:58 AM Aaron Boushley wrote: > > The vf_drawtext filter uses the GET_UTF8 macro in multiple locations. > Each of these use `continue;` as the error handler. However the > documentation for the GET_UTF8 macro states "ERROR should not contain > a loop control statement which could interact with the internal while > loop, and should force an exit from the macro code (e.g. through a > goto or a return) in order to prevent undefined results." > > This patch adjusts vf_drawtext to use goto error handlers similar to > other locations in ffmpeg. > > Aaron > > PS Sorry for having to send again, sent from the wrong address last > time, so patchwork didn't pick it up. > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] rtsp: fix wrong codec setup for some sdp
Sorry about this. At first I commit with git format-patch & send-email on my desktop but it was discarded because I didn't subcribe to devel mailing list. After join the ml I forwarded the mail on mobile gmail which might cause the extra newline mess. What should I do now? git send-email commit the same patch again? 2019년 9월 8일 (일) 오전 4:28, Michael Niedermayer 님이 작성: > On Sat, Sep 07, 2019 at 07:23:13PM +0900, Hyun Yoo wrote: > > From: Hyun Yoo > > > > rtsp_st->sdp_payload_type is the first codec in 'm=' tag > > st->codecpar->id is the first supported codec in 'a=' tag > > the two is not guaranteed to be same for example when > > 1) the order between attributes is random(rfc4566 doesn't force it) > > 2) the first codec is same for 'm=' and 'a=' but it is unsupported codec > >then st->codecpar->id will be the next one in 'a='(if it's supported) > > > > Signed-off-by: EaseTheWorld > > --- > > libavformat/rtsp.c | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c > > index c153cac88b..be3002690e 100644 > > --- a/libavformat/rtsp.c > > +++ b/libavformat/rtsp.c > > @@ -569,6 +569,9 @@ static void sdp_parse_line(AVFormatContext *s, > > SDPParseState *s1, > > get_word(buf1, sizeof(buf1), &p); > > payload_type = atoi(buf1); > > rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; > > +// parse only sdp_payload_type specified in 'm=' tag > > +if (rtsp_st->sdp_payload_type != payload_type) > > +return; > > if (rtsp_st->stream_index >= 0) { > > st = s->streams[rtsp_st->stream_index]; > > sdp_parse_rtpmap(s, st, rtsp_st, payload_type, p); > > @@ -582,6 +585,10 @@ static void sdp_parse_line(AVFormatContext *s, > > SDPParseState *s1, > > Applying: rtsp: fix wrong codec setup for some sdp > error: corrupt patch at line 10 > > there are extra newlines in the patch ... > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > If you fake or manipulate statistics in a paper in physics you will never > get a job again. > If you fake or manipulate statistics in a paper in medicin you will get > a job for life at the pharma industry. > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2 1/2] avfilter/vf_scale: split the scale_frame function from filter_frame for activate function support
On Sat, Sep 07, 2019 at 11:11:25PM +0800, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavfilter/vf_scale.c | 26 ++ > 1 file changed, 22 insertions(+), 4 deletions(-) will apply [...] -- 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 https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v1] avformat/movenc: split empty text sample when duration overflow
Hi, On Sun, Sep 8, 2019 at 12:28 AM Jun Li wrote: > Some details: > Current implementation will insert one empty sample whenever there is a gap > between two captions lines. But when the gap's duration is way too big, the > sample's duration will exceed MP4's limitation, thus mov muxer will fail on > function check_pkt. > > This patch is to guarantee that, every empty samples' duration not exceed > INT_MAX-1, and insert multiple ones when the gap is bigger than INT_MAX-1. > For the record, I recently hit this check as well when working on TTML-in-MP4 (which basically requires a *single* sample for a document/fragment - and thus getting packets with durations of a whole ~40min movie made this happen really easy). Now, I think this check of INT_MAX is not necessarily 100% correct (but I'd have to consult both qtff spec as well as ISOBMFF spec for that, as well as make sure that the relevant variables are big enough), but I think the bigger issue right now is that with ffmpeg.c for subtitle streams we currently seem to set a time base of 1:100 for the AVStream. We might need to think about setting a smaller default time base for subtitle formats in the future. That said, while I would be against poking at subtitle packets pushed to us - if we're splitting just the empty samples I think that is not a bad thing since the empty samples are in any case generated by us. Will take a look at the patch after I've rested somewhat. I think if we're enshrining INT_MAX as the maximum duration then I think it might make sense to start #defining that so that it's clearer where our definition of max packet duration is meant (and if we ever want to change it or improve the logic of it, that could then be done in a single place). > Test results: > Fate test passed. Also tested with following SRT file with cmd: > > ffmpeg -i input.mp4 -i input.srt -c copy -c:s mov_text test.mp4 -y > > I used Apple's QuickTime player, confirmed that the caption shows up at the > correct time. > > "input. srt" as follows > 1 > 00:35:47.484 --> 00:35:50.000 > Durations that exceed the signed > int max value break the program > > 2 > 00:40:47.484 --> 00:40:50.000 > Durations2 that exceed the signed > int max value break the program > > 3 > 00:50:47.484 --> 00:50:50.000 > Durations3 that exceed the signed > int max value break the program > > 4 > 02:50:47.484 --> 02:50:50.000 > Durations4 that exceed the signed > int max value break the program > > 5 > 03:50:47.484 --> 03:50:50.000 > Durations5 that exceed the signed > int max value break the program I think something like this could be added to FATE with an explicit time_base and not (where one example would split and another would not). Best regards, Jan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avformat/avformat: Introduced `AVInputFormat.read_timestamp2` to fix keyframe seeking for formats that rely on `read_timestamp` for seeking
I think I understand some of what you are saying. You are saying that after the bisection, continuously step backwards + read forward while doubling the step size until the keyframe is found? Some questions: - What is the difference between the lowercase k and the uppercase K in your diagram? And to make sure I didn’t misunderstand, v is the result of the bisection and A/B/C indicate the steps? - Why after finding the keyframe in step C, is there an extra -->? - Re: “there is code somewhere in git to do something similar already”, do you have an idea of what I should search for to find this code? Thanks! > On Sep 3, 2019, at 4:39 AM, Michael Niedermayer > wrote: > > stepwise searching for the keyframe in forward direction while taking steps > backward > ..k.K.v-start > A---> >B---> >C>k-K--> > > there is code somewhere in git to do something similar already > this should be faster than always searching for keyframes during bisection as > long as the initial step is reasonable in relation to the keyframe distance > > also as both approaches are quite similar one could even choose which > way to do it depending on the expected cost of seeks and bandwidth and > if some statistics on the keyframe distance are known and or the > search direction > > thx > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > There will always be a question for which you do not know the correct answer. > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] tests: Fix bash errors in lavf_container tests.
On 2019-09-07 18:32, Limin Wang wrote: On Sat, Sep 07, 2019 at 05:19:55PM +0200, Michael Niedermayer wrote: On Wed, Aug 28, 2019 at 06:32:37PM +0300, Andrey Semashev wrote: Because lavf_container is sometimes called with only 2 arguments, fate tests produce bash errors like this: tests/fate-run.sh: 299: test: =: unexpected operator This commit fixes this. --- tests/fate-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) I think this change is correct but shell is not my area ... If the $2 is two arguments between with space, the patch is needed. $2 is a single argument that may contain spaces. It is interpreted as a single argument as long as it is enclosed in quotes in lavf_container invokation. The problem is caused not by $2 but by the fact there is no $3. See lavf_container_attach, lavf_container_timecode_nodrop, lavf_container_timecode_drop and lavf_container_timecode functions, as well as a few tests in tests/fate/lavf-container.mak. Why I haven't got such errors when I'm running fate? I noticed the errors when the tests failed (due to my local changes not relevant to this patch). I don't know the details about how tests are run, but maybe the output is suppressed when the tests pass? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat: Fix probing on some JPEGs
On Fri, Sep 06, 2019 at 05:00:14PM -0700, Niki Bowe wrote: > As it turns out the last patch still lets a lot of jpegs get misidentified. > > This new version avoids the problem by checking for jpeg magic at the start. > > I also added a FATE test, and attached the jpeg for the test. > > > > On Tue, Aug 27, 2019 at 6:30 PM Niki Bowe wrote: > > > > > > > On Sun, Aug 25, 2019 at 11:39 AM Michael Niedermayer > > wrote: > > > >> On Fri, Aug 23, 2019 at 04:03:10PM -0700, Niki Bowe wrote: > >> > On Thu, Aug 22, 2019 at 2:30 AM Paul B Mahol wrote: > >> > > >> > > On Thu, Aug 22, 2019 at 11:19 AM Carl Eugen Hoyos >> > > >> > > wrote: > >> > > > >> > > > Am Mi., 21. Aug. 2019 um 23:05 Uhr schrieb Niki Bowe > >> > > > : > >> > > > > > >> > > > > On Mon, Aug 19, 2019 at 7:22 PM Carl Eugen Hoyos < > >> ceffm...@gmail.com> > >> > > > wrote: > >> > > > > > >> > > > > > > >> > > > > > This score would mean that mjpeg can never be detected. > >> > > > > > I suspect you have to reduce one of the demuxers to "- 1". > >> > > > > > > >> > > > > > > >> > > > > Thanks Carl. > >> > > > > Attached patch to reduce mpeg probe by -1, which also fixes the > >> issue. > >> > > > > >> > > > Sorry, I misread the original report, it looked to me as if mJpeg > >> was > >> > > > the culprit. > >> > > > > >> > > > Imo, the mpeg probing should be fixed (return a smaller value) for > >> your > >> > > > sample > >> > > > by detecting that it is not mpeg, not by returning a smaller value > >> for > >> > > > all samples. > >> > > > > >> > > > >> > > 1000% agree. > >> > > > >> > > > >> > It didn't return a smaller value for all samples, only the "invalid VDR > >> > files and short PES streams" case. > >> > Most mpegps files still return 26 immediately, because they have pack > >> > headers. > >> > > >> > However, here is another patch where I try to limit it to only changing > >> > score for these jpegs. > >> > I noticed that these jpegs had a lot of 0x0100 sequences, which > >> matches > >> > mpeg picture header start code. I added another heuristic which matches > >> > these jpegs, but not any mpegps files I could find. > >> > > >> > Alternatively I could make reduce score if it doesn't start with a start > >> > code? At the moment its happy to search until it finds start codes. > >> > > >> > > >> > Is everyone really sure the best approach is to modify mpegps_probe for > >> > this? > >> > The mpegps_probe function returns 25 in many instances where it may not > >> be > >> > mpegps. It does only minimal structural checking, and allows invalid > >> data > >> > to still classify as mpegps. > >> > jpeg probing returns 25 in some cases where it is almost certainly a > >> jpeg > >> > (Has to go through multiple tags to get to SOS, many of which early out > >> if > >> > they find invalid data). > >> > Note that 25 is still treated as "low confidence" for jpeg. It logs > >> "Format > >> > jpeg_pipe detected only with low score of 25, misdetection possible!" > >> for > >> > these jpegs. > >> > So I still think a score of 25 is too low for these jpegs, and that a > >> > better fix would be to return 26 for jpeg_pipe and mjpeg if it makes it > >> > past multiple tags to SOS. > >> > >> jpegs can be in other container formats its not jpeg in that case but the > >> other container format > >> > > about this patch > >> it breaks this: > >> > >> ./ffplay tickets//3327/issue3327-libc-2.17.so > >> > >> https://trac.ffmpeg.org/raw-attachment/ticket/3327/issue3327-libc-2.17.so > >> > >> which is detected as mpeg after the patch. > >> really nothing should be detected as mpeg after this that was not before > >> the idea IIUC is make something that was detected as mpeg to be not > >> anymore > >> > >> > > Thanks Michael. Good find. > > Attached patch which only applies the extra sanity checks to the "Invalid > > VDR files and short PES streams" path. > > > > > > > >> 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. > >> ___ > >> ffmpeg-devel mailing list > >> ffmpeg-devel@ffmpeg.org > >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > >> > >> To unsubscribe, visit link above, or email > >> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > > > > > > > > -- > > > > Nikolas Bowe | SWE | nb...@google.com | 408-565-5137 > > > > > -- > > Nikolas Bowe | SWE | nb...@google.com | 408-565-5137 > libavformat/mpeg.c |5 + > tests/fate/probe.mak |3 +++ > 2 files changed, 8 insertions(+) > e74611d3e5d3eb5170b8145edacfed2f298f86fd > 0001-Fix-JPEGs-being-misidentified-as-mpeg.patch > From 49fdc6549a0b8413f80aa16a1447
Re: [FFmpeg-devel] [PATCH v1] avformat/movenc: split empty text sample when duration overflow
On Fri, Sep 6, 2019 at 4:10 PM Jun Li wrote: > Fix #7637 > One empty/end sample is created and inserted between two caption lines > when there is a gap. > This patch is to split the sample into multiple ones when its duration is > too long (>= INT_MAX). > --- > libavformat/movenc.c | 24 ++-- > 1 file changed, 18 insertions(+), 6 deletions(-) > > diff --git a/libavformat/movenc.c b/libavformat/movenc.c > index edddfeeb00..aeb7de351f 100644 > --- a/libavformat/movenc.c > +++ b/libavformat/movenc.c > @@ -5746,7 +5746,8 @@ static int mov_write_packet(AVFormatContext *s, > AVPacket *pkt) > * > * 2) For each subtitle track, check if the current packet's > * dts is past the duration of the last subtitle sample. If > - * so, we now need to write an end sample for that subtitle. > + * so, we now need to write one or multiple end samples for > + * that subtitle. > * > * This must be done conditionally to allow for subtitles that > * immediately replace each other, in which case an end sample > @@ -5760,11 +5761,22 @@ static int mov_write_packet(AVFormatContext *s, > AVPacket *pkt) > int ret; > > if (trk->par->codec_id == AV_CODEC_ID_MOV_TEXT && > -trk->track_duration < pkt->dts && > -(trk->entry == 0 || !trk->last_sample_is_subtitle_end)) { > -ret = mov_write_subtitle_end_packet(s, i, > trk->track_duration); > -if (ret < 0) return ret; > -trk->last_sample_is_subtitle_end = 1; > +trk->track_duration < pkt->dts) { > +int max_duration = INT_MAX - 1; > +if (trk->entry == 0 || !trk->last_sample_is_subtitle_end) > { > +ret = mov_write_subtitle_end_packet(s, i, > trk->track_duration); > +if (ret < 0) return ret; > +trk->last_sample_is_subtitle_end = 1; > +} > +if (trk->last_sample_is_subtitle_end && > +pkt->dts - trk->track_duration > max_duration) { > +int64_t dts = trk->track_duration; > +while(pkt->dts - dts > max_duration) { > +dts += max_duration; > +ret = mov_write_subtitle_end_packet(s, i, dts); > +if (ret < 0) return ret; > +} > +} > } > } > > -- > 2.17.1 > > Some details: Current implementation will insert one empty sample whenever there is a gap between two captions lines. But when the gap's duration is way too big, the sample's duration will exceed MP4's limitation, thus mov muxer will fail on function check_pkt. This patch is to guarantee that, every empty samples' duration not exceed INT_MAX-1, and insert multiple ones when the gap is bigger than INT_MAX-1. Test results: Fate test passed. Also tested with following SRT file with cmd: ffmpeg -i input.mp4 -i input.srt -c copy -c:s mov_text test.mp4 -y I used Apple's QuickTime player, confirmed that the caption shows up at the correct time. "input. srt" as follows 1 00:35:47.484 --> 00:35:50.000 Durations that exceed the signed int max value break the program 2 00:40:47.484 --> 00:40:50.000 Durations2 that exceed the signed int max value break the program 3 00:50:47.484 --> 00:50:50.000 Durations3 that exceed the signed int max value break the program 4 02:50:47.484 --> 02:50:50.000 Durations4 that exceed the signed int max value break the program 5 03:50:47.484 --> 03:50:50.000 Durations5 that exceed the signed int max value break the program ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v1] swscale/swscale: various cosmetics for the code style
On Sat, 07. Sep 23:50, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libswscale/swscale.c | 40 > 1 file changed, 12 insertions(+), 28 deletions(-) > > diff --git a/libswscale/swscale.c b/libswscale/swscale.c > index 4069550..3e2ebd5 100644 > --- a/libswscale/swscale.c > +++ b/libswscale/swscale.c > @@ -271,7 +271,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], > int lastInLumBuf = c->lastInLumBuf; > int lastInChrBuf = c->lastInChrBuf; > > - > int lumStart = 0; > int lumEnd = c->descIndex[0]; > int chrStart = lumEnd; > @@ -283,22 +282,16 @@ static int swscale(SwsContext *c, const uint8_t *src[], > SwsSlice *vout_slice = &c->slice[c->numSlice-1]; > SwsFilterDescriptor *desc = c->desc; > > - > int needAlpha = c->needAlpha; > > int hasLumHoles = 1; > int hasChrHoles = 1; > > - > if (isPacked(c->srcFormat)) { > -src[0] = > -src[1] = > -src[2] = > -src[3] = src[0]; > -srcStride[0] = > -srcStride[1] = > -srcStride[2] = > -srcStride[3] = srcStride[0]; > +for ( int i = 0; i < 4; i++ ) { extra spaces and I guess you can start i from 1 > +src[i] = src[0]; > +srcStride[i] = srcStride[0]; > +} > } > srcStride[1] <<= c->vChrDrop; > srcStride[2] <<= c->vChrDrop; > @@ -324,7 +317,7 @@ static int swscale(SwsContext *c, const uint8_t *src[], > } > } > > -if ( (uintptr_t)dst[0]&15 || (uintptr_t)dst[1]&15 || > (uintptr_t)dst[2]&15 > +if ((uintptr_t)dst[0]&15 || (uintptr_t)dst[1]&15 || (uintptr_t)dst[2]&15 > || (uintptr_t)src[0]&15 || (uintptr_t)src[1]&15 || > (uintptr_t)src[2]&15 > || dstStride[0]&15 || dstStride[1]&15 || dstStride[2]&15 || > dstStride[3]&15 > || srcStride[0]&15 || srcStride[1]&15 || srcStride[2]&15 || > srcStride[3]&15 > @@ -341,11 +334,9 @@ static int swscale(SwsContext *c, const uint8_t *src[], > * will not get executed. This is not really intended but works > * currently, so people might do it. */ > if (srcSliceY == 0) { > -lumBufIndex = -1; > -chrBufIndex = -1; > +lumBufIndex = chrBufIndex = -1; > dstY = 0; > -lastInLumBuf = -1; > -lastInChrBuf = -1; > +lastInLumBuf = lastInChrBuf = -1; > } > > if (!should_dither) { > @@ -368,16 +359,14 @@ static int swscale(SwsContext *c, const uint8_t *src[], > hout_slice->plane[2].sliceY = lastInChrBuf + 1; > hout_slice->plane[3].sliceY = lastInLumBuf + 1; > > -hout_slice->plane[0].sliceH = > -hout_slice->plane[1].sliceH = > -hout_slice->plane[2].sliceH = > -hout_slice->plane[3].sliceH = 0; > +for(int i = 0; i < 4; i++) > +hout_slice->plane[i].sliceH = 0; > hout_slice->width = dstW; > } > > for (; dstY < dstH; dstY++) { > const int chrDstY = dstY >> c->chrDstVSubSample; > -int use_mmx_vfilter= c->use_mmx_vfilter; > +int use_mmx_vfilter = c->use_mmx_vfilter; > > // First line needed as input > const int firstLumSrcY = FFMAX(1 - vLumFilterSize, > vLumFilterPos[dstY]); > @@ -396,7 +385,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], > > // handle holes (FAST_BILINEAR & weird filters) > if (firstLumSrcY > lastInLumBuf) { > - > hasLumHoles = lastInLumBuf != firstLumSrcY - 1; > if (hasLumHoles) { > hout_slice->plane[0].sliceY = firstLumSrcY; > @@ -408,7 +396,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], > lastInLumBuf = firstLumSrcY - 1; > } > if (firstChrSrcY > lastInChrBuf) { > - > hasChrHoles = lastInChrBuf != firstChrSrcY - 1; > if (hasChrHoles) { > hout_slice->plane[1].sliceY = firstChrSrcY; > @@ -440,7 +427,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], > av_assert0((lastLumSrcY - firstLumSrcY + 1) <= > hout_slice->plane[0].available_lines); > av_assert0((lastChrSrcY - firstChrSrcY + 1) <= > hout_slice->plane[1].available_lines); > > - > posY = hout_slice->plane[0].sliceY + hout_slice->plane[0].sliceH; > if (posY <= lastLumSrcY && !hasLumHoles) { > firstPosY = FFMAX(firstLumSrcY, posY); > @@ -503,10 +489,8 @@ static int swscale(SwsContext *c, const uint8_t *src[], > yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, > use_mmx_vfilter); > } > > -{ > -for (i = vStart; i < vEnd; ++i) > -desc[i].process(c, &desc[i], dstY, 1); > -} > +for (i = vStart; i < vEnd; ++i) I thought that i++ is preferred to ++i > +desc[i].process(c, &desc[i], dstY, 1); > } > if (isPlana
[FFmpeg-devel] [PATCH] avcodec/h2645_parse: simplify memset call
From: Andriy Gelman Removed (new_size - pkt->nals_allocated) because this value is always 1 during the call. --- libavcodec/h2645_parse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c index 307e8643e6..ef6a6b4b4f 100644 --- a/libavcodec/h2645_parse.c +++ b/libavcodec/h2645_parse.c @@ -461,8 +461,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, return AVERROR(ENOMEM); pkt->nals = tmp; -memset(pkt->nals + pkt->nals_allocated, 0, - (new_size - pkt->nals_allocated) * sizeof(*pkt->nals)); +memset(pkt->nals + pkt->nals_allocated, 0, sizeof(*pkt->nals)); nal = &pkt->nals[pkt->nb_nals]; nal->skipped_bytes_pos_size = 1024; // initial buffer size -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] rtsp: fix wrong codec setup for some sdp
On Sat, Sep 07, 2019 at 07:23:13PM +0900, Hyun Yoo wrote: > From: Hyun Yoo > > rtsp_st->sdp_payload_type is the first codec in 'm=' tag > st->codecpar->id is the first supported codec in 'a=' tag > the two is not guaranteed to be same for example when > 1) the order between attributes is random(rfc4566 doesn't force it) > 2) the first codec is same for 'm=' and 'a=' but it is unsupported codec >then st->codecpar->id will be the next one in 'a='(if it's supported) > > Signed-off-by: EaseTheWorld > --- > libavformat/rtsp.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c > index c153cac88b..be3002690e 100644 > --- a/libavformat/rtsp.c > +++ b/libavformat/rtsp.c > @@ -569,6 +569,9 @@ static void sdp_parse_line(AVFormatContext *s, > SDPParseState *s1, > get_word(buf1, sizeof(buf1), &p); > payload_type = atoi(buf1); > rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; > +// parse only sdp_payload_type specified in 'm=' tag > +if (rtsp_st->sdp_payload_type != payload_type) > +return; > if (rtsp_st->stream_index >= 0) { > st = s->streams[rtsp_st->stream_index]; > sdp_parse_rtpmap(s, st, rtsp_st, payload_type, p); > @@ -582,6 +585,10 @@ static void sdp_parse_line(AVFormatContext *s, > SDPParseState *s1, Applying: rtsp: fix wrong codec setup for some sdp error: corrupt patch at line 10 there are extra newlines in the patch ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you fake or manipulate statistics in a paper in physics you will never get a job again. If you fake or manipulate statistics in a paper in medicin you will get a job for life at the pharma industry. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] DVB EPG decoder
On Wed, 4 Sep 2019, Anthony Delannoy wrote: Hi I'm still interested to have those three commits merged (update in attachments). Ok, below are some more comments. But I'd like to see data decoder in the future to use more easily EPG/NIT/BAT etc tables. Will it be possible? With modifications if it needs to be? I don't see how, as it does not fit into the concept of the libav* libraries. I feel this belongs to a separate library. From 335b0bf377c1e5cfc5207561adc9621b113759b0 Mon Sep 17 00:00:00 2001 From: Anthony Delannoy Date: Wed, 21 Aug 2019 11:46:56 +0200 Subject: [PATCH 3/3] lavf/mpegts: EPG extraction from mpegts --- libavformat/mpegts.c | 71 ++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 0415ceea02..9bb6b6add8 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -168,6 +168,8 @@ struct MpegTSContext { /** filters for various streams specified by PMT + for the PAT and PMT */ MpegTSFilter *pids[NB_PID_MAX]; int current_pid; + +AVStream *epg_stream; }; #define MPEGTS_OPTIONS \ @@ -2498,13 +2500,68 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len } } +static void eit_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) +{ +MpegTSContext *ts = filter->u.section_filter.opaque; +const uint8_t *p, *p_end; +SectionHeader h1, *h = &h1; + +/* + * Sometimes we receive EPG packets but SDT table do not have + * eit_pres_following or eit_sched turned on, so we open EPG + * stream directly here. + */ +if (!ts->epg_stream) { +ts->epg_stream = avformat_new_stream(ts->stream, NULL); +if (!ts->epg_stream) +return; +ts->epg_stream->id = EIT_PID; +ts->epg_stream->codecpar->codec_type = AVMEDIA_TYPE_DATA; +ts->epg_stream->codecpar->codec_id = AV_CODEC_ID_EPG; +} + +if (ts->epg_stream->discard == AVDISCARD_ALL) +return; + +p_end = section + section_len - 4; +p = section; + +if (parse_section_header(h, &p, p_end) < 0) +return; +if (h->tid < EIT_TID || h->tid > OEITS_END_TID) +return; + +av_log(ts->stream, AV_LOG_TRACE, "EIT: tid received = %.02x\n", h->tid); + +/** + * Service_id 0x is reserved, it indicates that the current EIT table + * is scrambled. + */ +if (h->id == 0x) { +av_log(ts->stream, AV_LOG_WARNING, "Scrambled EIT table received.\n"); +return; +} In case of a scrambled EIT (which I have never seen myself in the wild) you'd print this at every packet. You should either remove the warning, or check if this is the first time (e.g. by checking if the EPG stream was just created). + +/** + * In case we receive an EPG packet before mpegts context is fully + * initialized. + */ +if (!ts->pkt) +return; + +new_data_packet(section, section_len, ts->pkt); +ts->pkt->stream_index = ts->epg_stream->index; +ts->stop_parse = 1; +} + static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) { MpegTSContext *ts = filter->u.section_filter.opaque; MpegTSSectionFilter *tssf = &filter->u.section_filter; SectionHeader h1, *h = &h1; const uint8_t *p, *p_end, *desc_list_end, *desc_end; -int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type; +int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type, +eit_sched, eit_pres_following; char *name, *provider_name; av_log(ts->stream, AV_LOG_TRACE, "SDT:\n"); @@ -2534,6 +2591,13 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len val = get8(&p, p_end); if (val < 0) break; +eit_sched = (val >> 1) & 0x1; +eit_pres_following = val & 0x1; + +if ((eit_sched | eit_pres_following) && !ts->epg_stream) +av_log(ts->stream, AV_LOG_WARNING, "SDT table advertise EIT but no" + " packets were received yet.\n"); + You should remove this, there are tons of captures where EIT PID is intentionally filtered, we should not spam the user. desc_list_len = get16(&p, p_end); if (desc_list_len < 0) break; @@ -2984,8 +3048,8 @@ static int mpegts_read_header(AVFormatContext *s) seek_back(s, pb, pos); mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1); - mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1); +mpegts_open_section_filter(ts, EIT_PID, eit_cb, ts, 1); handle_packets(ts, probesize / ts->raw_packet_size); /* if could not find service, enable auto_guess */ @@ -3240,8 +3304,11 @@ MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s) ts->raw_packet_size = TS_PACKET_SIZE; ts->stream = s; ts->auto_guess = 1; +ts->epg_stream = NULL; Not
[FFmpeg-devel] [PATCH v1] swscale/swscale: various cosmetics for the code style
From: Limin Wang Signed-off-by: Limin Wang --- libswscale/swscale.c | 40 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 4069550..3e2ebd5 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -271,7 +271,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], int lastInLumBuf = c->lastInLumBuf; int lastInChrBuf = c->lastInChrBuf; - int lumStart = 0; int lumEnd = c->descIndex[0]; int chrStart = lumEnd; @@ -283,22 +282,16 @@ static int swscale(SwsContext *c, const uint8_t *src[], SwsSlice *vout_slice = &c->slice[c->numSlice-1]; SwsFilterDescriptor *desc = c->desc; - int needAlpha = c->needAlpha; int hasLumHoles = 1; int hasChrHoles = 1; - if (isPacked(c->srcFormat)) { -src[0] = -src[1] = -src[2] = -src[3] = src[0]; -srcStride[0] = -srcStride[1] = -srcStride[2] = -srcStride[3] = srcStride[0]; +for ( int i = 0; i < 4; i++ ) { +src[i] = src[0]; +srcStride[i] = srcStride[0]; +} } srcStride[1] <<= c->vChrDrop; srcStride[2] <<= c->vChrDrop; @@ -324,7 +317,7 @@ static int swscale(SwsContext *c, const uint8_t *src[], } } -if ( (uintptr_t)dst[0]&15 || (uintptr_t)dst[1]&15 || (uintptr_t)dst[2]&15 +if ((uintptr_t)dst[0]&15 || (uintptr_t)dst[1]&15 || (uintptr_t)dst[2]&15 || (uintptr_t)src[0]&15 || (uintptr_t)src[1]&15 || (uintptr_t)src[2]&15 || dstStride[0]&15 || dstStride[1]&15 || dstStride[2]&15 || dstStride[3]&15 || srcStride[0]&15 || srcStride[1]&15 || srcStride[2]&15 || srcStride[3]&15 @@ -341,11 +334,9 @@ static int swscale(SwsContext *c, const uint8_t *src[], * will not get executed. This is not really intended but works * currently, so people might do it. */ if (srcSliceY == 0) { -lumBufIndex = -1; -chrBufIndex = -1; +lumBufIndex = chrBufIndex = -1; dstY = 0; -lastInLumBuf = -1; -lastInChrBuf = -1; +lastInLumBuf = lastInChrBuf = -1; } if (!should_dither) { @@ -368,16 +359,14 @@ static int swscale(SwsContext *c, const uint8_t *src[], hout_slice->plane[2].sliceY = lastInChrBuf + 1; hout_slice->plane[3].sliceY = lastInLumBuf + 1; -hout_slice->plane[0].sliceH = -hout_slice->plane[1].sliceH = -hout_slice->plane[2].sliceH = -hout_slice->plane[3].sliceH = 0; +for(int i = 0; i < 4; i++) +hout_slice->plane[i].sliceH = 0; hout_slice->width = dstW; } for (; dstY < dstH; dstY++) { const int chrDstY = dstY >> c->chrDstVSubSample; -int use_mmx_vfilter= c->use_mmx_vfilter; +int use_mmx_vfilter = c->use_mmx_vfilter; // First line needed as input const int firstLumSrcY = FFMAX(1 - vLumFilterSize, vLumFilterPos[dstY]); @@ -396,7 +385,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], // handle holes (FAST_BILINEAR & weird filters) if (firstLumSrcY > lastInLumBuf) { - hasLumHoles = lastInLumBuf != firstLumSrcY - 1; if (hasLumHoles) { hout_slice->plane[0].sliceY = firstLumSrcY; @@ -408,7 +396,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], lastInLumBuf = firstLumSrcY - 1; } if (firstChrSrcY > lastInChrBuf) { - hasChrHoles = lastInChrBuf != firstChrSrcY - 1; if (hasChrHoles) { hout_slice->plane[1].sliceY = firstChrSrcY; @@ -440,7 +427,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], av_assert0((lastLumSrcY - firstLumSrcY + 1) <= hout_slice->plane[0].available_lines); av_assert0((lastChrSrcY - firstChrSrcY + 1) <= hout_slice->plane[1].available_lines); - posY = hout_slice->plane[0].sliceY + hout_slice->plane[0].sliceH; if (posY <= lastLumSrcY && !hasLumHoles) { firstPosY = FFMAX(firstLumSrcY, posY); @@ -503,10 +489,8 @@ static int swscale(SwsContext *c, const uint8_t *src[], yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, use_mmx_vfilter); } -{ -for (i = vStart; i < vEnd; ++i) -desc[i].process(c, &desc[i], dstY, 1); -} +for (i = vStart; i < vEnd; ++i) +desc[i].process(c, &desc[i], dstY, 1); } if (isPlanar(dstFormat) && isALPHA(dstFormat) && !needAlpha) { int length = dstW; -- 2.6.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] tests: Fix bash errors in lavf_container tests.
On Sat, Sep 07, 2019 at 05:19:55PM +0200, Michael Niedermayer wrote: > On Wed, Aug 28, 2019 at 06:32:37PM +0300, Andrey Semashev wrote: > > Because lavf_container is sometimes called with only 2 arguments, > > fate tests produce bash errors like this: > > > > tests/fate-run.sh: 299: test: =: unexpected operator > > > > This commit fixes this. > > --- > > tests/fate-run.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > I think this change is correct but shell is not my area ... If the $2 is two arguments between with space, the patch is needed. Why I haven't got such errors when I'm running fate? > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Its not that you shouldnt use gotos but rather that you should write > readable code and code with gotos often but not always is less readable > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] tests: Fix bash errors in lavf_container tests.
On Wed, Aug 28, 2019 at 06:32:37PM +0300, Andrey Semashev wrote: > Because lavf_container is sometimes called with only 2 arguments, > fate tests produce bash errors like this: > > tests/fate-run.sh: 299: test: =: unexpected operator > > This commit fixes this. > --- > tests/fate-run.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) I think this change is correct but shell is not my area ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write readable code and code with gotos often but not always is less readable signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v1 1/2] avfilter/vf_scale: split the scale_frame function from filter_frame for activate function support
On Fri, Sep 06, 2019 at 08:08:48PM +0200, Michael Niedermayer wrote: > On Sat, Jul 27, 2019 at 08:18:16PM +0800, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > libavfilter/vf_scale.c | 29 + > > 1 file changed, 25 insertions(+), 4 deletions(-) > > > > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c > > index 7aebf56..efb480d 100644 > > --- a/libavfilter/vf_scale.c > > +++ b/libavfilter/vf_scale.c > > @@ -400,7 +400,7 @@ static int scale_slice(AVFilterLink *link, AVFrame > > *out_buf, AVFrame *cur_pic, s > > out,out_stride); > > } > > > > -static int filter_frame(AVFilterLink *link, AVFrame *in) > > +static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame > > **frame_out, int *got_frame) > > { > > ScaleContext *scale = link->dst->priv; > > AVFilterLink *outlink = link->dst->outputs[0]; > > @@ -409,6 +409,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) > > char buf[32]; > > int in_range; > > > > +*got_frame = 0; > > if (in->colorspace == AVCOL_SPC_YCGCO) > > av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo > > colorspace.\n"); > > > > @@ -437,8 +438,11 @@ static int filter_frame(AVFilterLink *link, AVFrame > > *in) > > return ret; > > } > > > > -if (!scale->sws) > > -return ff_filter_frame(outlink, in); > > +if (!scale->sws) { > > +*got_frame = 1; > > +*frame_out = in; > > +return 0; > > +} > > > > scale->hsub = desc->log2_chroma_w; > > scale->vsub = desc->log2_chroma_h; > > @@ -448,6 +452,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) > > av_frame_free(&in); > > return AVERROR(ENOMEM); > > } > > +*frame_out = out; > > > > av_frame_copy_props(out, in); > > out->width = outlink->w; > > @@ -521,7 +526,23 @@ static int filter_frame(AVFilterLink *link, AVFrame > > *in) > > } > > > > av_frame_free(&in); > > -return ff_filter_frame(outlink, out); > > +*got_frame = 1; > > +return 0; > > +} > > + > > +static int filter_frame(AVFilterLink *link, AVFrame *in) > > +{ > > +AVFilterContext *ctx = link->dst; > > +AVFilterLink *outlink = ctx->outputs[0]; > > +int got_frame = 0; > > +AVFrame *out; > > +int ret; > > + > > +ret = scale_frame(link, in, &out, &got_frame); > > +if (got_frame) > > +return ff_filter_frame(outlink, out); > > can this be simplified by using out != NULL instead of got_frame ? Michael I have updated the patch to simplified the code. fate testing is passed, please review it. > > thx > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > I know you won't believe me, but the highest form of Human Excellence is > to question oneself and others. -- Socrates > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 2/2] avfilter/vf_scale: change filter_frame interface to activate interface
From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_scale.c | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index cb42794..5c1d811 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -27,6 +27,7 @@ #include #include "avfilter.h" +#include "filters.h" #include "formats.h" #include "internal.h" #include "scale.h" @@ -554,6 +555,39 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) return ret; } +static int activate(AVFilterContext *ctx) +{ +AVFilterLink *inlink = ctx->inputs[0]; +AVFilterLink *outlink = ctx->outputs[0]; +AVFrame *in, *out = NULL; +int64_t pts; +int ret, status; + +FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); + +ret = ff_inlink_consume_frame(inlink, &in); +if (ret > 0) { +ret = scale_frame(inlink, in, &out); +if (ret) +return ret; +if (out) +return ff_filter_frame(outlink, out); +} + +if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { +if (status == AVERROR_EOF) { +/* frame flushing */ +} + +ff_outlink_set_status(outlink, status, pts); +return ret; +} + +FF_FILTER_FORWARD_WANTED(outlink, inlink); + +return FFERROR_NOT_READY; +} + static int filter_frame_ref(AVFilterLink *link, AVFrame *in) { AVFilterLink *outlink = link->dst->outputs[1]; @@ -653,7 +687,6 @@ static const AVFilterPad avfilter_vf_scale_inputs[] = { { .name = "default", .type = AVMEDIA_TYPE_VIDEO, -.filter_frame = filter_frame, }, { NULL } }; @@ -672,6 +705,7 @@ AVFilter ff_vf_scale = { .description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format."), .init_dict = init_dict, .uninit = uninit, +.activate= activate, .query_formats = query_formats, .priv_size = sizeof(ScaleContext), .priv_class = &scale_class, -- 2.6.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 1/2] avfilter/vf_scale: split the scale_frame function from filter_frame for activate function support
From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_scale.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index bf340b8..cb42794 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -412,7 +412,7 @@ static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, s out,out_stride); } -static int filter_frame(AVFilterLink *link, AVFrame *in) +static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) { ScaleContext *scale = link->dst->priv; AVFilterLink *outlink = link->dst->outputs[0]; @@ -421,6 +421,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) char buf[32]; int in_range; +*frame_out = NULL; if (in->colorspace == AVCOL_SPC_YCGCO) av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n"); @@ -449,8 +450,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) return ret; } -if (!scale->sws) -return ff_filter_frame(outlink, in); +if (!scale->sws) { +*frame_out = in; +return 0; +} scale->hsub = desc->log2_chroma_w; scale->vsub = desc->log2_chroma_h; @@ -460,6 +463,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) av_frame_free(&in); return AVERROR(ENOMEM); } +*frame_out = out; av_frame_copy_props(out, in); out->width = outlink->w; @@ -533,7 +537,21 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) } av_frame_free(&in); -return ff_filter_frame(outlink, out); +return 0; +} + +static int filter_frame(AVFilterLink *link, AVFrame *in) +{ +AVFilterContext *ctx = link->dst; +AVFilterLink *outlink = ctx->outputs[0]; +AVFrame *out; +int ret; + +ret = scale_frame(link, in, &out); +if (out) +return ff_filter_frame(outlink, out); + +return ret; } static int filter_frame_ref(AVFilterLink *link, AVFrame *in) -- 2.6.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3 3/3] FATE: add a test for freeezedetect
On Sat, Aug 24, 2019 at 07:38:59PM +0200, Marton Balint wrote: > > > On Sat, 24 Aug 2019, Limin Wang wrote: > > >On Fri, Aug 23, 2019 at 08:27:22PM +0200, Michael Niedermayer wrote: > >>On Fri, Aug 23, 2019 at 08:17:09PM +0800, lance.lmw...@gmail.com wrote: > >>> From: Limin Wang > >>> > Signed-off-by: Limin Wang > >>> --- > >>> tests/fate/filter-video.mak | 4 + > >>> tests/ref/fate/filter-metadata-freezedetect | 251 > >>> > >>> 2 files changed, 255 insertions(+) > >>> create mode 100644 tests/ref/fate/filter-metadata-freezedetect > >> > >>fails on mips apparently > > > >It seems that it's freezedetect failed to detect on mips system, > >where to get remote mips system to check it further? > > You can probably get an image for qemu. Sorry, I have tried to install one mips system with qemu successfully, however it failed to build FFmpeg, so I can't see the issue until now. > > Regards, > Marton > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/qdm2: Check frame size
On Fri, Sep 06, 2019 at 11:08:06PM +0200, Paul B Mahol wrote: > Are you sure this is not band aid but actually real fix? Sorry, I did not see your reply yesterday before applying the change. Without a real (non fuzzer) sample and no reference specification or reference implementation that is open source. Asking for a sample seems the obvious solution to me. Having a sample for this case would be quite usefull ... I do not know if this corner case ever occurs in a real sample, but if it does occur then yes this is not a real fix for it, it just avoids the anomaly found by the fuzzer. If this never occurs in any encoder output then it would be a real fix. (minus asking for a sample) Thanks > > On 8/29/19, Michael Niedermayer wrote: > > Fixes: index 2304 out of bounds for type 'float [2304]' > > Fixes: > > 16332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5679142481166336 > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/qdm2.c | 5 + > > 1 file changed, 5 insertions(+) > > > > diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c > > index eaffb36dcc..ac8ae8cbbb 100644 > > --- a/libavcodec/qdm2.c > > +++ b/libavcodec/qdm2.c > > @@ -1727,6 +1727,11 @@ static av_cold int qdm2_decode_init(AVCodecContext > > *avctx) > > s->sub_sampling = s->fft_order - 7; > > s->frequency_range = 255 / (1 << (2 - s->sub_sampling)); > > > > +if (s->frame_size * 4 >> s->sub_sampling > MPA_FRAME_SIZE) { > > +avpriv_request_sample(avctx, "large frames"); > > +return AVERROR_PATCHWELCOME; > > +} > > + > > switch ((s->sub_sampling * 2 + s->channels - 1)) { > > case 0: tmp = 40; break; > > case 1: tmp = 48; break; > > -- > > 2.23.0 > > > > ___ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > > To unsubscribe, visit link above, or email > > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avformat/hlsenc: print warning at the end when upload the last segment failed
Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index f881bb9d60..10e90c3839 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2601,6 +2601,8 @@ static int hls_write_trailer(struct AVFormatContext *s) } reflush_dynbuf(vs, &range_length); ret = hlsenc_io_close(s, &vs->out, filename); +if (ret < 0) +av_log(s, AV_LOG_WARNING, "Failed to upload file '%s' at the end.\n", vs->avf->url); } av_free(vs->temp_buffer); -- 2.15.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] rtsp: fix wrong codec setup for some sdp
From: Hyun Yoo rtsp_st->sdp_payload_type is the first codec in 'm=' tag st->codecpar->id is the first supported codec in 'a=' tag the two is not guaranteed to be same for example when 1) the order between attributes is random(rfc4566 doesn't force it) 2) the first codec is same for 'm=' and 'a=' but it is unsupported codec then st->codecpar->id will be the next one in 'a='(if it's supported) Signed-off-by: EaseTheWorld --- libavformat/rtsp.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index c153cac88b..be3002690e 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -569,6 +569,9 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, get_word(buf1, sizeof(buf1), &p); payload_type = atoi(buf1); rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; +// parse only sdp_payload_type specified in 'm=' tag +if (rtsp_st->sdp_payload_type != payload_type) +return; if (rtsp_st->stream_index >= 0) { st = s->streams[rtsp_st->stream_index]; sdp_parse_rtpmap(s, st, rtsp_st, payload_type, p); @@ -582,6 +585,10 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, // let dynamic protocol handlers have a stab at the line. get_word(buf1, sizeof(buf1), &p); payload_type = atoi(buf1); +rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; +// parse only sdp_payload_type specified in 'm=' tag +if (rtsp_st->sdp_payload_type != payload_type) +return; if (s1->seen_rtpmap) { parse_fmtp(s, rt, payload_type, buf); } else { -- 2.23.0.windows.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".