From patchwork Sat Mar 17 02:26:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Courtland Idstrom X-Patchwork-Id: 8015 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.70 with SMTP id c67csp196392jad; Fri, 16 Mar 2018 19:26:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELsu3796sWhNgGr1PfEOt5DpSKA/S9+U0dXjfIvg6rrMHpX1uZXsPcJxcj1UGWYPVuSHkRji X-Received: by 10.223.157.206 with SMTP id q14mr3180533wre.278.1521253612294; Fri, 16 Mar 2018 19:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521253612; cv=none; d=google.com; s=arc-20160816; b=my0ac69GDgpvl1Qf+Eu4Bn/nq2ODRmt7/tt9h9pDqixUoEc5MarilUezgSJrOtlowP 8GHPzDNAcTremRv7iUdSULa37m/SD/h9kVEC3rOWH9fKGblpW8qkJLkVqz/+tMoEAGkx p8p1wSdsF3GVf81ExDdgXfazs7BFzUMbX3Bq+U/YrK6fIVfKZte3BCkzxlK4MAJIIsXG yIceRCEFtHmZxqyNs7hTNqdixWBR+YblTgzlM42kqbYYPx0CENlDIh43KWRSEVPGwIT+ cbrjwG843O16sHBADdyWGmdb5kKoZWOobD/0dcgm0PIUDoJ+oi7nKXUyFyWumC2adAGv qXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=OwGUW4Qa3l7fhrol0lJuoXebdpagiXj0Cm0C1JtcdIo=; b=YlxvRrcUI66WrcKB2rPMKQCuBnDPiTEkhMsdNBsm9VNUBcMMzyuOPFXH3JAzCq7mUy SmE8VZePgGlAFTPrurTRqFKSkWXyIlVkG1hBFHiCLOr+eSPWRyhevCfgSyAJnlLSvHlE NroZhINVRByswi7WUijNftVa+aZy63529Zl5J2FUiq4GSUFJ+mi2x6R7gxsNQ5dXZ5cq smFC1VdMp2kW5/DN5pcrLhXZaRGFS17RpjjEclgtojzqj6indZLJYKQGoQ5rcn0lkY35 vVq/urTgypkWpCRKtd4n3yHPGq8kq0HesE7xdmrioJPlNM2T9GkiMh8+WhLgq5Rvf7hi k3CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@telltalegames.com header.s=google header.b=ZHDBFbgW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 201si5053079wmm.277.2018.03.16.19.26.51; Fri, 16 Mar 2018 19:26:52 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@telltalegames.com header.s=google header.b=ZHDBFbgW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CE93E68995A; Sat, 17 Mar 2018 04:26:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl0-f50.google.com (mail-pl0-f50.google.com [209.85.160.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D66EE6898E2 for ; Sat, 17 Mar 2018 04:26:30 +0200 (EET) Received: by mail-pl0-f50.google.com with SMTP id f5-v6so6911864plj.13 for ; Fri, 16 Mar 2018 19:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telltalegames.com; s=google; h=from:to:cc:subject:date:message-id; bh=rjnx9ZgyuF0ULlCERFNFN6obeD4lj3JxRiKCfOEXuQo=; b=ZHDBFbgWfDQ7TukbVhejU+ixz2G4h0UUnZKj8DSSMaWAShjMqSS91CR8aDtYS2gS+n vSdji34AitKyGt+CuOgCjtyggyc5riOJ9WwpHG1F5YM8cb1GHr19SUHtC6LJzKnAYSuy 8LUyp/V+i5ZDkmMa1FP/RxrUF1ZILrwgEkRTM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rjnx9ZgyuF0ULlCERFNFN6obeD4lj3JxRiKCfOEXuQo=; b=GpfvImAJ7zE48V6gSsbDm60oq04WW+q/0QTdJfj67/fTVeCEahw47gF6lGdxKc/svD 1J8Pa1HfIkvN+gg9lvMlahJHPV6jsbsejnfcQAi+RkH3+rUEvd1Tbl/1Vl+LGyepMeRR PQFIWrgF8IE7jsFhNU6ZBvhhGOokfOaD3NvaPX1BkV5of5qPMrDM/Hjmc0S3EBMw9ur8 ayO6G0L5heLqH5xAsOVAxTww0RPDedVu9o7vL8G0DqS47Ad+5jtrHi9ZdtxJ1cE0+fh+ Cka4yYK4KJJq090KHMgYOHI4++Y9YFpS3dVWH05cXT5EykmPwJWhzTXfGmVmGmcsUU3k 2dZw== X-Gm-Message-State: AElRT7GmuYZWv1EinA0PkDHzawiA63Er/Dwm0eiZDydAf4CV0Qn9k58n v+rN25yJgdU5uviVkgzIxtNSRnwd X-Received: by 2002:a17:902:9897:: with SMTP id s23-v6mr4224633plp.105.1521253601324; Fri, 16 Mar 2018 19:26:41 -0700 (PDT) Received: from localhost.localdomain (76-246-10-223.lightspeed.snmtca.sbcglobal.net. [76.246.10.223]) by smtp.gmail.com with ESMTPSA id 70sm14828386pgb.86.2018.03.16.19.26.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Mar 2018 19:26:40 -0700 (PDT) From: Courtland Idstrom To: ffmpeg-devel@ffmpeg.org Date: Fri, 16 Mar 2018 19:26:36 -0700 Message-Id: <20180317022637.24032-1-cidstrom@telltalegames.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) Subject: [FFmpeg-devel] [PATCH 1/2] Add option -movflags write_track_title which will write track title metadata. This is useful in conjunction with the metadata flag to specify track title, especially for workflows that are including multiple audio tracks in the same file. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Courtland Idstrom MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Example: ffmpeg -i in.mov -movflags write_track_title -metadata:s:a:0 title="Eng-FullMix" --- libavformat/movenc.c | 3 ++- libavformat/movenc.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 5b1e66c897..3b1a734a0a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -79,6 +79,7 @@ static const AVOption options[] = { { "use_metadata_tags", "Use mdta atom for metadata.", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_USE_MDTA}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "skip_trailer", "Skip writing the mfra/tfra/mfro trailer for fragmented files", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_SKIP_TRAILER}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "negative_cts_offsets", "Use negative CTS offsets (reducing the need for edit lists)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, + { "write_track_title", "Include track title metadata, even for MOV containers", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_TRACK_TITLE}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, @@ -3027,7 +3028,7 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, if (ret < 0) return ret; - if (mov->mode & MODE_MP4) + if (mov->mode & MODE_MP4 || mov->flags & FF_MOV_FLAG_TRACK_TITLE) mov_write_track_metadata(pb_buf, st, "name", "title"); if ((size = avio_close_dyn_buf(pb_buf, &buf)) > 0) { diff --git a/libavformat/movenc.h b/libavformat/movenc.h index ca2a9c9722..72dd7a958b 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -246,6 +246,7 @@ typedef struct MOVMuxContext { #define FF_MOV_FLAG_SKIP_TRAILER (1 << 18) #define FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS (1 << 19) #define FF_MOV_FLAG_FRAG_EVERY_FRAME (1 << 20) +#define FF_MOV_FLAG_TRACK_TITLE (1 << 21) int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);