Re: [FFmpeg-devel] [PATCH] avfilter/af_anlmdn: Remove threading flag
Not OK, there is threading in filter. See execute call. On 10/25/19, Andriy Gelman wrote: > From: Andriy Gelman > > Unset flag because there is no threading in filter. > --- > libavfilter/af_anlmdn.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c > index 6e37452963..c25454e6f8 100644 > --- a/libavfilter/af_anlmdn.c > +++ b/libavfilter/af_anlmdn.c > @@ -369,6 +369,5 @@ AVFilter ff_af_anlmdn = { > .inputs= inputs, > .outputs = outputs, > .process_command = ff_filter_process_command, > -.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | > - AVFILTER_FLAG_SLICE_THREADS, > +.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL > }; > -- > 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".
Re: [FFmpeg-devel] [PATCH v3 3/3] avutil/avstring: replace with system interface if dirname and basename functions are detected
On 10/25/19, Limin Wang wrote: > On Wed, Oct 23, 2019 at 06:07:24PM +0200, Paul B Mahol wrote: >> Why? >> > Sorry, I haven't get your question, you mean why to use system > standard c lib API? What are gains? > >> On 10/23/19, lance.lmw...@gmail.com wrote: >> > From: Limin Wang >> > >> > Signed-off-by: Limin Wang >> > --- >> > configure| 4 >> > libavutil/avstring.c | 13 - >> > 2 files changed, 16 insertions(+), 1 deletion(-) >> > >> > diff --git a/configure b/configure >> > index 8413826..5296a4c 100755 >> > --- a/configure >> > +++ b/configure >> > @@ -2188,6 +2188,8 @@ SYSTEM_FUNCS=" >> > clock_gettime >> > closesocket >> > CommandLineToArgvW >> > +dirname >> > +basename >> > fcntl >> > getaddrinfo >> > gethrtime >> > @@ -5980,6 +5982,8 @@ check_func access >> > check_func_headers stdlib.h arc4random >> > check_lib clock_gettime time.h clock_gettime || check_lib >> > clock_gettime >> > time.h clock_gettime -lrt >> > check_func fcntl >> > +check_func_headers libgen.h dirname >> > +check_func_headers libgen.h basename >> > check_func fork >> > check_func gethrtime >> > check_func getopt >> > diff --git a/libavutil/avstring.c b/libavutil/avstring.c >> > index 76a13ba..66654fb 100644 >> > --- a/libavutil/avstring.c >> > +++ b/libavutil/avstring.c >> > @@ -19,12 +19,15 @@ >> > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA >> > 02110-1301 >> > USA >> > */ >> > >> > +#include "config.h" >> > #include >> > #include >> > #include >> > #include >> > +#if defined(HAVE_DIRNAME) || defined(HAVE_BASENAME) >> > +#include >> > +#endif >> > >> > -#include "config.h" >> > #include "common.h" >> > #include "mem.h" >> > #include "avassert.h" >> > @@ -257,6 +260,9 @@ char *av_strireplace(const char *str, const char >> > *from, >> > const char *to) >> > >> > const char *av_basename(const char *path) >> > { >> > +#if HAVE_BASENAME >> > +return basename((char*)path); >> > +#else >> > char *p; >> > >> > if (!path || *path == '\0') >> > @@ -274,10 +280,14 @@ const char *av_basename(const char *path) >> > return path; >> > >> > return p + 1; >> > +#endif >> > } >> > >> > const char *av_dirname(char *path) >> > { >> > +#if HAVE_DIRNAME >> > +return dirname(path); >> > +#else >> > char *p = path ? strrchr(path, '/') : NULL; >> > >> > #if HAVE_DOS_PATHS >> > @@ -295,6 +305,7 @@ const char *av_dirname(char *path) >> > *p = '\0'; >> > >> > return path; >> > +#endif >> > } >> > >> > char *av_append_path_component(const char *path, const char *component) >> > -- >> > 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 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] add phqm filter and img_hash
On Thu, Oct 24, 2019 at 19:23:48 -0500, ckenn...@ellation.com wrote: > ffmpeg -i encode.mp4 -i reference.mp4 \ >-filter_complex "[0:v][1:v]phqm=stats_file=out.log" \ >-an -codec:v rawvideo -y -f null /dev/null -f null doesn't require -c:v rawvideo. > OBJS-$(CONFIG_OCV_FILTER)+= vf_libopencv.o > +OBJS-$(CONFIG_PHQM_FILTER) += vf_phqm.o img_hash.o > OBJS-$(CONFIG_OSCILLOSCOPE_FILTER) += vf_datascope.o > OBJS-$(CONFIG_OVERLAY_FILTER)+= vf_overlay.o framesync.o > OBJS-$(CONFIG_OVERLAY_OPENCL_FILTER) += vf_overlay_opencl.o opencl.o > \ Incorrect indentation, and should be in alphabetical order. > extern AVFilter ff_vf_ocv; > +extern AVFilter ff_vf_phqm; > extern AVFilter ff_vf_oscilloscope; > extern AVFilter ff_vf_overlay; This should be in alphabetical order. > +using namespace cv; > +using namespace cv::img_hash; > +using namespace std; I dislike this style, especially the "std", but there are probably no existing C++ recommendations for ffmpeg. > +if (pixfmt == AV_PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; > channels_nb = 1; } > +else if (pixfmt == AV_PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; > channels_nb = 4; } > +else if (pixfmt == AV_PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; > channels_nb = 3; } > +else if (pixfmt == AV_PIX_FMT_YUV420P) { depth = IPL_DEPTH_8U; > channels_nb = 3; } > +else return; This looks artificially overcomplicated. int depth = IPL_DEPTH_8U; // or even const int - or just use the actual value in place and then switch (pixfmt) { case AV_PIX_FMT_GRAY8: channels_nb = 1; break; case AV_PIX_FMT_BGRA : channels_nb = 4; break; case AV_PIX_FMT_BGR24: // fallthrough case AV_PIX_FMT_YUV420P: channels_nb = 3; break; default: return; } > +// Get the score of two Video Frames by comparing the perceptual hashes and > deriving a hamming distance > +// showing how similar they are or different. lower the score is better for > most algorithms "lower score" > +cv::Mat h1; > +cv::Mat h2; > +cv::Mat m1; > +cv::Mat m2; It seems you're declaring use namespace cv, but not makeing use of it. Drop the former. (Also for cv::img_hash.) > +// Convert an IplImage to an Mat Image for OpenCV (newer format) > +m1 = cv::cvarrToMat(&ipl1); > +m2 = cv::cvarrToMat(&ipl2); How do you assure you're no passing uninitialized pointers to cv::cvarrToMat()? I the pixfmt is rejected by fill_iplimage_from_frame(), ipl1/2 aren't set. And you accept many more pixfmts in the filter than fill_iplimage_from_frame() handles, right? > +// substantiate the hash type algorithm > +if (hash_type == COLORMOMENT) { > +algo = cv::img_hash::ColorMomentHash::create(); > +} else if (hash_type == AVERAGE) { > +algo = cv::img_hash::AverageHash::create(); > +} else if (hash_type == BLOCKMEAN1) { > +//BlockMeanHash support mode 0 and mode 1, they associate to > +////mode 1 and mode 2 of PHash library > +algo = cv::img_hash::BlockMeanHash::create(0); > +} else if (hash_type == BLOCKMEAN2) { > +algo = cv::img_hash::BlockMeanHash::create(1); > +} else if (hash_type == MARRHILDRETH) { > +algo = cv::img_hash::MarrHildrethHash::create(); > +} else if (hash_type == RADIALVARIANCE) { > +algo = cv::img_hash::RadialVarianceHash::create(); > +} else { // Default to PHash > +algo = cv::img_hash::PHash::create(); > +} Again, a switch/case would be easier to read. > + * PHQM Perceptual Hash Quality Metric > + * PHQM: Caculate the Image Hash Hamming Difference between two input videos. "Calculate" > +{"scd_thresh", "Scene Change Detection Threshold. 0.5 default, 0.0-1.0", >OFFSET(scd_thresh), AV_OPT_TYPE_DOUBLE,{.dbl=0.5},0, 1, FLAGS }, Defaults and ranges are self-documenting, no need to mention. > +{ "hash_type", "options: phash, colormoment, average", > OFFSET(hash_type), AV_OPT_TYPE_STRING, {.str = "phash"}, .flags = FLAGS }, This calls for proper options flags. > +double ret = 0; Usually "0.", but shouldn't matter. > +double comp_mse[4], mse = 0, hd = 0; Ditto. > +double hd_limit = 100; Ditto. > +av_log(s, AV_LOG_WARNING, "ImgHashScene: n:%"PRId64"-%"PRId64" > hd_avg:%0.3lf hd_min:%0.3lf hd_max:%0.3lf scd:%0.2lf\n", > + (s->nb_frames - s->nb_shd), s->nb_frames - 1, (s->shd / > s->nb_shd), s->smin_hd, s->smax_hd, s->scene_score); Is WARNING the correct level for such an info? I don't believe so. > +/* limit the highest value so we cut off at perceptual difference match > */ > +if (s->hash_type_i == PHASH || s->hash_type_i == AVERAGE) > +hd_limit = 5; > +else if (s->hash_type_i == MARRHILDRETH) > +hd_limit = 30; > +else if (s->hash_type_i == RADIALVARIANCE) > +hd_limit = 0.9; > +else if (s->hash_type_i == BLOCKMEAN1) > +
[FFmpeg-devel] [PATCH 1/4] avformat/flvenc: Forward errors from allocating keyframe index
While the function adding a new element to the keyframe index checked the allocation, the caller didn't check the return value. This has been changed. To do so, the return value has been changed to an ordinary ret instead of pb->error. This doesn't pose a problem, as write_packet() in mux.c already checks for write errors (since 9ad1e0c1). Signed-off-by: Andreas Rheinhardt --- libavformat/flvenc.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index fb1dede7ae..e327545dcf 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -887,7 +887,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) unsigned ts; int size = pkt->size; uint8_t *data = NULL; -int flags = -1, flags_size, ret; +int flags = -1, flags_size, ret = 0; int64_t cur_offset = avio_tell(pb); if (par->codec_type == AVMEDIA_TYPE_AUDIO && !pkt->size) { @@ -1055,15 +1055,17 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) case AVMEDIA_TYPE_VIDEO: flv->videosize += (avio_tell(pb) - cur_offset); flv->lasttimestamp = flv->acurframeindex / flv->framerate; +flv->acurframeindex++; if (pkt->flags & AV_PKT_FLAG_KEY) { -double ts = flv->acurframeindex / flv->framerate; +double ts = flv->lasttimestamp; int64_t pos = cur_offset; -flv->lastkeyframetimestamp = flv->acurframeindex / flv->framerate; +flv->lastkeyframetimestamp = ts; flv->lastkeyframelocation = pos; -flv_append_keyframe_info(s, flv, ts, pos); +ret = flv_append_keyframe_info(s, flv, ts, pos); +if (ret < 0) +goto fail; } -flv->acurframeindex++; break; case AVMEDIA_TYPE_AUDIO: @@ -1075,10 +1077,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) break; } } - +fail: av_free(data); -return pb->error; +return ret; } static int flv_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt) -- 2.20.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 2/4] avformat/flvenc: Fix leak of oversized packets
Might happen for annex B H.264. Signed-off-by: Andreas Rheinhardt --- This patchset was actually meant as a reply to [1], but I made an error with the in-reply-to headers. [1]: http://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/252057.html libavformat/flvenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index e327545dcf..0e6c66a5ff 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -990,7 +990,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) if (size + flags_size >= 1<<24) { av_log(s, AV_LOG_ERROR, "Too large packet with size %u >= %u\n", size + flags_size, 1<<24); -return AVERROR(EINVAL); +ret = AVERROR(EINVAL); +goto fail; } avio_wb24(pb, size + flags_size); -- 2.20.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 4/4] avformat/flvenc: Add deinit function
Fixes memleaks when the trailer is never written or when shift_data() fails when writing the trailer. Signed-off-by: Andreas Rheinhardt --- libavformat/flvenc.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index a2bd791c59..228900f028 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -810,8 +810,6 @@ static int flv_write_trailer(AVFormatContext *s) put_amf_double(pb, flv_posinfo[i].keyframe_timestamp); } -av_freep(&flv->filepositions); - put_amf_string(pb, ""); avio_w8(pb, AMF_END_OF_OBJECT); @@ -1076,6 +1074,14 @@ static int flv_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt) return ret; } +static void flv_deinit(AVFormatContext *s) +{ +FLVContext *flv = s->priv_data; + +av_freep(&flv->filepositions); +flv->filepositions_count = flv->filepositions_allocated = 0; +} + static const AVOption options[] = { { "flvflags", "FLV muxer flags", offsetof(FLVContext, flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" }, { "aac_seq_header_detect", "Put AAC sequence header based on stream data", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" }, @@ -1105,6 +,7 @@ AVOutputFormat ff_flv_muxer = { .write_header = flv_write_header, .write_packet = flv_write_packet, .write_trailer = flv_write_trailer, +.deinit = flv_deinit, .check_bitstream= flv_check_bitstream, .codec_tag = (const AVCodecTag* const []) { flv_video_codec_ids, flv_audio_codec_ids, 0 -- 2.20.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 3/4] avformat/flvenc: Use array instead of linked list for index
Using a linked list had very much overhead (the pointer to the next entry increased the size of the index entry struct from 16 to 24 bytes, not to mention the overhead of having separate allocations), so it is better to (re)allocate a continuous array for the index. Signed-off-by: Andreas Rheinhardt --- libavformat/flvenc.c | 58 +++- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 0e6c66a5ff..a2bd791c59 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -74,7 +74,6 @@ typedef enum { typedef struct FLVFileposition { int64_t keyframe_position; double keyframe_timestamp; -struct FLVFileposition *next; } FLVFileposition; typedef struct FLVContext { @@ -108,9 +107,9 @@ typedef struct FLVContext { int acurframeindex; int64_t keyframes_info_offset; -int64_t filepositions_count; FLVFileposition *filepositions; -FLVFileposition *head_filepositions; +size_t filepositions_allocated; +int64_t filepositions_count; AVCodecParameters *audio_par; AVCodecParameters *video_par; @@ -549,27 +548,19 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i static int flv_append_keyframe_info(AVFormatContext *s, FLVContext *flv, double ts, int64_t pos) { -FLVFileposition *position = av_malloc(sizeof(FLVFileposition)); - -if (!position) { -av_log(s, AV_LOG_WARNING, "no mem for add keyframe index!\n"); -return AVERROR(ENOMEM); -} - -position->keyframe_timestamp = ts; -position->keyframe_position = pos; - -if (!flv->filepositions_count) { -flv->filepositions = position; -flv->head_filepositions = flv->filepositions; -position->next = NULL; -} else { -flv->filepositions->next = position; -position->next = NULL; -flv->filepositions = flv->filepositions->next; +if (flv->filepositions_count >= flv->filepositions_allocated) { +void *pos = av_realloc_array(flv->filepositions, + 2 * flv->filepositions_allocated + 1, + sizeof(*flv->filepositions)); +if (!pos) { +av_log(s, AV_LOG_WARNING, "No memory for keyframe index\n"); +return AVERROR(ENOMEM); +} +flv->filepositions = pos; +flv->filepositions_allocated = 2 * flv->filepositions_allocated + 1; } -flv->filepositions_count++; +flv->filepositions[flv->filepositions_count++] = (FLVFileposition){ pos, ts }; return 0; } @@ -784,7 +775,7 @@ static int flv_write_trailer(AVFormatContext *s) int64_t cur_pos = avio_tell(s->pb); if (build_keyframes_idx) { -FLVFileposition *newflv_posinfo, *p; +FLVFileposition *flv_posinfo = flv->filepositions; avio_seek(pb, flv->videosize_offset, SEEK_SET); put_amf_double(pb, flv->videosize); @@ -809,28 +800,17 @@ static int flv_write_trailer(AVFormatContext *s) avio_seek(pb, flv->keyframes_info_offset, SEEK_SET); put_amf_string(pb, "filepositions"); put_amf_dword_array(pb, flv->filepositions_count); -for (newflv_posinfo = flv->head_filepositions; newflv_posinfo; newflv_posinfo = newflv_posinfo->next) { -put_amf_double(pb, newflv_posinfo->keyframe_position + flv->keyframe_index_size); +for (i = 0; i < flv->filepositions_count; i++) { +put_amf_double(pb, flv_posinfo[i].keyframe_position + flv->keyframe_index_size); } put_amf_string(pb, "times"); put_amf_dword_array(pb, flv->filepositions_count); -for (newflv_posinfo = flv->head_filepositions; newflv_posinfo; newflv_posinfo = newflv_posinfo->next) { -put_amf_double(pb, newflv_posinfo->keyframe_timestamp); +for (i = 0; i < flv->filepositions_count; i++) { +put_amf_double(pb, flv_posinfo[i].keyframe_timestamp); } -newflv_posinfo = flv->head_filepositions; -while (newflv_posinfo) { -p = newflv_posinfo->next; -if (p) { -newflv_posinfo->next = p->next; -av_free(p); -p = NULL; -} else { -av_free(newflv_posinfo); -newflv_posinfo = NULL; -} -} +av_freep(&flv->filepositions); put_amf_string(pb, ""); avio_w8(pb, AMF_END_OF_OBJECT); -- 2.20.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".
Re: [FFmpeg-devel] [PATCH] Support for zulu timezone format for PDT in HLS playlists
Completely agree, just worried that it might cause incompatibility issues from some users down the line. On the other hand, Unified Streaming is always using UTC timestamps on their PDT: https://docs.unified-streaming.com/documentation/live/recommended-settings.html#timecode This would make the whole thing a lot easier and could remove most of the code bloat in ff_hls_write_file_entry that's dealing with timestamps. Also thinking of just sending all HLSContext::flags into the ff_hls_write_file_entry function and masking out the needed bits inside. This function takes too many arguments in my opinion, but that's for another day :) I'm preparing a couple of patches that I'll share in this thread and we can take it from there. Ole Andre Birkedal ‐‐‐ Original Message ‐‐‐ On Thursday, October 24, 2019 5:41 PM, Marton Balint wrote: > > > On Thu, 24 Oct 2019, Ole Andre Birkedal wrote: > > > This is something that Akamai requires for their MSL4 product when > > ingesting HLS and using it to generate clips on their CDN. It's also > > something required by one of our customers, but we don't know the exact > > reason of why they require this. I'll update the patch with a better > > commit message explaining these things. > > Having a setting for choosing to use UTC and then by default presenting > > it in the Z format is a good idea! Always using UTC should not be on by > > default though, even if I think that's the best way to present > > timestamps, there could be users who depend on it being non-UTC. > > So to recap > > > > 1. By default USE Zulu time on + UTC timestamps in PDT, but can be > > configured OFF. > > 2. Add an option for using UTC timezone in PDT, by default OFF. > > If the incompatibility you experience can be fixed by using option 2, then > I'd rather not add a flag for option 1... I don't have a strong preference > though. > > Regards, > Marton > > > Just realising that this also bleeds into the CMAF muxer in DASH, will > > investigate what can be done to support similar settings there. > > Thanks for the feedback, > > Ole Andre Birkedal > > ‐‐‐ Original Message ‐‐‐ > > On Wednesday, October 23, 2019 2:50 PM, Marton Balint c...@passwd.hu wrote: > > > > > On Wed, 23 Oct 2019, Marton Balint wrote: > > > > > > > On Wed, 23 Oct 2019, Ole Andre Birkedal wrote: > > > > > > > > > Thanks for the feedback, attached new complete patch with code > > > > > changes + > > > > > added documentation for it > > > > > > > > Please also explain why this might be required in the docs. In the > > > > commit > > > > message please name the specific vendor/device which is not parsing zero > > > > offset correctly. > > > > I wonder if it would make sense to set this flag by default (doing that > > > > can be a separate patch) if it improves compatiblity. > > > > > > One more idea is that maybe we should introduce a flag which always puts > > > the timestamp in UTC instead? Otherwise your approach only works if the > > > local time is UTC, no? > > > Thanks, > > > Marton > > > > > > > Thanks, > > > > Marton > > > > > > > > > Ole > > > > > ‐‐‐ Original Message ‐‐‐ > > > > > On Wednesday, October 23, 2019 4:32 AM, Steven Liu > > > > > l...@chinaffmpeg.org > > > > > wrote: > > > > > > > > > > > > 在 2019年10月22日,18:37,Ole Andre Birkedal birke...@extab.net 写道: > > > > > > > Some HLS players prefer UTC+0 timestamps in PROGRAM-DATE-TIME to > > > > > > > end in a > > > > > > > Z instead of +, this patch adds a hlsflag to enable that > > > > > > > feature. > > > > > > > > > > > > Example command: > > > > > > > ffmpeg -i input.mp4 -c copy -hls_flags > > > > > > > +program_date_time+zulu_timezone > > > > > > > output.m3u8 > > > > > > > > > > > > Example PDT output: > > > > > > > #EXT-X-PROGRAM-DATE-TIME:2019-10-22T10:27:54.000Z > > > > > > > Ole Andre > > > > > > > Birkedal___ > > > > > > > > > > > Document doc/muxer.texi please. > > > > > > > > > > > > > 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". > > > > > > > > > > > > Thanks > > > > > > Steven > > > > > > 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 mailing list > > > ffmpeg-devel@ffmpeg.org > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > To unsubscribe, visit link above, or email > > > ff
Re: [FFmpeg-devel] [PATCH] add phqm filter and img_hash
Am Fr., 25. Okt. 2019 um 02:24 Uhr schrieb : > +// convert from avframe to iplimage format > +static void fill_iplimage_from_frame(IplImage *img, const AVFrame *frame, > enum AVPixelFormat pixfmt) > +{ > +IplImage *tmpimg; > +int depth, channels_nb; > + > +if (pixfmt == AV_PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; > channels_nb = 1; } > +else if (pixfmt == AV_PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; > channels_nb = 4; } > +else if (pixfmt == AV_PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; > channels_nb = 3; } > +else if (pixfmt == AV_PIX_FMT_YUV420P) { depth = IPL_DEPTH_8U; > channels_nb = 3; } > +else return; > + > +tmpimg = cvCreateImageHeader((CvSize){frame->width, frame->height}, > depth, channels_nb); > +*img = *tmpimg; > +img->imageData = img->imageDataOrigin = (char *) frame->data[0]; How did you test YUV420P? Carl Eugen ___ 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 1/2] avfilter/vf_lut3d: allocate 3d lut dynamically
Signed-off-by: Paul B Mahol --- libavfilter/vf_lut3d.c | 165 +++-- 1 file changed, 108 insertions(+), 57 deletions(-) diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c index a525039baa..8ef1bb7385 100644 --- a/libavfilter/vf_lut3d.c +++ b/libavfilter/vf_lut3d.c @@ -65,8 +65,9 @@ typedef struct LUT3DContext { int step; avfilter_action_func *interp; struct rgbvec scale; -struct rgbvec lut[MAX_LEVEL][MAX_LEVEL][MAX_LEVEL]; +struct rgbvec *lut; int lutsize; +int lutsize2; #if CONFIG_HALDCLUT_FILTER uint8_t clut_rgba_map[4]; int clut_step; @@ -113,7 +114,7 @@ static inline struct rgbvec lerp(const struct rgbvec *v0, const struct rgbvec *v static inline struct rgbvec interp_nearest(const LUT3DContext *lut3d, const struct rgbvec *s) { -return lut3d->lut[NEAR(s->r)][NEAR(s->g)][NEAR(s->b)]; +return lut3d->lut[NEAR(s->r) * lut3d->lutsize2 + NEAR(s->g) * lut3d->lutsize + NEAR(s->b)]; } /** @@ -123,17 +124,19 @@ static inline struct rgbvec interp_nearest(const LUT3DContext *lut3d, static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d, const struct rgbvec *s) { +const int lutsize2 = lut3d->lutsize2; +const int lutsize = lut3d->lutsize; const int prev[] = {PREV(s->r), PREV(s->g), PREV(s->b)}; const int next[] = {NEXT(s->r), NEXT(s->g), NEXT(s->b)}; const struct rgbvec d = {s->r - prev[0], s->g - prev[1], s->b - prev[2]}; -const struct rgbvec c000 = lut3d->lut[prev[0]][prev[1]][prev[2]]; -const struct rgbvec c001 = lut3d->lut[prev[0]][prev[1]][next[2]]; -const struct rgbvec c010 = lut3d->lut[prev[0]][next[1]][prev[2]]; -const struct rgbvec c011 = lut3d->lut[prev[0]][next[1]][next[2]]; -const struct rgbvec c100 = lut3d->lut[next[0]][prev[1]][prev[2]]; -const struct rgbvec c101 = lut3d->lut[next[0]][prev[1]][next[2]]; -const struct rgbvec c110 = lut3d->lut[next[0]][next[1]][prev[2]]; -const struct rgbvec c111 = lut3d->lut[next[0]][next[1]][next[2]]; +const struct rgbvec c000 = lut3d->lut[prev[0] * lutsize2 + prev[1] * lutsize + prev[2]]; +const struct rgbvec c001 = lut3d->lut[prev[0] * lutsize2 + prev[1] * lutsize + next[2]]; +const struct rgbvec c010 = lut3d->lut[prev[0] * lutsize2 + next[1] * lutsize + prev[2]]; +const struct rgbvec c011 = lut3d->lut[prev[0] * lutsize2 + next[1] * lutsize + next[2]]; +const struct rgbvec c100 = lut3d->lut[next[0] * lutsize2 + prev[1] * lutsize + prev[2]]; +const struct rgbvec c101 = lut3d->lut[next[0] * lutsize2 + prev[1] * lutsize + next[2]]; +const struct rgbvec c110 = lut3d->lut[next[0] * lutsize2 + next[1] * lutsize + prev[2]]; +const struct rgbvec c111 = lut3d->lut[next[0] * lutsize2 + next[1] * lutsize + next[2]]; const struct rgbvec c00 = lerp(&c000, &c100, d.r); const struct rgbvec c10 = lerp(&c010, &c110, d.r); const struct rgbvec c01 = lerp(&c001, &c101, d.r); @@ -151,48 +154,50 @@ static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d, static inline struct rgbvec interp_tetrahedral(const LUT3DContext *lut3d, const struct rgbvec *s) { +const int lutsize2 = lut3d->lutsize2; +const int lutsize = lut3d->lutsize; const int prev[] = {PREV(s->r), PREV(s->g), PREV(s->b)}; const int next[] = {NEXT(s->r), NEXT(s->g), NEXT(s->b)}; const struct rgbvec d = {s->r - prev[0], s->g - prev[1], s->b - prev[2]}; -const struct rgbvec c000 = lut3d->lut[prev[0]][prev[1]][prev[2]]; -const struct rgbvec c111 = lut3d->lut[next[0]][next[1]][next[2]]; +const struct rgbvec c000 = lut3d->lut[prev[0] * lutsize2 + prev[1] * lutsize + prev[2]]; +const struct rgbvec c111 = lut3d->lut[next[0] * lutsize2 + next[1] * lutsize + next[2]]; struct rgbvec c; if (d.r > d.g) { if (d.g > d.b) { -const struct rgbvec c100 = lut3d->lut[next[0]][prev[1]][prev[2]]; -const struct rgbvec c110 = lut3d->lut[next[0]][next[1]][prev[2]]; +const struct rgbvec c100 = lut3d->lut[next[0] * lutsize2 + prev[1] * lutsize + prev[2]]; +const struct rgbvec c110 = lut3d->lut[next[0] * lutsize2 + next[1] * lutsize + prev[2]]; c.r = (1-d.r) * c000.r + (d.r-d.g) * c100.r + (d.g-d.b) * c110.r + (d.b) * c111.r; c.g = (1-d.r) * c000.g + (d.r-d.g) * c100.g + (d.g-d.b) * c110.g + (d.b) * c111.g; c.b = (1-d.r) * c000.b + (d.r-d.g) * c100.b + (d.g-d.b) * c110.b + (d.b) * c111.b; } else if (d.r > d.b) { -const struct rgbvec c100 = lut3d->lut[next[0]][prev[1]][prev[2]]; -const struct rgbvec c101 = lut3d->lut[next[0]][prev[1]][next[2]]; +const struct rgbvec c100 = lut3d->lut[next[0] * lutsize2 + prev[1] * lutsize + prev[2]]; +const struct rgbvec c101 = lu
[FFmpeg-devel] [PATCH 2/2] avfilter/vf_lut3d: increase max level to upper limit defined by cube format specification
Signed-off-by: Paul B Mahol --- libavfilter/vf_lut3d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c index 8ef1bb7385..edaf9a711e 100644 --- a/libavfilter/vf_lut3d.c +++ b/libavfilter/vf_lut3d.c @@ -55,7 +55,7 @@ struct rgbvec { /* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT * of 512x512 (64x64x64) */ -#define MAX_LEVEL 128 +#define MAX_LEVEL 256 typedef struct LUT3DContext { const AVClass *class; -- 2.17.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".
Re: [FFmpeg-devel] [PATCH] Support for zulu timezone format for PDT in HLS playlists
I think this is the best solution, with just one new flag +utc_pdt that will force timestamps of PDT to be in UTC with the format -MM-DDThh:mm:ssZ. Too many flags will be confusing, and the "zulu" name can be a bit confusing so I removed any mention of that. Ole Andre Birkedal ‐‐‐ Original Message ‐‐‐ On Friday, October 25, 2019 11:26 AM, Ole Andre Birkedal wrote: > Completely agree, just worried that it might cause incompatibility issues > from some users down the line. > > On the other hand, Unified Streaming is always using UTC timestamps on their > PDT: > https://docs.unified-streaming.com/documentation/live/recommended-settings.html#timecode > > This would make the whole thing a lot easier and could remove most of the > code bloat in ff_hls_write_file_entry that's dealing with timestamps. > > Also thinking of just sending all HLSContext::flags into the > ff_hls_write_file_entry function and masking out the needed bits inside. This > function takes too many arguments in my opinion, but that's for another day :) > > I'm preparing a couple of patches that I'll share in this thread and we can > take it from there. > > Ole Andre Birkedal > > ‐‐‐ Original Message ‐‐‐ > On Thursday, October 24, 2019 5:41 PM, Marton Balint c...@passwd.hu wrote: > > > On Thu, 24 Oct 2019, Ole Andre Birkedal wrote: > > > > > This is something that Akamai requires for their MSL4 product when > > > ingesting HLS and using it to generate clips on their CDN. It's also > > > something required by one of our customers, but we don't know the exact > > > reason of why they require this. I'll update the patch with a better > > > commit message explaining these things. > > > Having a setting for choosing to use UTC and then by default presenting > > > it in the Z format is a good idea! Always using UTC should not be on by > > > default though, even if I think that's the best way to present > > > timestamps, there could be users who depend on it being non-UTC. > > > So to recap > > > > > > 1. By default USE Zulu time on + UTC timestamps in PDT, but can be > > > configured OFF. > > > 2. Add an option for using UTC timezone in PDT, by default OFF. > > > > If the incompatibility you experience can be fixed by using option 2, then > > I'd rather not add a flag for option 1... I don't have a strong preference > > though. > > Regards, > > Marton > > > > > Just realising that this also bleeds into the CMAF muxer in DASH, will > > > investigate what can be done to support similar settings there. > > > Thanks for the feedback, > > > Ole Andre Birkedal > > > ‐‐‐ Original Message ‐‐‐ > > > On Wednesday, October 23, 2019 2:50 PM, Marton Balint c...@passwd.hu > > > wrote: > > > > > > > On Wed, 23 Oct 2019, Marton Balint wrote: > > > > > > > > > On Wed, 23 Oct 2019, Ole Andre Birkedal wrote: > > > > > > > > > > > Thanks for the feedback, attached new complete patch with code > > > > > > changes + > > > > > > added documentation for it > > > > > > > > > > Please also explain why this might be required in the docs. In the > > > > > commit > > > > > message please name the specific vendor/device which is not parsing > > > > > zero > > > > > offset correctly. > > > > > I wonder if it would make sense to set this flag by default (doing > > > > > that > > > > > can be a separate patch) if it improves compatiblity. > > > > > > > > One more idea is that maybe we should introduce a flag which always puts > > > > the timestamp in UTC instead? Otherwise your approach only works if the > > > > local time is UTC, no? > > > > Thanks, > > > > Marton > > > > > > > > > Thanks, > > > > > Marton > > > > > > > > > > > Ole > > > > > > ‐‐‐ Original Message ‐‐‐ > > > > > > On Wednesday, October 23, 2019 4:32 AM, Steven Liu > > > > > > l...@chinaffmpeg.org > > > > > > wrote: > > > > > > > > > > > > > > 在 2019年10月22日,18:37,Ole Andre Birkedal birke...@extab.net 写道: > > > > > > > > Some HLS players prefer UTC+0 timestamps in PROGRAM-DATE-TIME > > > > > > > > to end in a > > > > > > > > Z instead of +, this patch adds a hlsflag to enable that > > > > > > > > feature. > > > > > > > > > > > > > > Example command: > > > > > > > > ffmpeg -i input.mp4 -c copy -hls_flags > > > > > > > > +program_date_time+zulu_timezone > > > > > > > > output.m3u8 > > > > > > > > > > > > > > Example PDT output: > > > > > > > > #EXT-X-PROGRAM-DATE-TIME:2019-10-22T10:27:54.000Z > > > > > > > > Ole Andre > > > > > > > > Birkedal___ > > > > > > > > > > > > > Document doc/muxer.texi please. > > > > > > > > > > > > > > > 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". > > > > > > > > > > > > > > Thanks > > > > > > > Steven > > > > > > > ffmpeg-devel mailing list > > > > > > > ffmpe
Re: [FFmpeg-devel] [PATCH] web/download: general improvements
On Thu, Oct 24, 2019 at 9:35 PM Lou Logan wrote: > On Tue, Oct 22, 2019, at 10:05 AM, Paul B Mahol wrote: > > probably ok > > Pushed b293ec7188b6b39ac769f358a2f4a95d0a49c1b7. > > Now giant download button is more giant, but I will adjust the CSS. I would recommend adding the following to the button's CSS, wrapping the button to multiple lines on smaller screens: white-space: normal; -- db0 - https://db0.company/ ___ 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 3/3] avcodec/interplayacm: Fix overflow of last unused value
Fixes: signed integer overflow: -2147450880 - 65535 cannot be represented in type 'int' Fixes: 18393/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_ACM_fuzzer-5667520110919680 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/interplayacm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c index cff79eb6b2..3704d1a2f2 100644 --- a/libavcodec/interplayacm.c +++ b/libavcodec/interplayacm.c @@ -529,7 +529,7 @@ static int decode_block(InterplayACMContext *s) for (i = 1, x = -val; i <= count; i++) { s->midbuf[-i] = x; -x -= val; +x -= (unsigned)val; } ret = fill_block(s); -- 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] [PATCH 1/3] avcodec/cook: Move up and extend block_align check
Fixes: signed integer overflow: 2046820356 * 8 cannot be represented in type 'int' Fixes: 18391/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5631674666188800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cook.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index aa11205166..401dbfd33c 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1075,6 +1075,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } +if (avctx->block_align >= INT_MAX / 8 || avctx->block_align < 0) +return AVERROR(EINVAL); + /* Initialize RNG. */ av_lfg_init(&q->random_state, 0); @@ -1225,10 +1228,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) if ((ret = init_cook_vlc_tables(q))) return ret; - -if (avctx->block_align >= UINT_MAX / 2) -return AVERROR(EINVAL); - /* Pad the databuffer with: DECODE_BYTES_PAD1 or DECODE_BYTES_PAD2 for decode_bytes(), AV_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */ -- 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] [PATCH 2/3] avcodec/adpcm: Fix undefined behavior with negative predictions in IMA OKI
Fixes: left shift of negative value -30 Fixes: 18392/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_OKI_fuzzer-5631771831435264 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/adpcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index a8e74522b3..373115df75 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -342,7 +342,7 @@ static inline int16_t adpcm_ima_oki_expand_nibble(ADPCMChannelStatus *c, int nib c->predictor = av_clip_intp2(predictor, 11); c->step_index = step_index; -return c->predictor << 4; +return c->predictor * 16; } static inline int16_t adpcm_ct_expand_nibble(ADPCMChannelStatus *c, int8_t nibble) -- 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] avfilter/af_anlmdn: Remove threading flag
On Fri, 25. Oct 09:47, Paul B Mahol wrote: > Not OK, there is threading in filter. See execute call. sorry, missed this one. -- Andriy ___ 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] avutil/avstring: replace with system interface if dirname and basename functions are detected
On Fri, Oct 25, 2019 at 09:51:33AM +0200, Paul B Mahol wrote: > On 10/25/19, Limin Wang wrote: > > On Wed, Oct 23, 2019 at 06:07:24PM +0200, Paul B Mahol wrote: > >> Why? > >> > > Sorry, I haven't get your question, you mean why to use system > > standard c lib API? > > What are gains? Our implementation haven't handle some corner case, one example is the check for trailing slash characters.The system library interface is widely used by most applications, and bugs should be less. > > > > >> On 10/23/19, lance.lmw...@gmail.com wrote: > >> > From: Limin Wang > >> > > >> > Signed-off-by: Limin Wang > >> > --- > >> > configure| 4 > >> > libavutil/avstring.c | 13 - > >> > 2 files changed, 16 insertions(+), 1 deletion(-) > >> > > >> > diff --git a/configure b/configure > >> > index 8413826..5296a4c 100755 > >> > --- a/configure > >> > +++ b/configure > >> > @@ -2188,6 +2188,8 @@ SYSTEM_FUNCS=" > >> > clock_gettime > >> > closesocket > >> > CommandLineToArgvW > >> > +dirname > >> > +basename > >> > fcntl > >> > getaddrinfo > >> > gethrtime > >> > @@ -5980,6 +5982,8 @@ check_func access > >> > check_func_headers stdlib.h arc4random > >> > check_lib clock_gettime time.h clock_gettime || check_lib > >> > clock_gettime > >> > time.h clock_gettime -lrt > >> > check_func fcntl > >> > +check_func_headers libgen.h dirname > >> > +check_func_headers libgen.h basename > >> > check_func fork > >> > check_func gethrtime > >> > check_func getopt > >> > diff --git a/libavutil/avstring.c b/libavutil/avstring.c > >> > index 76a13ba..66654fb 100644 > >> > --- a/libavutil/avstring.c > >> > +++ b/libavutil/avstring.c > >> > @@ -19,12 +19,15 @@ > >> > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > >> > 02110-1301 > >> > USA > >> > */ > >> > > >> > +#include "config.h" > >> > #include > >> > #include > >> > #include > >> > #include > >> > +#if defined(HAVE_DIRNAME) || defined(HAVE_BASENAME) > >> > +#include > >> > +#endif > >> > > >> > -#include "config.h" > >> > #include "common.h" > >> > #include "mem.h" > >> > #include "avassert.h" > >> > @@ -257,6 +260,9 @@ char *av_strireplace(const char *str, const char > >> > *from, > >> > const char *to) > >> > > >> > const char *av_basename(const char *path) > >> > { > >> > +#if HAVE_BASENAME > >> > +return basename((char*)path); > >> > +#else > >> > char *p; > >> > > >> > if (!path || *path == '\0') > >> > @@ -274,10 +280,14 @@ const char *av_basename(const char *path) > >> > return path; > >> > > >> > return p + 1; > >> > +#endif > >> > } > >> > > >> > const char *av_dirname(char *path) > >> > { > >> > +#if HAVE_DIRNAME > >> > +return dirname(path); > >> > +#else > >> > char *p = path ? strrchr(path, '/') : NULL; > >> > > >> > #if HAVE_DOS_PATHS > >> > @@ -295,6 +305,7 @@ const char *av_dirname(char *path) > >> > *p = '\0'; > >> > > >> > return path; > >> > +#endif > >> > } > >> > > >> > char *av_append_path_component(const char *path, const char *component) > >> > -- > >> > 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 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 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 v1] avcodec/v410dec: add the frame and slice threading support
From: Limin Wang 1, Test server configure: [root@localhost ~]# cat /proc/cpuinfo |grep "model name" model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz ... [root@localhost ~]# free -h totalusedfree shared buff/cache available Mem: 102G997M 93G 16M7.6G100G 2, performance profiling master: ./ffmpeg -y -stream_loop 100 -i ./test.avi -benchmark -f null - video:529kB audio:40602kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=16.932s stime=9.417s rtime=26.341s bench: maxrss=271056kB frame= 1010 fps= 38 q=-0.0 Lsize=N/A time=00:03:36.54 bitrate=N/A speed=8.22x patch applied: ./ffmpeg -y -threads 2 -thread_type slice+frame -stream_loop 100 -i ./test.avi -benchmark -f null - frame= 1010 fps= 52 q=-0.0 Lsize=N/A time=00:03:36.54 bitrate=N/A speed=11.1x video:529kB audio:40602kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=23.164s stime=10.983s rtime=19.503s bench: maxrss=338252kB ./ffmpeg -y -threads 4 -thread_type slice+frame -stream_loop 100 -i ./test.avi -benchmark -f null - frame= 1010 fps= 71 q=-0.0 Lsize=N/A time=00:03:36.54 bitrate=N/A speed=15.3x video:529kB audio:40602kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=21.610s stime=11.603s rtime=14.160s bench: maxrss=517060kB Signed-off-by: Limin Wang --- libavcodec/v410dec.c | 72 +++- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 48fab68273..7ad5eb8fb5 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -24,6 +24,13 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "internal.h" +#include "thread.h" + +typedef struct ThreadData { +AVFrame *frame; +uint8_t *buf; +int stride; +} ThreadData; static av_cold int v410_decode_init(AVCodecContext *avctx) { @@ -42,31 +49,24 @@ static av_cold int v410_decode_init(AVCodecContext *avctx) return 0; } -static int v410_decode_frame(AVCodecContext *avctx, void *data, - int *got_frame, AVPacket *avpkt) +static int v410_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int threadnr) { -AVFrame *pic = data; -uint8_t *src = avpkt->data; +ThreadData *td = arg; +AVFrame *pic = td->frame; +int stride = td->stride; +int thread_count = av_clip(avctx->thread_count, 1, avctx->height/4); +int slice_start = (avctx->height * jobnr) / thread_count; +int slice_end = (avctx->height * (jobnr+1)) / thread_count; +const uint8_t *src = td->buf + stride * slice_start; uint16_t *y, *u, *v; uint32_t val; -int i, j, ret; - -if (avpkt->size < 4 * avctx->height * avctx->width) { -av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n"); -return AVERROR(EINVAL); -} - -if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) -return ret; +int i, j; -pic->key_frame = 1; -pic->pict_type = AV_PICTURE_TYPE_I; +y = (uint16_t*)pic->data[0] + slice_start * (pic->linesize[0] >> 1); +u = (uint16_t*)pic->data[1] + slice_start * (pic->linesize[1] >> 1); +v = (uint16_t*)pic->data[2] + slice_start * (pic->linesize[2] >> 1); -y = (uint16_t *)pic->data[0]; -u = (uint16_t *)pic->data[1]; -v = (uint16_t *)pic->data[2]; - -for (i = 0; i < avctx->height; i++) { +for (i = slice_start; i < slice_end; i++) { for (j = 0; j < avctx->width; j++) { val = AV_RL32(src); @@ -82,6 +82,35 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data, v += pic->linesize[2] >> 1; } +return 0; +} + +static int v410_decode_frame(AVCodecContext *avctx, void *data, + int *got_frame, AVPacket *avpkt) +{ +ThreadData td; +ThreadFrame frame = { .f = data }; +AVFrame *pic = data; +uint8_t *src = avpkt->data; +int ret; +int thread_count = av_clip(avctx->thread_count, 1, avctx->height/4); + +td.stride = avctx->width * 4; +if (avpkt->size < 4 * avctx->height * avctx->width) { +av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n"); +return AVERROR(EINVAL); +} + +if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) +return ret; + +pic->key_frame = 1; +pic->pict_type = AV_PICTURE_TYPE_I; + +td.buf = src; +td.frame = pic; +avctx->execute2(avctx, v410_decode_slice, &td, NULL, thread_count); + *got_frame = 1; return avpkt->size; @@ -94,5 +123,6 @@ AVCodec ff_v410_decoder = { .id = AV_CODEC_ID_V410, .init = v410_decode_init, .decode = v410_decode_frame, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | +
Re: [FFmpeg-devel] [PATCH v1] avcodec/v410dec: add the frame and slice threading support
Am Fr., 25. Okt. 2019 um 17:37 Uhr schrieb : > -.capabilities = AV_CODEC_CAP_DR1, > +.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | > +AV_CODEC_CAP_FRAME_THREADS In your tests: Was slice threading or frame threading more effective? Carl Eugen ___ 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 01/14] avformat/asfenc: Remove unnecessary header
libavutil/parseutils.h has been included in 22bbd6e8 for av_parse_time() and the header has not been removed when said function was replaced by ff_parse_creation_time_metadata() in ea1bf08a. Signed-off-by: Andreas Rheinhardt --- libavformat/asfenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 3cfe75a5d5..9f54173bf9 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -22,7 +22,6 @@ #include "libavutil/avassert.h" #include "libavutil/dict.h" #include "libavutil/mathematics.h" -#include "libavutil/parseutils.h" #include "libavutil/opt.h" #include "avformat.h" #include "avlanguage.h" -- 2.20.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 03/14] avformat/av1: Remove superfluous header
8d5604a6 added libavcodec/profiles.h, yet this header was not used, as the FF_PROFILE_AV1_* defines are contained in libavcodec/avcodec.h. Signed-off-by: Andreas Rheinhardt --- libavformat/av1.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/av1.c b/libavformat/av1.c index b36c5e44ba..6f741f2bd5 100644 --- a/libavformat/av1.c +++ b/libavformat/av1.c @@ -22,7 +22,6 @@ #include "libavutil/mem.h" #include "libavcodec/av1.h" #include "libavcodec/av1_parse.h" -#include "libavcodec/profiles.h" #include "libavcodec/put_bits.h" #include "av1.h" #include "avio.h" -- 2.20.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 04/14] avformat/avidec: Remove superfluous header
bswap.h was included since 7b114c09, yet since 3788a3c0 no explicit use of anything from bswap.h has been made, so remove this header. (Only AV_RL32 is used and while this might imply swapping on big-endian systems, it is contained in libavutil/intreadwrite.h.) Signed-off-by: Andreas Rheinhardt --- (I of course know that intreadwrite includes bswap.) libavformat/avidec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 1ca26968fa..5cf67a4771 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -23,7 +23,6 @@ #include "libavutil/avassert.h" #include "libavutil/avstring.h" -#include "libavutil/bswap.h" #include "libavutil/opt.h" #include "libavutil/dict.h" #include "libavutil/internal.h" -- 2.20.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 05/14] avformat/avienc: Remove superfluous header
04d2540c added intreadwrite.h to avienc.c, although there was (and is) no need to do so. The inclusion seems to be a mistake as this commit added a AV_WL32 to avidec.c. Signed-off-by: Andreas Rheinhardt --- libavformat/avienc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 5f143bccce..940ea33510 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -31,7 +31,6 @@ #include "libavutil/avstring.h" #include "libavutil/avutil.h" #include "libavutil/internal.h" -#include "libavutil/intreadwrite.h" #include "libavutil/dict.h" #include "libavutil/avassert.h" #include "libavutil/timestamp.h" -- 2.20.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 02/14] avformat/assdec: Remove unnecessary header
libavcodec/internal.h has been included since 36e61e24/67286fa9 for avpriv_bprint_to_extradata(). The latter function has been replaced by ff_bprint_to_codecpar_extradata() in 6f69f7a8, making the header superfluous. Signed-off-by: Andreas Rheinhardt --- libavformat/assdec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/assdec.c b/libavformat/assdec.c index f66b296673..2e7d100a5b 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -25,7 +25,6 @@ #include "avformat.h" #include "internal.h" #include "subtitles.h" -#include "libavcodec/internal.h" #include "libavutil/bprint.h" typedef struct ASSContext { -- 2.20.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 07/14] avformat/concatdec: Remove superfluous headers
50ed6e3c added several asserts and the relevant header to concatdec.c; 14e09244 removed these asserts, but forgot to remove the header. Signed-off-by: Andreas Rheinhardt --- libavformat/concatdec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index b80294efbf..3d5f149e69 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -18,7 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/intreadwrite.h" -- 2.20.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 06/14] avformat/bintext: Remove superfluous header
15d838b7 included libavutil/parseutils.h in order to use av_parse_video_size(); the latter function isn't used any more since 33b6d215, so the header can be removed. Signed-off-by: Andreas Rheinhardt --- libavformat/bintext.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/bintext.c b/libavformat/bintext.c index 61b89f56d6..1a99e69852 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -32,7 +32,6 @@ #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" -#include "libavutil/parseutils.h" #include "avformat.h" #include "internal.h" #include "sauce.h" -- 2.20.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 14/14] avformat/aiffdec: Remove superfluous headers
aiffdec.c calls ff_mov_read_chan() whose declaration was in isom.h until c4dba58f; from that commit onwards, isom.h was not needed anymore, yet it hasn't been removed. libavutil/mathematics.h has been included in 3383a53e for ldexp(), but this function and the whole header isn't used any more since 70af8a5e. Signed-off-by: Andreas Rheinhardt --- libavformat/aiffdec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index a42987c15f..ab422e5b8d 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -20,13 +20,11 @@ */ #include "libavutil/intreadwrite.h" -#include "libavutil/mathematics.h" #include "libavutil/dict.h" #include "avformat.h" #include "internal.h" #include "pcm.h" #include "aiff.h" -#include "isom.h" #include "id3v2.h" #include "mov_chan.h" #include "replaygain.h" -- 2.20.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 10/14] avformat/dvenc: Remove superfluous header
75af0e6a added opt.h to dvenc.c for an option; 6b35f1a2 removed said option, yet forgot to remove the header as well. Signed-off-by: Andreas Rheinhardt --- libavformat/dvenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 93c103b316..8eb58cf43a 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -39,7 +39,6 @@ #include "libavutil/fifo.h" #include "libavutil/mathematics.h" #include "libavutil/intreadwrite.h" -#include "libavutil/opt.h" #include "libavutil/timecode.h" #define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32-bit audio -- 2.20.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 09/14] avformat/ass: Remove superfluous headers
Both attributes.h and bswap.h have been included from the very beginning of this muxer without there being any reason to do so. Signed-off-by: Andreas Rheinhardt --- libavformat/dss.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/dss.c b/libavformat/dss.c index e5b0be9deb..d7f9cafe47 100644 --- a/libavformat/dss.c +++ b/libavformat/dss.c @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/attributes.h" -#include "libavutil/bswap.h" #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" -- 2.20.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 13/14] iavformat/apetag: Remove superfluous header
When the APE tag parsing code was moved into its own file in 191e34cd, intreadwrite.h was included despite not being used for parsing APE tags. Signed-off-by: Andreas Rheinhardt --- libavformat/apetag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 8cb3f4a23a..9fb12b9826 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -22,7 +22,6 @@ #include -#include "libavutil/intreadwrite.h" #include "libavutil/dict.h" #include "avformat.h" #include "avio_internal.h" -- 2.20.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 11/14] avformat/fifo_test: Remove superfluous header
avassert.h has been simply copied over when libavformat/fifo_test.c was split from libavformat/tests/fifo_muxer.c. Signed-off-by: Andreas Rheinhardt --- libavformat/fifo_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/fifo_test.c b/libavformat/fifo_test.c index 02ec215cbb..7c58a78e0e 100644 --- a/libavformat/fifo_test.c +++ b/libavformat/fifo_test.c @@ -23,7 +23,6 @@ #include "libavutil/opt.h" #include "libavutil/time.h" -#include "libavutil/avassert.h" #include "avformat.h" #include "url.h" -- 2.20.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 08/14] avformat/dash: Remove superfluous headers
They have simply been copied when dashenc.c was split up in 837580f4. Signed-off-by: Andreas Rheinhardt --- libavformat/dash.c | 17 - 1 file changed, 17 deletions(-) diff --git a/libavformat/dash.c b/libavformat/dash.c index d2501f013a..168cd3c548 100644 --- a/libavformat/dash.c +++ b/libavformat/dash.c @@ -19,26 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config.h" -#if HAVE_UNISTD_H -#include -#endif - -#include "libavutil/avassert.h" #include "libavutil/avstring.h" -#include "libavutil/intreadwrite.h" -#include "libavutil/mathematics.h" -#include "libavutil/opt.h" -#include "libavutil/rational.h" -#include "libavutil/time_internal.h" -#include "avc.h" #include "avformat.h" -#include "avio_internal.h" -#include "internal.h" -#include "isom.h" -#include "os_support.h" -#include "url.h" #include "dash.h" static DASHTmplId dash_read_tmpl_id(const char *identifier, char *format_tag, -- 2.20.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 12/14] avformat/filmstripdec/enc: Remove superfluous header
Since their inception, the filmstrip muxer and demuxer included intreadwrite.h; it was unneeded all the time. Signed-off-by: Andreas Rheinhardt --- libavformat/filmstripdec.c | 1 - libavformat/filmstripenc.c | 1 - 2 files changed, 2 deletions(-) diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c index 0bf5a80830..dcd77a82b6 100644 --- a/libavformat/filmstripdec.c +++ b/libavformat/filmstripdec.c @@ -24,7 +24,6 @@ * Adobe Filmstrip demuxer */ -#include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "avformat.h" #include "internal.h" diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c index 8ead696360..2ffe4b2c99 100644 --- a/libavformat/filmstripenc.c +++ b/libavformat/filmstripenc.c @@ -24,7 +24,6 @@ * Adobe Filmstrip muxer */ -#include "libavutil/intreadwrite.h" #include "avformat.h" #define RAND_TAG MKBETAG('R','a','n','d') -- 2.20.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".
Re: [FFmpeg-devel] [PATCH] web/download: general improvements
On Fri, Oct 25, 2019 at 01:17:16PM +0200, Deby Page wrote: > On Thu, Oct 24, 2019 at 9:35 PM Lou Logan wrote: > > On Tue, Oct 22, 2019, at 10:05 AM, Paul B Mahol wrote: > > > probably ok > > > > Pushed b293ec7188b6b39ac769f358a2f4a95d0a49c1b7. > > > > Now giant download button is more giant, but I will adjust the CSS. > > I would recommend adding the following to the button's CSS, wrapping > the button to multiple lines on smaller screens: > white-space: normal; LGTM (based on the screenshoot) thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. 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 1/2] avfilter/vf_lut3d: allocate 3d lut dynamically
On Fri, Oct 25, 2019 at 11:27:48AM +0200, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavfilter/vf_lut3d.c | 165 +++-- > 1 file changed, 108 insertions(+), 57 deletions(-) > LGTM [...] -- Clément B. ___ 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 3/4] avformat/flvenc: Use array instead of linked list for index
On Fri, Oct 25, 2019 at 11:11:46AM +0200, Andreas Rheinhardt wrote: > Using a linked list had very much overhead (the pointer to the next > entry increased the size of the index entry struct from 16 to 24 bytes, > not to mention the overhead of having separate allocations), so it is > better to (re)allocate a continuous array for the index. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/flvenc.c | 58 +++- > 1 file changed, 19 insertions(+), 39 deletions(-) > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > index 0e6c66a5ff..a2bd791c59 100644 > --- a/libavformat/flvenc.c > +++ b/libavformat/flvenc.c > @@ -74,7 +74,6 @@ typedef enum { > typedef struct FLVFileposition { > int64_t keyframe_position; > double keyframe_timestamp; > -struct FLVFileposition *next; > } FLVFileposition; > > typedef struct FLVContext { > @@ -108,9 +107,9 @@ typedef struct FLVContext { > int acurframeindex; > int64_t keyframes_info_offset; > > -int64_t filepositions_count; > FLVFileposition *filepositions; > -FLVFileposition *head_filepositions; > +size_t filepositions_allocated; > +int64_t filepositions_count; > > AVCodecParameters *audio_par; > AVCodecParameters *video_par; > @@ -549,27 +548,19 @@ static void flv_write_codec_header(AVFormatContext* s, > AVCodecParameters* par, i > > static int flv_append_keyframe_info(AVFormatContext *s, FLVContext *flv, > double ts, int64_t pos) > { > -FLVFileposition *position = av_malloc(sizeof(FLVFileposition)); > - > -if (!position) { > -av_log(s, AV_LOG_WARNING, "no mem for add keyframe index!\n"); > -return AVERROR(ENOMEM); > -} > - > -position->keyframe_timestamp = ts; > -position->keyframe_position = pos; > - > -if (!flv->filepositions_count) { > -flv->filepositions = position; > -flv->head_filepositions = flv->filepositions; > -position->next = NULL; > -} else { > -flv->filepositions->next = position; > -position->next = NULL; > -flv->filepositions = flv->filepositions->next; > +if (flv->filepositions_count >= flv->filepositions_allocated) { > +void *pos = av_realloc_array(flv->filepositions, > + 2 * flv->filepositions_allocated + 1, > + sizeof(*flv->filepositions)); can the 2* overflow ? av_fast_realloc() would check for that i wonder if a av_fast_realloc_array() would make sense thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Never trust a computer, one day, it may think you are the virus. -- Compn 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 05/14] avformat/avienc: Remove superfluous header
On Fri, Oct 25, 2019 at 08:07:37PM +0200, Andreas Rheinhardt wrote: > 04d2540c added intreadwrite.h to avienc.c, although there was (and is) > no need to do so. The inclusion seems to be a mistake as this commit > added a AV_WL32 to avidec.c. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/avienc.c | 1 - > 1 file changed, 1 deletion(-) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Awnsering whenever a program halts or runs forever is On a turing machine, in general impossible (turings halting problem). On any real computer, always possible as a real computer has a finite number of states N, and will either halt in less than N cycles or never halt. signature.asc Description: 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 01/14] avformat/asfenc: Remove unnecessary header
On Fri, Oct 25, 2019 at 08:07:33PM +0200, Andreas Rheinhardt wrote: > libavutil/parseutils.h has been included in 22bbd6e8 for av_parse_time() > and the header has not been removed when said function was replaced by > ff_parse_creation_time_metadata() in ea1bf08a. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/asfenc.c | 1 - > 1 file changed, 1 deletion(-) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle signature.asc Description: 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 04/14] avformat/avidec: Remove superfluous header
On Fri, Oct 25, 2019 at 08:07:36PM +0200, Andreas Rheinhardt wrote: > bswap.h was included since 7b114c09, yet since 3788a3c0 no explicit use > of anything from bswap.h has been made, so remove this header. > > (Only AV_RL32 is used and while this might imply swapping on > big-endian systems, it is contained in libavutil/intreadwrite.h.) > > Signed-off-by: Andreas Rheinhardt > --- > (I of course know that intreadwrite includes bswap.) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope 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] avformat/aiffenc: Add deinit function
On Fri, Oct 25, 2019 at 03:38:07AM +0200, Andreas Rheinhardt wrote: > Prevents memleaks if the trailer is never written. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/aiffenc.c | 13 + > 1 file changed, 9 insertions(+), 4 deletions(-) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact signature.asc Description: 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 2/2] avfilter/vf_lut3d: increase max level to upper limit defined by cube format specification
On Fri, Oct 25, 2019 at 11:27:49AM +0200, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavfilter/vf_lut3d.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c > index 8ef1bb7385..edaf9a711e 100644 > --- a/libavfilter/vf_lut3d.c > +++ b/libavfilter/vf_lut3d.c > @@ -55,7 +55,7 @@ struct rgbvec { > > /* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT > * of 512x512 (64x64x64) */ > -#define MAX_LEVEL 128 > +#define MAX_LEVEL 256 > Fine with me either way but do we actually need a hard limit anymore? -- Clément B. ___ 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/4] avformat/flvenc: Forward errors from allocating keyframe index
On Fri, Oct 25, 2019 at 10:52:19AM +0200, Andreas Rheinhardt wrote: > While the function adding a new element to the keyframe index checked > the allocation, the caller didn't check the return value. This has been > changed. To do so, the return value has been changed to an ordinary ret > instead of pb->error. This doesn't pose a problem, as write_packet() in > mux.c already checks for write errors (since 9ad1e0c1). > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/flvenc.c | 16 +--- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > index fb1dede7ae..e327545dcf 100644 > --- a/libavformat/flvenc.c > +++ b/libavformat/flvenc.c > @@ -887,7 +887,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket > *pkt) > unsigned ts; > int size = pkt->size; > uint8_t *data = NULL; > -int flags = -1, flags_size, ret; > +int flags = -1, flags_size, ret = 0; > int64_t cur_offset = avio_tell(pb); > > if (par->codec_type == AVMEDIA_TYPE_AUDIO && !pkt->size) { > @@ -1055,15 +1055,17 @@ static int flv_write_packet(AVFormatContext *s, > AVPacket *pkt) > case AVMEDIA_TYPE_VIDEO: > flv->videosize += (avio_tell(pb) - cur_offset); > flv->lasttimestamp = flv->acurframeindex / flv->framerate; > +flv->acurframeindex++; > if (pkt->flags & AV_PKT_FLAG_KEY) { > -double ts = flv->acurframeindex / flv->framerate; > +double ts = flv->lasttimestamp; > int64_t pos = cur_offset; > > -flv->lastkeyframetimestamp = flv->acurframeindex / > flv->framerate; > +flv->lastkeyframetimestamp = ts; > flv->lastkeyframelocation = pos; > -flv_append_keyframe_info(s, flv, ts, pos); > +ret = flv_append_keyframe_info(s, flv, ts, pos); > +if (ret < 0) > +goto fail; > } > -flv->acurframeindex++; > break; Some of these changes look like unrelated simplifications that makes it a hair harder to see the actual change [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart then the original author, trying to rewrite it will not make it better. 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 3/4] avformat/flvenc: Use array instead of linked list for index
On Fri, Oct 25, 2019 at 05:57:44PM -0300, James Almer wrote: > On 10/25/2019 5:44 PM, Michael Niedermayer wrote: > > On Fri, Oct 25, 2019 at 11:11:46AM +0200, Andreas Rheinhardt wrote: > >> Using a linked list had very much overhead (the pointer to the next > >> entry increased the size of the index entry struct from 16 to 24 bytes, > >> not to mention the overhead of having separate allocations), so it is > >> better to (re)allocate a continuous array for the index. > >> > >> Signed-off-by: Andreas Rheinhardt > >> --- > >> libavformat/flvenc.c | 58 +++- > >> 1 file changed, 19 insertions(+), 39 deletions(-) > >> > >> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > >> index 0e6c66a5ff..a2bd791c59 100644 > >> --- a/libavformat/flvenc.c > >> +++ b/libavformat/flvenc.c > >> @@ -74,7 +74,6 @@ typedef enum { > >> typedef struct FLVFileposition { > >> int64_t keyframe_position; > >> double keyframe_timestamp; > >> -struct FLVFileposition *next; > >> } FLVFileposition; > >> > >> typedef struct FLVContext { > >> @@ -108,9 +107,9 @@ typedef struct FLVContext { > >> int acurframeindex; > >> int64_t keyframes_info_offset; > >> > >> -int64_t filepositions_count; > >> FLVFileposition *filepositions; > >> -FLVFileposition *head_filepositions; > >> +size_t filepositions_allocated; > >> +int64_t filepositions_count; > >> > >> AVCodecParameters *audio_par; > >> AVCodecParameters *video_par; > >> @@ -549,27 +548,19 @@ static void flv_write_codec_header(AVFormatContext* > >> s, AVCodecParameters* par, i > >> > >> static int flv_append_keyframe_info(AVFormatContext *s, FLVContext *flv, > >> double ts, int64_t pos) > >> { > >> -FLVFileposition *position = av_malloc(sizeof(FLVFileposition)); > >> - > >> -if (!position) { > >> -av_log(s, AV_LOG_WARNING, "no mem for add keyframe index!\n"); > >> -return AVERROR(ENOMEM); > >> -} > >> - > >> -position->keyframe_timestamp = ts; > >> -position->keyframe_position = pos; > >> - > >> -if (!flv->filepositions_count) { > >> -flv->filepositions = position; > >> -flv->head_filepositions = flv->filepositions; > >> -position->next = NULL; > >> -} else { > >> -flv->filepositions->next = position; > >> -position->next = NULL; > >> -flv->filepositions = flv->filepositions->next; > >> +if (flv->filepositions_count >= flv->filepositions_allocated) { > >> +void *pos = av_realloc_array(flv->filepositions, > >> + 2 * flv->filepositions_allocated + 1, > >> + sizeof(*flv->filepositions)); > > > > can the 2* overflow ? > > av_fast_realloc() would check for that > > i wonder if a av_fast_realloc_array() would make sense > > av_fast_realloc() doesn't do any overflow check. It only checks that the > min_size argument is below the max allowed alloc size. it does this: FFMAX(min_size + min_size / 16 + 32, min_size) which should check for the overflow. min_size is a unsigned type so overflow is defined so we can do it and check afterwards. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: 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 3/4] avformat/flvenc: Use array instead of linked list for index
On 10/25/2019 5:44 PM, Michael Niedermayer wrote: > On Fri, Oct 25, 2019 at 11:11:46AM +0200, Andreas Rheinhardt wrote: >> Using a linked list had very much overhead (the pointer to the next >> entry increased the size of the index entry struct from 16 to 24 bytes, >> not to mention the overhead of having separate allocations), so it is >> better to (re)allocate a continuous array for the index. >> >> Signed-off-by: Andreas Rheinhardt >> --- >> libavformat/flvenc.c | 58 +++- >> 1 file changed, 19 insertions(+), 39 deletions(-) >> >> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c >> index 0e6c66a5ff..a2bd791c59 100644 >> --- a/libavformat/flvenc.c >> +++ b/libavformat/flvenc.c >> @@ -74,7 +74,6 @@ typedef enum { >> typedef struct FLVFileposition { >> int64_t keyframe_position; >> double keyframe_timestamp; >> -struct FLVFileposition *next; >> } FLVFileposition; >> >> typedef struct FLVContext { >> @@ -108,9 +107,9 @@ typedef struct FLVContext { >> int acurframeindex; >> int64_t keyframes_info_offset; >> >> -int64_t filepositions_count; >> FLVFileposition *filepositions; >> -FLVFileposition *head_filepositions; >> +size_t filepositions_allocated; >> +int64_t filepositions_count; >> >> AVCodecParameters *audio_par; >> AVCodecParameters *video_par; >> @@ -549,27 +548,19 @@ static void flv_write_codec_header(AVFormatContext* s, >> AVCodecParameters* par, i >> >> static int flv_append_keyframe_info(AVFormatContext *s, FLVContext *flv, >> double ts, int64_t pos) >> { >> -FLVFileposition *position = av_malloc(sizeof(FLVFileposition)); >> - >> -if (!position) { >> -av_log(s, AV_LOG_WARNING, "no mem for add keyframe index!\n"); >> -return AVERROR(ENOMEM); >> -} >> - >> -position->keyframe_timestamp = ts; >> -position->keyframe_position = pos; >> - >> -if (!flv->filepositions_count) { >> -flv->filepositions = position; >> -flv->head_filepositions = flv->filepositions; >> -position->next = NULL; >> -} else { >> -flv->filepositions->next = position; >> -position->next = NULL; >> -flv->filepositions = flv->filepositions->next; >> +if (flv->filepositions_count >= flv->filepositions_allocated) { >> +void *pos = av_realloc_array(flv->filepositions, >> + 2 * flv->filepositions_allocated + 1, >> + sizeof(*flv->filepositions)); > > can the 2* overflow ? > av_fast_realloc() would check for that > i wonder if a av_fast_realloc_array() would make sense av_fast_realloc() doesn't do any overflow check. It only checks that the min_size argument is below the max allowed alloc size. But i agree that using it preceded by a sanity check that ensures something like "flv->filepositions_count + 1 <= INT_MAX / sizeof(*flv->filepositions)" would be more adequate than av_realloc_array() with 2*size steps. > > thx > > [...] > > > ___ > 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] ffmpeg-qsv: Is opaque memory allocation path used in ffmpeg-qsv?
On Fri, 2019-10-25 at 02:17 +, Fu, Linjie wrote: > > -Original Message- > > From: ffmpeg-devel On Behalf Of > > Rogozhkin, Dmitry V > > Sent: Friday, October 25, 2019 05:17 > > To: ffmpeg-devel@ffmpeg.org > > Subject: Re: [FFmpeg-devel] ffmpeg-qsv: Is opaque memory allocation > > path > > used in ffmpeg-qsv? > > > > On Thu, 2019-10-24 at 17:12 +0200, Max Dmitrichenko wrote: > > > Hi, > > > > > > Just have a look at any usage as: ffmpeg -hwaccel qsv ... > > > > I looked into these 3 command lines on Linux: > > > > ffmpeg -hwaccel qsv -c:v h264_qsv -i AUD_MW_E.264 \ > >-vf hwdownload,format=nv12 -pix_fmt yuv420p \ > >AUD_MW.yuv > > > > ffmpeg -hwaccel qsv -c:v h264_qsv -i AUD_MW_E.264 \ > >-c:v hevc_qsv -b:v 5M AUD_MW_E.hevc > > > > ffmpeg -init_hw_device qsv=hw \ > >-filter_hw_device hw -f rawvideo -pix_fmt \ > >yuv420p -s:v 176x144 -i AUD_MW.yuv -vf \ > >hwupload=extra_hw_frames=64,format=qsv \ > >-c:v h264_qsv -b:v 5M -frames:v 10 \ > >-y ./AUD_MW_E.h264 > > > > For what I see, none of the them is using QSV opaque memory. For > > the > > first 2 command lines ffmpeg explicitly prints (w/ -loglevel > > debug): > > > > [h264_qsv @ 0x34f6980] Decoder: output is video memory surface > > > > Besides, I checked w/ manual printfs from the code - opaque is not > > used. > > > > Hence, this question: is actually qsv opaque memory path used > > anywhere > > in ffmpeg.exe sample or in other libavcodec/libavfilter based > > applications? Is there Linux/Windows difference which I don't > > notice in > > code review? > > > > I didn't see MFX_MEMTYPE_OPAQUE_FRAME set for frames_hwctx- > >frame_type > in mainline ffmpeg application. Right. I also don't see it. I think that none of upstream ffmpeg applications actually exercise this path. This raises a concern why we have this in sources and complicate them if we don't use them? I guess most testing is done via mainline ffmpeg.exe and opaque path test coverage is likely missing meaning it might not be actually functional. If we will look from the end-user perspective, there is also opportunity to write their own applications using libavcodec/etc. libraries. In this case he will work with these 2 header files exposing QSV capabilities: ./libavcodec/qsv.h ./libavutil/hwcontext_qsv.h On this path he will be able to use the following: AVQSVFramesContext::frame_type AVQSVContext::opaque_alloc to configure QSV. Questions: 1. Is opaque memory usage limited to internal ffmpeg component connections? or it is possible to have external non-ffmpeg component connected to ffmpeg one via qsv opaque memory? 2. Does anyone actually uses the above to configure qsv opaque memory? 3. Regardless of the above: is that possible to deprecate and drop QSV opaque memory support in ffmpeg-qsv path? > > BTW, in the frame_allocator used for > MFXVideoCORE_SetFrameAllocator(), > https://github.com/FFmpeg/FFmpeg/blob/6f2a3958cfac135c60b509a61a4fd39432d8f9a9/libavcodec/qsv.c#L562 > > only MFX_MEMTYPE_INTERNAL_FRAME and MFX_MEMTYPE_EXTERNAL_FRAME is > supported as an allocation request since commit: > 4ab61cd983b539749bd621ea271624ddb5196a8e > > (For VPP, MFX_MEMTYPE_FROM_VPPIN is supported) > - linjie > ___ > 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] avfilter/vf_lut3d: increase max level to upper limit defined by cube format specification
On 10/25/19, Clément Bœsch wrote: > On Fri, Oct 25, 2019 at 11:27:49AM +0200, Paul B Mahol wrote: >> Signed-off-by: Paul B Mahol >> --- >> libavfilter/vf_lut3d.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c >> index 8ef1bb7385..edaf9a711e 100644 >> --- a/libavfilter/vf_lut3d.c >> +++ b/libavfilter/vf_lut3d.c >> @@ -55,7 +55,7 @@ struct rgbvec { >> >> /* 3D LUT don't often go up to level 32, but it is common to have a Hald >> CLUT >> * of 512x512 (64x64x64) */ >> -#define MAX_LEVEL 128 >> +#define MAX_LEVEL 256 >> > > Fine with me either way but do we actually need a hard limit anymore? > Sane maximum does not hurt. > -- > Clément B. > ___ > 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] web/download: general improvements
On Fri, Oct 25, 2019, at 3:17 AM, Deby Page wrote: > > I would recommend adding the following to the button's CSS, wrapping > the button to multiple lines on smaller screens: > white-space: normal; Thanks. Pushed, but with errors: remote: lessc --clean-css src/less/style.less > htdocs/css/style.min.css remote: Error: Cannot find module 'clean-css' ... remote: ok/Makefile:71: recipe for target 'htdocs/css/style.min.css' failed remote: make: *** [htdocs/css/style.min.css] Error 2 Temporarily screwed up the site CSS, but luckily there is a recent backup. Changed permission of style.min.css so lessc won't overwrite it again until we deal with this properly. It is lessc from the node-less repo package and not from npm. I tried installing node-clean-css in a VM, but that doesn't help (TypeError: CleanCSS is not a constructor). It worked in the VM when I installed npm and used it to install lessc and clean-css. But I didn't like the large number of npm dependencies, and don't want to use some other package management system I have no experience with. So I got lazy and edited style.min.css directly like a luddite. It's in .gitignore anyway. All of this because I wanted to edit a button text. ___ 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] avcodec/v410dec: add the frame and slice threading support
On Fri, Oct 25, 2019 at 06:39:46PM +0200, Carl Eugen Hoyos wrote: > Am Fr., 25. Okt. 2019 um 17:37 Uhr schrieb : > > > -.capabilities = AV_CODEC_CAP_DR1, > > +.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | > > +AV_CODEC_CAP_FRAME_THREADS It's related to cpu and memory very much, I recall on one of my linux system, slice thread is faster. It's using the same process with v210dec, although the patch is pending for review yet. Below is testing result on my old mac pro system with 8G memory: ./ffmpeg -y -i ~/Movies/4k_Rec709_ProResHQ.mov -c:v v410 -an -frames:v 10 ~/Movies/1.avi ./ffmpeg -y -stream_loop 100 -i ~/Movies/1.avi -benchmark -f null - frame= 1010 fps= 27 q=-0.0 Lsize=N/A time=00:00:42.08 bitrate=N/A speed=1.11x ./ffmpeg -y -threads 4 -thread_type slice -stream_loop 100 -i ~/Movies/1.avi -benchmark -f null - frame= 1010 fps= 32 q=-0.0 Lsize=N/A time=00:00:42.08 bitrate=N/A speed=1.34x ./ffmpeg -y -threads 4 -thread_type frame -stream_loop 100 -i ~/Movies/1.avi -benchmark -f null - frame= 1010 fps= 38 q=-0.0 Lsize=N/A time=00:00:42.08 bitrate=N/A speed=1.58x ./ffmpeg -y -threads 4 -thread_type frame+slice -stream_loop 100 -i ~/Movies/1.avi -benchmark -f null - frame= 1010 fps= 38 q=-0.0 Lsize=N/A time=00:00:42.08 bitrate=N/A speed=1.59x > > In your tests: Was slice threading or frame threading more effective? > > Carl Eugen > ___ > 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 v1] avfilter/asrc_anoisesrc: change type to TYPE_INT64 for color is int64_t
From: Limin Wang Or it'll cause invalid color and s->filter is NULL. Please reproduce it with below command on big endian system: $ ./ffmpeg -f lavfi -i "anoisesrc=d=60:c=1:r=48000" -f s16le -c:a pcm_s16le -f null - Segmentation fault (core dumped) Signed-off-by: Limin Wang --- libavfilter/asrc_anoisesrc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/asrc_anoisesrc.c b/libavfilter/asrc_anoisesrc.c index 78f0af4fde..8a6ef89dd1 100644 --- a/libavfilter/asrc_anoisesrc.c +++ b/libavfilter/asrc_anoisesrc.c @@ -60,9 +60,9 @@ static const AVOption anoisesrc_options[] = { { "a","set amplitude",OFFSET(amplitude), AV_OPT_TYPE_DOUBLE,{.dbl = 1.},0., 1., FLAGS }, { "duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS }, { "d","set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS }, -{ "color","set noise color", OFFSET(color), AV_OPT_TYPE_INT, {.i64 = 0}, 0, NM_NB - 1, FLAGS, "color" }, -{ "colour", "set noise color", OFFSET(color), AV_OPT_TYPE_INT, {.i64 = 0}, 0, NM_NB - 1, FLAGS, "color" }, -{ "c","set noise color", OFFSET(color), AV_OPT_TYPE_INT, {.i64 = 0}, 0, NM_NB - 1, FLAGS, "color" }, +{ "color","set noise color", OFFSET(color), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, NM_NB - 1, FLAGS, "color" }, +{ "colour", "set noise color", OFFSET(color), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, NM_NB - 1, FLAGS, "color" }, +{ "c","set noise color", OFFSET(color), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, NM_NB - 1, FLAGS, "color" }, { "white",0, 0, AV_OPT_TYPE_CONST, {.i64 = NM_WHITE}, 0, 0, FLAGS, "color" }, { "pink", 0, 0, AV_OPT_TYPE_CONST, {.i64 = NM_PINK},0, 0, FLAGS, "color" }, { "brown",0, 0, AV_OPT_TYPE_CONST, {.i64 = NM_BROWN}, 0, 0, FLAGS, "color" }, -- 2.21.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 1/4] avformat/flvenc: Forward errors from allocating keyframe index
On Fri, Oct 25, 2019 at 11:12 PM Michael Niedermayer wrote: > On Fri, Oct 25, 2019 at 10:52:19AM +0200, Andreas Rheinhardt wrote: > > While the function adding a new element to the keyframe index checked > > the allocation, the caller didn't check the return value. This has been > > changed. To do so, the return value has been changed to an ordinary ret > > instead of pb->error. This doesn't pose a problem, as write_packet() in > > mux.c already checks for write errors (since 9ad1e0c1). > > > > Signed-off-by: Andreas Rheinhardt > > --- > > libavformat/flvenc.c | 16 +--- > > 1 file changed, 9 insertions(+), 7 deletions(-) > > > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > > index fb1dede7ae..e327545dcf 100644 > > --- a/libavformat/flvenc.c > > +++ b/libavformat/flvenc.c > > @@ -887,7 +887,7 @@ static int flv_write_packet(AVFormatContext *s, > AVPacket *pkt) > > unsigned ts; > > int size = pkt->size; > > uint8_t *data = NULL; > > -int flags = -1, flags_size, ret; > > +int flags = -1, flags_size, ret = 0; > > int64_t cur_offset = avio_tell(pb); > > > > if (par->codec_type == AVMEDIA_TYPE_AUDIO && !pkt->size) { > > @@ -1055,15 +1055,17 @@ static int flv_write_packet(AVFormatContext *s, > AVPacket *pkt) > > case AVMEDIA_TYPE_VIDEO: > > flv->videosize += (avio_tell(pb) - cur_offset); > > flv->lasttimestamp = flv->acurframeindex / > flv->framerate; > > +flv->acurframeindex++; > > if (pkt->flags & AV_PKT_FLAG_KEY) { > > -double ts = flv->acurframeindex / flv->framerate; > > +double ts = flv->lasttimestamp; > > int64_t pos = cur_offset; > > > > -flv->lastkeyframetimestamp = flv->acurframeindex / > flv->framerate; > > +flv->lastkeyframetimestamp = ts; > > flv->lastkeyframelocation = pos; > > -flv_append_keyframe_info(s, flv, ts, pos); > > +ret = flv_append_keyframe_info(s, flv, ts, pos); > > +if (ret < 0) > > +goto fail; > > } > > -flv->acurframeindex++; > > break; > > Some of these changes look like unrelated simplifications > that makes it a hair harder to see the actual change > The earlier code incremented flv->acurframeindex even when the index allocation failed. I wanted to keep it that way and the easiest way to do so is to move the code incrementing it before flv_append_keyframe_info(). But this would change the values of ts and flv->lastkeyframetimestamp, so one has to change how they are derived, too. - Andreas ___ 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 3/4] avformat/flvenc: Use array instead of linked list for index
On Fri, Oct 25, 2019 at 10:44 PM Michael Niedermayer wrote: > On Fri, Oct 25, 2019 at 11:11:46AM +0200, Andreas Rheinhardt wrote: > > Using a linked list had very much overhead (the pointer to the next > > entry increased the size of the index entry struct from 16 to 24 bytes, > > not to mention the overhead of having separate allocations), so it is > > better to (re)allocate a continuous array for the index. > > > > Signed-off-by: Andreas Rheinhardt > > --- > > libavformat/flvenc.c | 58 +++- > > 1 file changed, 19 insertions(+), 39 deletions(-) > > > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > > index 0e6c66a5ff..a2bd791c59 100644 > > --- a/libavformat/flvenc.c > > +++ b/libavformat/flvenc.c > > @@ -74,7 +74,6 @@ typedef enum { > > typedef struct FLVFileposition { > > int64_t keyframe_position; > > double keyframe_timestamp; > > -struct FLVFileposition *next; > > } FLVFileposition; > > > > typedef struct FLVContext { > > @@ -108,9 +107,9 @@ typedef struct FLVContext { > > int acurframeindex; > > int64_t keyframes_info_offset; > > > > -int64_t filepositions_count; > > FLVFileposition *filepositions; > > -FLVFileposition *head_filepositions; > > +size_t filepositions_allocated; > > +int64_t filepositions_count; > > > > AVCodecParameters *audio_par; > > AVCodecParameters *video_par; > > @@ -549,27 +548,19 @@ static void > flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i > > > > static int flv_append_keyframe_info(AVFormatContext *s, FLVContext > *flv, double ts, int64_t pos) > > { > > -FLVFileposition *position = av_malloc(sizeof(FLVFileposition)); > > - > > -if (!position) { > > -av_log(s, AV_LOG_WARNING, "no mem for add keyframe index!\n"); > > -return AVERROR(ENOMEM); > > -} > > - > > -position->keyframe_timestamp = ts; > > -position->keyframe_position = pos; > > - > > -if (!flv->filepositions_count) { > > -flv->filepositions = position; > > -flv->head_filepositions = flv->filepositions; > > -position->next = NULL; > > -} else { > > -flv->filepositions->next = position; > > -position->next = NULL; > > -flv->filepositions = flv->filepositions->next; > > +if (flv->filepositions_count >= flv->filepositions_allocated) { > > +void *pos = av_realloc_array(flv->filepositions, > > + 2 * flv->filepositions_allocated + > 1, > > + sizeof(*flv->filepositions)); > > can the 2* overflow ? > av_fast_realloc() would check for that > i wonder if a av_fast_realloc_array() would make sense > > av_realloc_array checks that the multiplication doesn't overflow (it actually checks that the product fits in an int). Given that sizeof(*flv->filepositions) is bigger than 2, no overflow can happen in 2 * flv->filepositions_allocated + 1. - Andreas ___ 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] avfilter/avf_showfreqs: free input frame after using it
Fixes ticket #8336. Signed-off-by: James Almer --- libavfilter/avf_showfreqs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c index c44ac564ac..645754ded3 100644 --- a/libavfilter/avf_showfreqs.c +++ b/libavfilter/avf_showfreqs.c @@ -475,6 +475,7 @@ static int activate(AVFilterContext *ctx) av_audio_fifo_write(s->fifo, (void **)in->extended_data, in->nb_samples); if (s->pts == AV_NOPTS_VALUE) s->pts = in->pts; +av_frame_free(&in); } if (av_audio_fifo_size(s->fifo) >= s->win_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".
[FFmpeg-devel] [PATCH] add phqm filter and img_hash
From: Christopher Kennedy this adds a phqm filter and OpenCV img_hash based resource usable by the phqm and future filters using image hash functionality from OpenCV. C++ to C handling so that full OpenCV functionality and API can be used instead of the C versions (which are incomplete and don't always exist). Example command line: ffmpeg -i encode.mp4 -i reference.mp4 \ -filter_complex "[0:v][1:v]phqm=stats_file=out.log" \ -y -f null /dev/null Signed-off-by: Christopher Kennedy --- Changelog| 1 + configure| 2 + libavfilter/Makefile | 2 + libavfilter/allfilters.c | 1 + libavfilter/img_hash.cpp | 99 libavfilter/img_hash.h | 46 ++ libavfilter/vf_phqm.c| 334 +++ 7 files changed, 485 insertions(+) create mode 100644 libavfilter/img_hash.cpp create mode 100644 libavfilter/img_hash.h create mode 100644 libavfilter/vf_phqm.c diff --git a/Changelog b/Changelog index 316589e336..4a22f77d37 100644 --- a/Changelog +++ b/Changelog @@ -17,6 +17,7 @@ version : - anlms filter - arnndn filter - bilateral filter +- phqm perceptual hash filter using OpenCV img_lib version 4.2: diff --git a/configure b/configure index 8413826f9e..e231d359bb 100755 --- a/configure +++ b/configure @@ -3497,6 +3497,8 @@ nlmeans_opencl_filter_deps="opencl" nnedi_filter_deps="gpl" ocr_filter_deps="libtesseract" ocv_filter_deps="libopencv" +phqm_filter_deps="libopencv" +phqm_filter_extralibs="-lstdc++ -lopencv_img_hash" openclsrc_filter_deps="opencl" overlay_opencl_filter_deps="opencl" overlay_qsv_filter_deps="libmfx" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 63d2fba861..645e232b3e 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -325,6 +325,7 @@ OBJS-$(CONFIG_PERMS_FILTER) += f_perms.o OBJS-$(CONFIG_PERSPECTIVE_FILTER)+= vf_perspective.o OBJS-$(CONFIG_PHASE_FILTER) += vf_phase.o OBJS-$(CONFIG_PHOTOSENSITIVITY_FILTER) += vf_photosensitivity.o +OBJS-$(CONFIG_PHQM_FILTER) += vf_phqm.o img_hash.o OBJS-$(CONFIG_PIXDESCTEST_FILTER)+= vf_pixdesctest.o OBJS-$(CONFIG_PIXSCOPE_FILTER) += vf_datascope.o OBJS-$(CONFIG_PP_FILTER) += vf_pp.o @@ -498,6 +499,7 @@ OBJS-$(CONFIG_SHARED)+= log2_tab.o SKIPHEADERS-$(CONFIG_QSVVPP) += qsvvpp.h SKIPHEADERS-$(CONFIG_OPENCL) += opencl.h SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_vpp.h +SKIPHEADERS-$(CONFIG_LIBOPENCV) += img_hash.h TOOLS = graph2dot TESTPROGS = drawutils filtfmts formats integral diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index e4186f93db..f0fcaad235 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -309,6 +309,7 @@ extern AVFilter ff_vf_perms; extern AVFilter ff_vf_perspective; extern AVFilter ff_vf_phase; extern AVFilter ff_vf_photosensitivity; +extern AVFilter ff_vf_phqm; extern AVFilter ff_vf_pixdesctest; extern AVFilter ff_vf_pixscope; extern AVFilter ff_vf_pp; diff --git a/libavfilter/img_hash.cpp b/libavfilter/img_hash.cpp new file mode 100644 index 00..35dca0ca6a --- /dev/null +++ b/libavfilter/img_hash.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2019 Christopher Kennedy + * + * OpenCV img_hash + * + * 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 + */ + +#include +#include +#include +#include +#include + +#include + +#include "img_hash.h" +#include "libavutil/pixdesc.h" +extern "C" { +#include "avfilter.h" +} + +// convert from avframe to iplimage format +static int fill_iplimage_from_frame(IplImage *img, const AVFrame *frame, enum AVPixelFormat pixfmt) +{ +IplImage *tmpimg; +int depth = IPL_DEPTH_8U, channels_nb; + +switch (pixfmt) { +case AV_PIX_FMT_GRAY8: channels_nb = 1; break; +case AV_PIX_FMT_BGRA: channels_nb = 4; break; +case AV_PIX_FMT_BGR24: channels_nb = 3; break; +case AV_PIX_FMT_YUV420P:channels_nb = 3; break; +default: return -1; +} + +tmpimg = cvCreateImageHeader((CvSize){frame->width, frame->height}, depth, channels_nb); +*img
[FFmpeg-devel] [PATCH] avformat/dss: Remove superfluous headers
Both attributes.h and bswap.h have been included from the very beginning of this muxer without there being any reason to do so. Signed-off-by: Andreas Rheinhardt --- The earlier mail claimed this to be about avformat/ass. Sorry. libavformat/dss.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/dss.c b/libavformat/dss.c index e5b0be9deb..d7f9cafe47 100644 --- a/libavformat/dss.c +++ b/libavformat/dss.c @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/attributes.h" -#include "libavutil/bswap.h" #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" -- 2.20.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".