Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_mux_init: default to input timebase for streamcopy
Date: Fri,  5 Jul 2024 12:42:32 +0200
Message-ID: <20240705104233.6703-2-anton@khirnov.net> (raw)
In-Reply-To: <20240705104233.6703-1-anton@khirnov.net>

Stop trying to invent some "framerate-based" timebase when there is no
reason to think the stream is CFR at all.
---
 fftools/ffmpeg_mux_init.c        | 7 +------
 tests/fate/ffmpeg.mak            | 2 +-
 tests/ref/fate/copy-trac4914-avi | 4 ++--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 899ee6046f..4a2b5924a4 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -960,17 +960,12 @@ static int streamcopy_init(const Muxer *mux, OutputStream *ost, AVDictionary **e
     else
         ost->st->avg_frame_rate = ist->st->avg_frame_rate;
 
-    ret = avformat_transfer_internal_stream_timing_info(mux->fc->oformat,
-                                                        ost->st, ist->st, copy_tb);
-    if (ret < 0)
-        goto fail;
-
     // copy timebase while removing common factors
     if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0) {
         if (fr.num)
             ost->st->time_base = av_inv_q(fr);
         else
-            ost->st->time_base = av_add_q(av_stream_get_codec_timebase(ost->st), (AVRational){0, 1});
+            ost->st->time_base = av_add_q(ist->st->time_base, (AVRational){0, 1});
     }
 
     if (!ms->copy_prior_start) {
diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index dc102750a0..9e0c68da20 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -146,7 +146,7 @@ fate-copy-trac236: CMD = transcode mov $(TARGET_SAMPLES)/mov/fcp_export8-236.mov
 
 FATE_STREAMCOPY-$(call TRANSCODE, RAWVIDEO MPEG2VIDEO, MXF, MPEGTS_DEMUXER MPEGVIDEO_PARSER MPEGAUDIO_PARSER MP2_DECODER ARESAMPLE_FILTER PCM_S16LE_DECODER) += fate-copy-trac4914
 fate-copy-trac4914: CMD = transcode mpegts $(TARGET_SAMPLES)/mpeg2/xdcam8mp2-1s_small.ts\
-                      mxf "-c:a pcm_s16le -af aresample -c:v copy"
+                      mxf "-c:a pcm_s16le -af aresample -c:v copy -time_base 1001/30000"
 
 FATE_STREAMCOPY-$(call TRANSCODE, RAWVIDEO MPEG2VIDEO, AVI, MPEGTS_DEMUXER MPEGVIDEO_PARSER MPEGAUDIO_PARSER EXTRACT_EXTRADATA_BSF MP2_DECODER ARESAMPLE_FILTER) += fate-copy-trac4914-avi
 fate-copy-trac4914-avi: CMD = transcode mpegts $(TARGET_SAMPLES)/mpeg2/xdcam8mp2-1s_small.ts\
diff --git a/tests/ref/fate/copy-trac4914-avi b/tests/ref/fate/copy-trac4914-avi
index 20006ea05c..d598e0aa65 100644
--- a/tests/ref/fate/copy-trac4914-avi
+++ b/tests/ref/fate/copy-trac4914-avi
@@ -1,5 +1,5 @@
-26e4202638bc384b82d2b5eb4d33a5f0 *tests/data/fate/copy-trac4914-avi.avi
-479494 tests/data/fate/copy-trac4914-avi.avi
+3b6f31b806ef421652a066f239536b0d *tests/data/fate/copy-trac4914-avi.avi
+492046 tests/data/fate/copy-trac4914-avi.avi
 #tb 0: 1001/30000
 #media_type 0: video
 #codec_id 0: rawvideo
-- 
2.43.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-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2024-07-05 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 10:42 [FFmpeg-devel] [PATCH 1/3] fftools/ffmpeg_dec: improve detection of lavf-guessed durations Anton Khirnov
2024-07-05 10:42 ` Anton Khirnov [this message]
2024-07-05 10:42 ` [FFmpeg-devel] [PATCH 3/3] lavf: deprecate avformat_transfer_internal_stream_timing_info() Anton Khirnov
2024-07-05 16:01   ` James Almer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240705104233.6703-2-anton@khirnov.net \
    --to=anton@khirnov.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git