[FFmpeg-cvslog] fftools/ffmpeg_enc: apply -top to individual encoded frames

Anton Khirnov git at videolan.org
Sat Jan 27 00:28:58 EET 2024


ffmpeg | branch: release/5.1 | Anton Khirnov <anton at khirnov.net> | Thu Sep 14 16:46:47 2023 +0200| [dd885ab2f5060eaedbfca6d590db44fa9547dd99] | committer: Marton Balint

fftools/ffmpeg_enc: apply -top to individual encoded frames

Fixes #9339.

(Adapted from commit 43a0004b5c23dd8258cfe723a5c4e9fd9ee8f5ef)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd885ab2f5060eaedbfca6d590db44fa9547dd99
---

 fftools/ffmpeg.c                                    | 3 +++
 tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 | 2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10  | 2 +-
 tests/ref/lavf/mxf_d10                              | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e7384f052a..02afbc65ea 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1278,6 +1278,9 @@ static void do_video_out(OutputFile *of,
             av_log(NULL, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time);
         }
 
+        if (ost->top_field_first >= 0)
+            in_picture->top_field_first = !!ost->top_field_first;
+
         ret = encode_frame(of, ost, in_picture);
         if (ret < 0)
             exit_program(1);
diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
index 57b22848b9..a77d888b1f 100644
--- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
+++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
@@ -1 +1 @@
-1fac6962d4c5f1070d0d2db5ab7d86aa *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe
+76685555ca5598fb666d3945cd264f9d *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10
index 8937724ed1..b72551d36c 100644
--- a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10
+++ b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10
@@ -68,5 +68,5 @@ video|0|33|1.320000|33|1.320000|1|0.040000|150000|1711104|K_|1|Strings Metadata
 audio|1|63360|1.320000|63360|1.320000|1920|0.040000|7680|1861632|K_|1|Strings Metadata
 video|0|34|1.360000|34|1.360000|1|0.040000|150000|1924096|K_|1|Strings Metadata
 audio|1|65280|1.360000|65280|1.360000|1920|0.040000|7680|2074624|K_|1|Strings Metadata
-0|mpeg2video|0|video|[0][0][0][0]|0x0000|720|608|0|0|0|0|0|1:1|45:38|yuv422p|5|tv|unknown|unknown|unknown|topleft|tb|1|N/A|25/1|25/1|1/25|0|0.000000|N/A|N/A|30000000|N/A|N/A|N/A|N/A|35|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001|CPB properties|30000000|0|0|1212416|-1
+0|mpeg2video|0|video|[0][0][0][0]|0x0000|720|608|0|0|0|0|0|1:1|45:38|yuv422p|5|tv|unknown|unknown|unknown|topleft|tt|1|N/A|25/1|25/1|1/25|0|0.000000|N/A|N/A|30000000|N/A|N/A|N/A|N/A|35|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001|CPB properties|30000000|0|0|1212416|-1
 1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|2|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|1536000|N/A|N/A|N/A|N/A|35|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001
diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10
index 4644c3424d..191e9f877c 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-74269c0a64b19269b127f64f3ce7fa6a *tests/data/lavf/lavf.mxf_d10
+963758bdb2a5d64f4e68c205fc5aba96 *tests/data/lavf/lavf.mxf_d10
 5332013 tests/data/lavf/lavf.mxf_d10
 tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488



More information about the ffmpeg-cvslog mailing list