From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 280D840A39 for ; Wed, 2 Feb 2022 23:22:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6D4D368B0D3; Thu, 3 Feb 2022 01:22:34 +0200 (EET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 922EF68B07F for ; Thu, 3 Feb 2022 01:22:27 +0200 (EET) Received: by mail-pl1-f176.google.com with SMTP id s6so590334plg.12 for ; Wed, 02 Feb 2022 15:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:date:subject:fcc:content-transfer-encoding :mime-version:to:cc; bh=yDEIMqLe7+G1rlI4O367VMlSn7jMumRfJ+SI0XHzyMc=; b=X4o1F7Vj3bti/7vZvFuY78zrItZNunyt4aK/KO3uBSWgriTjI1IvtDRRupGlTzydX+ HJMtOok72CZSypQovmI5FQfGUgiypfxvvRS4ZUteo4IGMaeMGXlepfmypdFXl52lwADO mL+j9CdmqTr8IOdf1SxjZklM8xKn014izPYHj2AEjLgE3VMIKzySemoSxw0eIoilXdyD carDTwFjkDumYYNbuzKztAqBEpWG29Lm1V73jwmrz6pKUJZGIzmBUSCMzeyGHKlDSuUG 1AHLW+dZW08wRCdEiD4hyovKviSfx/6EN3xQiBMmp41Ee9664BijNUrwoBtFKt0ql1iS kWgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=yDEIMqLe7+G1rlI4O367VMlSn7jMumRfJ+SI0XHzyMc=; b=qOPM6nGjAu2SG4d3qKTHCeyeqQtZrmVg6SMFNTV/RiWC1cNhRD89ygsuSIQeEUfVpZ TT0G7eDPcmg4KFAienNfub9Jzq9Qv1rYMEuKwOLpkSDs2MeRoodWaf2nQJmf45ScJdoa lSG/7PCCJLl8NWKSyHe8IdyL3lAjFL6SL2jrZ1LBPPu6lThoswBlLC7hmMUBxKyRuhbD omNbR3w1fgORohhZ4QuPRgkIlU1uKHY+IuGRtKKpu8nRoy7OBieb8qVSTHIoCTuTwGnN JKp3aFSASWozuDq089+aRI4wUauDIuMRaj3Rt6yd31kcNP4BWuV3fBKV8gtlpRZHg9A5 I17Q== X-Gm-Message-State: AOAM530qQKal5nkjwGDL/itBUs7fx9EsAKOYhH6hnNKD7fupl1r48jn6 4+WwQdZKo0JbZ4og93V3K8hEAhJfC50= X-Google-Smtp-Source: ABdhPJxV9zsVKhNJ/QP126FCvUQARVhGYKriVWEKGqd24le6ZLjBYoTX68fU7m4nS77eo3XvJxAouA== X-Received: by 2002:a17:902:e812:: with SMTP id u18mr33070477plg.12.1643844145495; Wed, 02 Feb 2022 15:22:25 -0800 (PST) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id p4sm14163142pfw.133.2022.02.02.15.22.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Feb 2022 15:22:24 -0800 (PST) From: Bryce Chester Newman X-Google-Original-From: Bryce Chester Newman Message-Id: Date: Wed, 02 Feb 2022 23:22:24 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Bryce Chester Newman Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Bryce Chester Newman I need the ability to derive the poster time found in the mvhd, so I can use that value to create a thumbnail from ffmpeg. More details can be found here https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html Signed-off-by: Bryce Chester Newman --- libavformat/mov: Expose Quicktime poster_time value as metadata TAG. I need the ability to derive the poster time found in the mvhd, so I can use that value to create a thumbnail from ffmpeg. More details can be found here https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-21%2Fbrycechesternewman%2Fpatch-poster-time-tag-v1 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-21/brycechesternewman/patch-poster-time-tag-v1 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/21 libavformat/mov.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index a80fcc1606..3d36f6563f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1487,6 +1487,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) { int i; int64_t creation_time; + int32_t poster_time; int version = avio_r8(pb); /* version */ avio_rb24(pb); /* flags */ @@ -1525,12 +1526,21 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb32(pb); /* preview time */ avio_rb32(pb); /* preview duration */ - avio_rb32(pb); /* poster time */ + poster_time = avio_rb32(pb); /* poster time */ avio_rb32(pb); /* selection time */ avio_rb32(pb); /* selection duration */ avio_rb32(pb); /* current time */ avio_rb32(pb); /* next track ID */ + av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale); + if(poster_time && c->time_scale && c->time_scale > 0) { + char buffer[32]; + float poster_time_location = (float)poster_time / c->time_scale; + snprintf(buffer, sizeof(buffer), "%.2f", poster_time_location); + /* This will appear as a TAG in the format section of FFProbe output using -show_format */ + av_dict_set(&c->fc->metadata, "poster_time", buffer, 0); + } + return 0; } base-commit: 2e82c610553efd69b4d9b6c359423a19c2868255 -- ffmpeg-codebot _______________________________________________ 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".