[FFmpeg-cvslog] lavf/utils: Fix DTS for short H264 streams.
ffmpeg | branch: master | Sasi Inguva | Sat Mar 12 02:40:25 2016 -0800| [895dd0967194dac597405b9b2691b148809e221a] | committer: Michael Niedermayer lavf/utils: Fix DTS for short H264 streams. Fill DTS if all packets have been read in avformat_find_stream_info, and still has_decode_delay_been_guessed returns false. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=895dd0967194dac597405b9b2691b148809e221a --- libavformat/utils.c | 13 + 1 file changed, 13 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 3c050ef..2936ed5 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3188,6 +3188,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) int64_t max_stream_analyze_duration; int64_t max_subtitle_analyze_duration; int64_t probesize = ic->probesize; +int eof_reached = 0; flush_codecs = probesize > 0; @@ -3354,6 +3355,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) if (ret < 0) { /* EOF or error*/ +eof_reached = 1; break; } @@ -3477,6 +3479,17 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) count++; } +if (eof_reached && ic->internal->packet_buffer) { +int stream_index; +for (stream_index = 0; stream_index < ic->nb_streams; stream_index++) { +// EOF already reached while reading the stream above. +// So continue with reoordering DTS with whatever delay we have. +if (!has_decode_delay_been_guessed(st)) { +update_dts_from_pts(ic, stream_index, ic->internal->packet_buffer); +} +} +} + if (flush_codecs) { AVPacket empty_pkt = { 0 }; int err = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: factor update_dts_from_pts() out
ffmpeg | branch: master | Sasi Inguva | Sat Mar 12 02:40:25 2016 -0800| [e939dde48d446216530a4106e0471f1a155dfe26] | committer: Michael Niedermayer avformat/utils: factor update_dts_from_pts() out Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e939dde48d446216530a4106e0471f1a155dfe26 --- libavformat/utils.c | 64 ++- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index e0aea87..3c050ef 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -936,14 +936,44 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t return dts; } +/** + * Updates the dts of packets of a stream in pkt_buffer, by re-ordering the pts + * of the packets in a window. + */ +static void update_dts_from_pts(AVFormatContext *s, int stream_index, +AVPacketList *pkt_buffer) +{ +AVStream *st = s->streams[stream_index]; +int delay = st->codec->has_b_frames; +int i; + +int64_t pts_buffer[MAX_REORDER_DELAY+1]; + +for (i = 0; ipkt.stream_index != stream_index) +continue; + +if (pkt_buffer->pkt.pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) { +pts_buffer[0] = pkt_buffer->pkt.pts; +for (i = 0; i pts_buffer[i + 1]; i++) +FFSWAP(int64_t, pts_buffer[i], pts_buffer[i + 1]); + +pkt_buffer->pkt.dts = select_from_pts_buffer(st, pts_buffer, pkt_buffer->pkt.dts); +} +} +} + static void update_initial_timestamps(AVFormatContext *s, int stream_index, int64_t dts, int64_t pts, AVPacket *pkt) { AVStream *st = s->streams[stream_index]; AVPacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue; -int64_t pts_buffer[MAX_REORDER_DELAY+1]; +AVPacketList *pktl_it; + uint64_t shift; -int i, delay; if (st->first_dts != AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE || @@ -951,36 +981,28 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, is_relative(dts)) return; -delay = st->codec->has_b_frames; st->first_dts = dts - (st->cur_dts - RELATIVE_TS_BASE); st->cur_dts = dts; shift = (uint64_t)st->first_dts - RELATIVE_TS_BASE; -for (i = 0; ipkt.stream_index != stream_index) +for (pktl_it = pktl; pktl_it; pktl_it = get_next_pkt(s, st, pktl_it)) { +if (pktl_it->pkt.stream_index != stream_index) continue; -if (is_relative(pktl->pkt.pts)) -pktl->pkt.pts += shift; - -if (is_relative(pktl->pkt.dts)) -pktl->pkt.dts += shift; +if (is_relative(pktl_it->pkt.pts)) +pktl_it->pkt.pts += shift; -if (st->start_time == AV_NOPTS_VALUE && pktl->pkt.pts != AV_NOPTS_VALUE) -st->start_time = pktl->pkt.pts; +if (is_relative(pktl_it->pkt.dts)) +pktl_it->pkt.dts += shift; -if (pktl->pkt.pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) { -pts_buffer[0] = pktl->pkt.pts; -for (i = 0; i pts_buffer[i + 1]; i++) -FFSWAP(int64_t, pts_buffer[i], pts_buffer[i + 1]); +if (st->start_time == AV_NOPTS_VALUE && pktl_it->pkt.pts != AV_NOPTS_VALUE) +st->start_time = pktl_it->pkt.pts; +} -pktl->pkt.dts = select_from_pts_buffer(st, pts_buffer, pktl->pkt.dts); -} +if (has_decode_delay_been_guessed(st)) { +update_dts_from_pts(s, stream_index, pktl); } if (st->start_time == AV_NOPTS_VALUE) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: Add ffprobe dependancy to fate-h264-dts_5frames
ffmpeg | branch: master | Michael Niedermayer | Sat Mar 12 15:37:25 2016 +0100| [4aea2c7d8959e1273a7eb6d06e5c3de57f9cf722] | committer: Michael Niedermayer fate: Add ffprobe dependancy to fate-h264-dts_5frames Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4aea2c7d8959e1273a7eb6d06e5c3de57f9cf722 --- tests/fate/h264.mak |2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak index 9c2cd50..0c614eb 100644 --- a/tests/fate/h264.mak +++ b/tests/fate/h264.mak @@ -203,6 +203,8 @@ FATE_H264-$(call DEMDEC, MATROSKA, H264) += fate-h264-direct-bff FATE_SAMPLES_AVCONV += $(FATE_H264-yes) fate-h264: $(FATE_H264-yes) +fate-h264-dts_5frames: ffprobe$(PROGSSUF)$(EXESUF) + fate-h264-conformance-aud_mw_e: CMD = framecrc -vsync drop -i $(TARGET_SAMPLES)/h264-conformance/AUD_MW_E.264 fate-h264-conformance-ba1_ft_c: CMD = framecrc -vsync drop -i $(TARGET_SAMPLES)/h264-conformance/BA1_FT_C.264 fate-h264-conformance-ba1_sony_d: CMD = framecrc -vsync drop -i $(TARGET_SAMPLES)/h264-conformance/BA1_Sony_D.jsv ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: add test for "Fix DTS for short H264 streams"
ffmpeg | branch: master | Sasi Inguva | Sat Mar 12 02:40:25 2016 -0800| [6fa5c8235b0cdb8bd33cc072759866d64e307f8c] | committer: Michael Niedermayer fate: add test for "Fix DTS for short H264 streams" Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fa5c8235b0cdb8bd33cc072759866d64e307f8c --- tests/fate/h264.mak |3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak index 46178cd..9c2cd50 100644 --- a/tests/fate/h264.mak +++ b/tests/fate/h264.mak @@ -192,6 +192,7 @@ FATE_H264 := $(FATE_H264:%=fate-h264-conformance-%) \ $(FATE_H264_REINIT_TESTS:%=fate-h264-reinit-%)\ fate-h264-extreme-plane-pred \ fate-h264-lossless\ + fate-h264-dts_5frames \ FATE_H264-$(call DEMDEC, H264, H264) += $(FATE_H264) FATE_H264-$(call DEMDEC, MOV, H264) += fate-h264-crop-to-container @@ -395,3 +396,5 @@ fate-h264-lossless: CMD = framecrc -i $(TARGET_SAM fate-h264-direct-bff: CMD = framecrc -i $(TARGET_SAMPLES)/h264/direct-bff.mkv fate-h264-reinit-%: CMD = framecrc -i $(TARGET_SAMPLES)/h264/$(@:fate-h264-%=%).h264 -vf format=yuv444p10le,scale=w=352:h=288 + +fate-h264-dts_5frames:CMD = probeframes $(TARGET_SAMPLES)/h264/dts_5frames.mkv ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc: Add support for HLS PLAYLIST types EVENT and VOD
ffmpeg | branch: master | Adam Kent | Thu Dec 17 03:16:45 2015 +| [77e355ffb1d669e90ad3784dea8f0950b66f7564] | committer: Michael Niedermayer avformat/hlsenc: Add support for HLS PLAYLIST types EVENT and VOD Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=77e355ffb1d669e90ad3784dea8f0950b66f7564 --- doc/muxers.texi |8 libavformat/hlsenc.c | 20 2 files changed, 28 insertions(+) diff --git a/doc/muxers.texi b/doc/muxers.texi index f2ad7fe..ef7f333 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -408,6 +408,14 @@ Will produce the playlist, @file{out.m3u8}, and a single segment file, @item hls_flags delete_segments Segment files removed from the playlist are deleted after a period of time equal to the duration of the segment plus the duration of the playlist. + +@item hls_playlist_type event +Emit @code{#EXT-X-PLAYLIST-TYPE:EVENT} in the m3u8 header. Forces +@option{hls_list_size} to 0; the playlist can only be appended to. + +@item hls_playlist_type vod +Emit @code{#EXT-X-PLAYLIST-TYPE:VOD} in the m3u8 header. Forces +@option{hls_list_size} to 0; the playlist must not change. @end table @anchor{ico} diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e0463b4..fd36b21 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -64,6 +64,13 @@ typedef enum HLSFlags { HLS_OMIT_ENDLIST = (1 << 4), } HLSFlags; +typedef enum { +PLAYLIST_TYPE_NONE, +PLAYLIST_TYPE_EVENT, +PLAYLIST_TYPE_VOD, +PLAYLIST_TYPE_NB, +} PlaylistType; + typedef struct HLSContext { const AVClass *class; // Class for private options. unsigned number; @@ -79,6 +86,7 @@ typedef struct HLSContext { int max_nb_segments; // Set by a private option. int wrap; // Set by a private option. uint32_t flags;// enum HLSFlags +uint32_t pl_type; // enum PlaylistType char *segment_filename; int use_localtime; ///< flag to expand filename with localtime @@ -357,6 +365,10 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double hls->last_segment = en; +// EVENT or VOD playlists imply sliding window cannot be used +if (hls->pl_type != PLAYLIST_TYPE_NONE) +hls->max_nb_segments = 0; + if (hls->max_nb_segments && hls->nb_entries >= hls->max_nb_segments) { en = hls->segments; hls->segments = en->next; @@ -432,6 +444,11 @@ static int hls_window(AVFormatContext *s, int last) } avio_printf(out, "#EXT-X-TARGETDURATION:%d\n", target_duration); avio_printf(out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence); +if (hls->pl_type == PLAYLIST_TYPE_EVENT) { +avio_printf(out, "#EXT-X-PLAYLIST-TYPE:EVENT\n"); +} else if (hls->pl_type == PLAYLIST_TYPE_VOD) { +avio_printf(out, "#EXT-X-PLAYLIST-TYPE:VOD\n"); +} av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence); @@ -908,6 +925,9 @@ static const AVOption options[] = { {"omit_endlist", "Do not append an endlist when ending stream", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_OMIT_ENDLIST }, 0, UINT_MAX, E, "flags"}, {"use_localtime", "set filename expansion with strftime at segment creation", OFFSET(use_localtime), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E }, {"use_localtime_mkdir", "create last directory component in strftime-generated filename", OFFSET(use_localtime_mkdir), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E }, +{"hls_playlist_type", "set the HLS playlist type", OFFSET(pl_type), AV_OPT_TYPE_INT, {.i64 = PLAYLIST_TYPE_NONE }, 0, PLAYLIST_TYPE_NB-1, E, "pl_type" }, +{"event", "EVENT playlist", 0, AV_OPT_TYPE_CONST, {.i64 = PLAYLIST_TYPE_EVENT }, INT_MIN, INT_MAX, E, "pl_type" }, +{"vod", "VOD playlist", 0, AV_OPT_TYPE_CONST, {.i64 = PLAYLIST_TYPE_VOD }, INT_MIN, INT_MAX, E, "pl_type" }, {"method", "set the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0,E}, { NULL }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: add missing h264-dts_5frames ref file
ffmpeg | branch: master | James Almer | Sat Mar 12 19:06:30 2016 -0300| [e71096bb3ab4310999731dc53988cdcbd8aa4a72] | committer: James Almer fate: add missing h264-dts_5frames ref file Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e71096bb3ab4310999731dc53988cdcbd8aa4a72 --- tests/ref/fate/h264-dts_5frames | 125 +++ 1 file changed, 125 insertions(+) diff --git a/tests/ref/fate/h264-dts_5frames b/tests/ref/fate/h264-dts_5frames new file mode 100644 index 000..1c4c349 --- /dev/null +++ b/tests/ref/fate/h264-dts_5frames @@ -0,0 +1,125 @@ +[FRAME] +media_type=video +stream_index=0 +key_frame=1 +pkt_pts=0 +pkt_pts_time=0.00 +pkt_dts=0 +pkt_dts_time=0.00 +best_effort_timestamp=0 +best_effort_timestamp_time=0.00 +pkt_duration=166 +pkt_duration_time=0.166000 +pkt_pos=651 +pkt_size=14428 +width=512 +height=256 +pix_fmt=yuv420p +sample_aspect_ratio=1:1 +pict_type=I +coded_picture_number=0 +display_picture_number=0 +interlaced_frame=0 +top_field_first=0 +repeat_pict=0 +[/FRAME] +[FRAME] +media_type=video +stream_index=0 +key_frame=0 +pkt_pts=167 +pkt_pts_time=0.167000 +pkt_dts=167 +pkt_dts_time=0.167000 +best_effort_timestamp=167 +best_effort_timestamp_time=0.167000 +pkt_duration=166 +pkt_duration_time=0.166000 +pkt_pos=15085 +pkt_size=11 +width=512 +height=256 +pix_fmt=yuv420p +sample_aspect_ratio=1:1 +pict_type=P +coded_picture_number=1 +display_picture_number=0 +interlaced_frame=0 +top_field_first=0 +repeat_pict=0 +[/FRAME] +[FRAME] +media_type=video +stream_index=0 +key_frame=0 +pkt_pts=333 +pkt_pts_time=0.333000 +pkt_dts=333 +pkt_dts_time=0.333000 +best_effort_timestamp=333 +best_effort_timestamp_time=0.333000 +pkt_duration=166 +pkt_duration_time=0.166000 +pkt_pos=15102 +pkt_size=11 +width=512 +height=256 +pix_fmt=yuv420p +sample_aspect_ratio=1:1 +pict_type=P +coded_picture_number=2 +display_picture_number=0 +interlaced_frame=0 +top_field_first=0 +repeat_pict=0 +[/FRAME] +[FRAME] +media_type=video +stream_index=0 +key_frame=0 +pkt_pts=500 +pkt_pts_time=0.50 +pkt_dts=500 +pkt_dts_time=0.50 +best_effort_timestamp=500 +best_effort_timestamp_time=0.50 +pkt_duration=166 +pkt_duration_time=0.166000 +pkt_pos=15119 +pkt_size=11 +width=512 +height=256 +pix_fmt=yuv420p +sample_aspect_ratio=1:1 +pict_type=P +coded_picture_number=3 +display_picture_number=0 +interlaced_frame=0 +top_field_first=0 +repeat_pict=0 +[/FRAME] +[FRAME] +media_type=video +stream_index=0 +key_frame=0 +pkt_pts=667 +pkt_pts_time=0.667000 +pkt_dts=667 +pkt_dts_time=0.667000 +best_effort_timestamp=667 +best_effort_timestamp_time=0.667000 +pkt_duration=166 +pkt_duration_time=0.166000 +pkt_pos=15136 +pkt_size=11 +width=512 +height=256 +pix_fmt=yuv420p +sample_aspect_ratio=1:1 +pict_type=P +coded_picture_number=4 +display_picture_number=0 +interlaced_frame=0 +top_field_first=0 +repeat_pict=0 +[/FRAME] ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: add missing dependencies for fate-h264-dts_5frames
ffmpeg | branch: master | James Almer | Sat Mar 12 19:14:35 2016 -0300| [6224dddaa7134330a5d56182fc0ee72632d3be74] | committer: James Almer fate: add missing dependencies for fate-h264-dts_5frames Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6224dddaa7134330a5d56182fc0ee72632d3be74 --- tests/fate/h264.mak |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak index 0c614eb..164fc9e 100644 --- a/tests/fate/h264.mak +++ b/tests/fate/h264.mak @@ -192,18 +192,17 @@ FATE_H264 := $(FATE_H264:%=fate-h264-conformance-%) \ $(FATE_H264_REINIT_TESTS:%=fate-h264-reinit-%)\ fate-h264-extreme-plane-pred \ fate-h264-lossless\ - fate-h264-dts_5frames \ FATE_H264-$(call DEMDEC, H264, H264) += $(FATE_H264) FATE_H264-$(call DEMDEC, MOV, H264) += fate-h264-crop-to-container FATE_H264-$(call DEMDEC, MOV, H264) += fate-h264-interlace-crop FATE_H264-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF) += fate-h264-bsf-mp4toannexb FATE_H264-$(call DEMDEC, MATROSKA, H264) += fate-h264-direct-bff +FATE_H264_FFPROBE-$(call DEMDEC, MATROSKA, H264) += fate-h264-dts_5frames FATE_SAMPLES_AVCONV += $(FATE_H264-yes) -fate-h264: $(FATE_H264-yes) - -fate-h264-dts_5frames: ffprobe$(PROGSSUF)$(EXESUF) +FATE_SAMPLES_FFPROBE += $(FATE_H264_FFPROBE-yes) +fate-h264: $(FATE_H264-yes) $(FATE_H264_FFPROBE-yes) fate-h264-conformance-aud_mw_e: CMD = framecrc -vsync drop -i $(TARGET_SAMPLES)/h264-conformance/AUD_MW_E.264 fate-h264-conformance-ba1_ft_c: CMD = framecrc -vsync drop -i $(TARGET_SAMPLES)/h264-conformance/BA1_FT_C.264 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/smptebars: fix some 75% color values
ffmpeg | branch: master | Paul B Mahol | Sat Mar 12 23:49:05 2016 +0100| [a61cd42c8d756c0f9503469988250b326e182ae6] | committer: Paul B Mahol avfilter/smptebars: fix some 75% color values They where slightly off. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a61cd42c8d756c0f9503469988250b326e182ae6 --- libavfilter/vsrc_testsrc.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 54d8b26..a75dd4c 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -1073,12 +1073,12 @@ AVFilter ff_vsrc_rgbtestsrc = { static const uint8_t rainbow[7][4] = { { 180, 128, 128, 255 }, /* 75% white */ -{ 161, 44, 141, 255 }, /* 75% yellow */ +{ 162, 44, 142, 255 }, /* 75% yellow */ { 131, 156, 44, 255 }, /* 75% cyan */ -{ 112, 72, 57, 255 }, /* 75% green */ -{ 83, 183, 198, 255 }, /* 75% magenta */ -{ 65, 99, 212, 255 }, /* 75% red */ -{ 34, 212, 114, 255 }, /* 75% blue */ +{ 112, 72, 58, 255 }, /* 75% green */ +{ 84, 184, 198, 255 }, /* 75% magenta */ +{ 65, 100, 212, 255 }, /* 75% red */ +{ 35, 212, 114, 255 }, /* 75% blue */ }; static const uint8_t rainbowhd[7][4] = { @@ -1092,9 +1092,9 @@ static const uint8_t rainbowhd[7][4] = { }; static const uint8_t wobnair[7][4] = { -{ 34, 212, 114, 255 }, /* 75% blue */ +{ 35, 212, 114, 255 }, /* 75% blue */ { 19, 128, 128, 255 }, /* 7.5% intensity black */ -{ 83, 183, 198, 255 }, /* 75% magenta */ +{ 84, 184, 198, 255 }, /* 75% magenta */ { 19, 128, 128, 255 }, /* 7.5% intensity black */ { 131, 156, 44, 255 }, /* 75% cyan */ { 19, 128, 128, 255 }, /* 7.5% intensity black */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_vectorscope: make it possible to override colorspace
ffmpeg | branch: master | Paul B Mahol | Sun Mar 13 00:17:29 2016 +0100| [4a7c705fde1a25cc3dd4ffcb56e3b4acf12dea41] | committer: Paul B Mahol avfilter/vf_vectorscope: make it possible to override colorspace Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a7c705fde1a25cc3dd4ffcb56e3b4acf12dea41 --- doc/filters.texi |9 + libavfilter/vf_vectorscope.c | 26 ++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index d5d619e..1f86c04 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -12656,6 +12656,15 @@ Values higher than this value will be ignored. Default is 1. Note this value is multiplied with actual max possible value one pixel component can have. So for 8-bit input and high threshold value of 0.9 actual threshold is 0.9 * 255 = 230. + +@item colorspace, c +Set what kind of colorspace to use when drawing graticule. +@table @samp +@item auto +@item 601 +@item 709 +@end table +Default is auto. @end table @anchor{vidstabdetect} diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c index 2696a12..da087ab 100644 --- a/libavfilter/vf_vectorscope.c +++ b/libavfilter/vf_vectorscope.c @@ -62,6 +62,7 @@ typedef struct VectorscopeContext { int tmin; int tmax; int flags; +int colorspace; int cs; uint8_t peak[4096][4096]; @@ -111,6 +112,11 @@ static const AVOption vectorscope_options[] = { { "l", "set low threshold", OFFSET(lthreshold), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 1, FLAGS}, { "hthreshold", "set high threshold", OFFSET(hthreshold), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, FLAGS}, { "h", "set high threshold", OFFSET(hthreshold), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, FLAGS}, +{ "colorspace", "set colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGS, "colorspace"}, +{ "c", "set colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGS, "colorspace"}, +{ "auto", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "colorspace" }, +{ "601",0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "colorspace" }, +{ "709",0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "colorspace" }, { NULL } }; @@ -1190,14 +1196,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out; -switch (av_frame_get_colorspace(in)) { -case AVCOL_SPC_SMPTE170M: -case AVCOL_SPC_BT470BG: -s->cs = (s->depth - 8) * 2 + 0; -break; -case AVCOL_SPC_BT709: -default: -s->cs = (s->depth - 8) * 2 + 1; +if (s->colorspace) { +s->cs = (s->depth - 8) * 2 + s->colorspace - 1; +} else { +switch (av_frame_get_colorspace(in)) { +case AVCOL_SPC_SMPTE170M: +case AVCOL_SPC_BT470BG: +s->cs = (s->depth - 8) * 2 + 0; +break; +case AVCOL_SPC_BT709: +default: +s->cs = (s->depth - 8) * 2 + 1; +} } out = ff_get_video_buffer(outlink, outlink->w, outlink->h); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_decimate: Use the correct frame in difference calculation
ffmpeg | branch: master | Michael Niedermayer | Wed Dec 16 18:54:55 2015 +0100| [58cb1fb1fe925c85161f23d5a368f126317cb292] | committer: Michael Niedermayer avfilter/vf_decimate: Use the correct frame in difference calculation Fixes Ticket4964 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58cb1fb1fe925c85161f23d5a368f126317cb292 --- libavfilter/vf_decimate.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index 4cf0771..39c3331 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -164,9 +164,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return 0; dm->got_frame[INPUT_MAIN] = dm->got_frame[INPUT_CLEANSRC] = 0; +if (dm->ppsrc) +in = dm->clean_src[dm->fid]; + if (in) { /* update frame metrics */ -prv = dm->fid ? dm->queue[dm->fid - 1].frame : dm->last; +prv = dm->fid ? (dm->ppsrc ? dm->clean_src[dm->fid - 1] : dm->queue[dm->fid - 1].frame) : dm->last; if (!prv) { dm->queue[dm->fid].maxbdiff = INT64_MAX; dm->queue[dm->fid].totdiff = INT64_MAX; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Revert "avfilter/vf_decimate: Check that input parameters match"
ffmpeg | branch: master | Michael Niedermayer | Wed Dec 16 18:26:47 2015 +0100| [52e7f6b17eed3b613ca630ba5d1d6288db891977] | committer: Michael Niedermayer Revert "avfilter/vf_decimate: Check that input parameters match" ill commit a better solution This reverts commit 30fe3fd52721c8c6566001192cd16be423ffc92b. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52e7f6b17eed3b613ca630ba5d1d6288db891977 --- libavfilter/vf_decimate.c |9 - 1 file changed, 9 deletions(-) diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index e2c0a32..4cf0771 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -365,8 +365,6 @@ static int config_output(AVFilterLink *outlink) DecimateContext *dm = ctx->priv; const AVFilterLink *inlink = ctx->inputs[dm->ppsrc ? INPUT_CLEANSRC : INPUT_MAIN]; -const AVFilterLink *inlink_main = -ctx->inputs[INPUT_MAIN]; AVRational fps = inlink->frame_rate; if (!fps.num || !fps.den) { @@ -374,13 +372,6 @@ static int config_output(AVFilterLink *outlink) "current rate of %d/%d is invalid\n", fps.num, fps.den); return AVERROR(EINVAL); } - -if (inlink->w != inlink_main->w || -inlink->h != inlink_main->h || -inlink->format != inlink_main->format) { -av_log(ctx, AV_LOG_ERROR, "frame parameters differ between inputs\n"); -return AVERROR_PATCHWELCOME; -} fps = av_mul_q(fps, (AVRational){dm->cycle - 1, dm->cycle}); av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n", inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog