From 7e510dc4e6fa7e03f69be7d1e86717c9edccce68 Mon Sep 17 00:00:00 2001 From: Awin Huang Date: Fri, 21 Mar 2025 10:29:05 +0800 Subject: [PATCH] vault backup: 2025-03-21 10:29:05 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Affected files: 00. Inbox/未命名.canvas --- 00. Inbox/未命名.canvas | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/00. Inbox/未命名.canvas b/00. Inbox/未命名.canvas index fe75223..a4f8842 100644 --- a/00. Inbox/未命名.canvas +++ b/00. Inbox/未命名.canvas @@ -1,11 +1,28 @@ { "nodes":[ - {"id":"4692d58b834eee84","x":-300,"y":-160,"width":274,"height":60,"type":"text","text":"`AVFormatContext* formatContext`"}, - {"id":"3338d0ae0a5d52e8","x":14,"y":-160,"width":250,"height":60,"type":"text","text":"`AVCodec* codec`"}, - {"id":"bf7f90f77714e446","x":-300,"y":-40,"width":274,"height":60,"type":"text","text":"`AVCodecContext* codecContext`"}, - {"id":"8197b443d5d2a0ee","x":-300,"y":60,"width":250,"height":60,"type":"text","text":"`AVStream* stream`"}, - {"id":"e4fc1011aa51d648","x":-300,"y":280,"width":250,"height":60,"type":"text","text":"`AVPacket* packet`"}, - {"id":"3e5e2eb286b66064","x":-300,"y":180,"width":250,"height":60,"type":"text","text":"`AVFrame* frame`"} + {"id":"657749e452ae22a2","type":"group","x":-461,"y":-230,"width":425,"height":270,"label":"Create CodecContext by CODEC"}, + {"id":"a8a281b03160720c","type":"group","x":-1620,"y":-230,"width":475,"height":150,"label":"Create AVStream by AVFormatCOntext"}, + {"id":"dadd55c0e82a0f75","type":"group","x":-461,"y":110,"width":442,"height":150,"label":"Create CODEC"}, + {"id":"ba45f40b19ea44d3","type":"group","x":-1596,"y":110,"width":426,"height":150,"label":"Create AVFormatContext"}, + {"id":"b083af0a802c90b1","type":"text","text":"`codecContext = avcodec_alloc_context3(codec);`","x":-441,"y":-150,"width":385,"height":50}, + {"id":"bf7f90f77714e446","type":"text","text":"`AVCodecContext* codecContext`","x":-395,"y":-210,"width":274,"height":50}, + {"id":"eed8fddf0e282c05","type":"text","text":"`codec = avcodec_find_encoder(AV_CODEC_ID_MP3)`","x":-441,"y":190,"width":402,"height":50}, + {"id":"3338d0ae0a5d52e8","type":"text","text":"`AVCodec* codec`","x":-374,"y":130,"width":250,"height":50}, + {"id":"5f8636c9725a3ffe","type":"text","text":"```cpp\n// Set codec parameters\n codecContext->bit_rate = bitRate;\n codecContext->sample_rate = sampleRate;\n codecContext->channels = channels;\n codecContext->channel_layout = av_get_default_channel_layout(channels);\n codecContext->sample_fmt = AV_SAMPLE_FMT_S16P; // MP3 encoder usually requires planar s16\n // Some formats need stream headers\n if (formatContext->oformat->flags & AVFMT_GLOBALHEADER) {\n codecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;\n }\n```","x":146,"y":-258,"width":712,"height":298}, + {"id":"3e5e2eb286b66064","type":"text","text":"`AVFrame* frame`","x":252,"y":85,"width":250,"height":60}, + {"id":"e4fc1011aa51d648","type":"text","text":"`AVPacket* packet`","x":252,"y":185,"width":250,"height":60}, + {"id":"b9f9abb339e512d2","type":"text","text":"`avcodec_open2(codecContext, codec, nullptr);`","x":-436,"y":-80,"width":375,"height":50}, + {"id":"7e6ff8d4cb0730ad","type":"text","text":"`stream = avformat_new_stream(formatContext, nullptr);`","x":-1600,"y":-150,"width":435,"height":50}, + {"id":"8197b443d5d2a0ee","type":"text","text":"`AVStream* stream`","x":-1507,"y":-210,"width":250,"height":50}, + {"id":"ffb5250ae3d92551","type":"text","text":"`avformat_alloc_output_context2(&formatContext`)","x":-1576,"y":190,"width":386,"height":50}, + {"id":"4692d58b834eee84","type":"text","text":"`AVFormatContext* formatContext`","x":-1520,"y":130,"width":274,"height":50}, + {"id":"47e7b62d1a0bfa79","type":"text","text":"`avcodec_parameters_from_context(stream->codecpar, codecContext)`","x":-1040,"y":-160,"width":507,"height":50} ], - "edges":[] + "edges":[ + {"id":"e2cf21a4ba912fcf","fromNode":"657749e452ae22a2","fromSide":"right","toNode":"5f8636c9725a3ffe","toSide":"left"}, + {"id":"1473a901cc2657ec","fromNode":"dadd55c0e82a0f75","fromSide":"top","toNode":"657749e452ae22a2","toSide":"bottom"}, + {"id":"2b3cdd328f451c81","fromNode":"ba45f40b19ea44d3","fromSide":"top","toNode":"a8a281b03160720c","toSide":"bottom"}, + {"id":"b69dc1ba45835fbe","fromNode":"8197b443d5d2a0ee","fromSide":"right","toNode":"47e7b62d1a0bfa79","toSide":"left"}, + {"id":"3e9fa7e107bf252c","fromNode":"b083af0a802c90b1","fromSide":"left","toNode":"47e7b62d1a0bfa79","toSide":"right"} + ] } \ No newline at end of file