{"id":17206810,"url":"https://github.com/shootingking-am/ffmpeg-pseudocode-tutorial","last_synced_at":"2025-04-13T22:12:23.917Z","repository":{"id":94498094,"uuid":"322766702","full_name":"ShootingKing-AM/ffmpeg-pseudocode-tutorial","owner":"ShootingKing-AM","description":"A brief understanding of ffmpeg cli through pseudocode","archived":false,"fork":false,"pushed_at":"2020-12-20T17:04:10.000Z","size":827,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T22:12:20.515Z","etag":null,"topics":["ffmpeg","libav","pseudocode","tutorial"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShootingKing-AM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-12-19T04:32:15.000Z","updated_at":"2025-02-03T15:28:01.000Z","dependencies_parsed_at":"2023-05-17T02:15:50.798Z","dependency_job_id":null,"html_url":"https://github.com/ShootingKing-AM/ffmpeg-pseudocode-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShootingKing-AM%2Fffmpeg-pseudocode-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShootingKing-AM%2Fffmpeg-pseudocode-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShootingKing-AM%2Fffmpeg-pseudocode-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShootingKing-AM%2Fffmpeg-pseudocode-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShootingKing-AM","download_url":"https://codeload.github.com/ShootingKing-AM/ffmpeg-pseudocode-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788915,"owners_count":21161728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","libav","pseudocode","tutorial"],"created_at":"2024-10-15T02:44:02.472Z","updated_at":"2025-04-13T22:12:23.877Z","avatar_url":"https://github.com/ShootingKing-AM.png","language":"HTML","readme":"# FFmpeg/libav Pseudocode Tutorial\nA broad workflow understanding of ffmpeg-cli through loose pseudocode.\n\nFFmpeg-cli source from [github/FFmpeg](https://github.com/FFmpeg/FFmpeg#ffmpeg-readme), Dec'2020 - [Tree](https://github.com/FFmpeg/FFmpeg/tree/001bc594d82f3df67a6e96c6ea022f4e39002385)\n\n## Rationale\n[FFmpeg](http://ffmpeg.org/about.html) is a collection of libraries and includes a command-line-interface(*cli*) tool to **manipulate, convert and stream multimedia** content.\n\nThe goal of understanding ffmpeg-cli is to be able to to integrate FFmpeg into our projects without having to call the ffmpeg-cli in background to do multimedia operation. This is important because,\n1. Starting up an external executable tends to be blocked by antivirus software and can cause issues with users.\n2. Optimize your project specific libav usage and skip unnecessary code from ffmpeg-cli\n\nAlso, ffmpeg official documentation being vague at best, the only option for developers looking to implement ffmpeg's libraries (`libav`) functionality into their code is to read the command line interface's source code.\n\nReading ffmpeg-cli's source code is very hard, because its not meant to be used as a study material for understanding how to use `libav` but as a optimized multimedia tool. Hence, i tried to straighten out its source code into simple pseudocode function highlighting **when and where** to call important(almost all) libav's functions, for an overall broader picture of ffmpeg workflow. For information regarding **how** to call a `libav` function call, one can refer to the [doxygen documentation](https://ffmpeg.org/doxygen/4.1/index.html) and [ffmpeg-cli-source files](https://github.com/FFmpeg/FFmpeg/tree/master/fftools).\n\nLack of tutorials in this regard compelled me to open-source this document.\n\n## How to read through Pseudocode \n1. This pseudocode, assumes you have basic multimedia knowledge and ffmpeg internal structure. (if not head over to this [picture tutorial](https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/master/README.md)).\n2. This pseudocode also assumes you have basic understanding of C(++) functions.\n3. The `syntactical rules` of the following pseudocode are,\n\n\t**a.** There are `two sets` of functions, \u003cbr/\u003e\u003cbr/\u003e\n\t\ti. `Standard library calls`, those are available in *libav* headers(, .libs, .dlls), and\u003cbr/\u003e\n\t\tii. `ffmpeg-cli specific functions`(non-std functions), these should be understood and should be implemented in your specific project.\u003cbr/\u003e    \n\t\t`Non-std` function have been named as `\u003cfile\u003e::\u003cfunctionName\u003e()` in pseudocode, so that you can refer to those specific source files to get the exact working.\u003cbr/\u003e\n\t\t`Std` function just have `\u003cfunctionName\u003e()` and usually start with `av*`\n    \n\t**b.** Each \u003ckbd\u003etab\u003c/kbd\u003e indicates that the upcoming function call(s) is/are inside the above function call. For example,\n\t```swift\n\tfoo()\n\t    bar()\n\t```\n\tThis means `bar()` function call is inside `foo()` function and `bar()` is being called by `foo()`.\n  \n\t**c.** `//` indicates there is code which does *something* in place of this comment.\u003cbr/\u003e\n\t\t`/**/` Indicates a comment which explains the following code.\u003cbr/\u003e\n\t\t`///` Indicates just a comment.\n### ffmpeg-cli Pseudocode\nSyntax highlighted pseudocode - [Here](https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/blob/master/pseudoCode.swift)\n\nFunctions linked to Doxygen ffmpeg documentation. (Click to Refer).\n\u003cpre\u003e\nmain()\n\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L117\"\u003einit_dynload\u003c/a\u003e()\n\t\tSetDllDirectory(\"\")\n\n\tregister_exit()\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L494\"\u003effmpeg_cleanup\u003c/a\u003e()\n\t\t\t// Free filers FilterGraph with \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga871684449dac05050df238a18d0d493b\"\u003eavfilter_graph_free\u003c/a\u003e()\n\t\t\t\t// for each FilterGraph's Input\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ab708d2f19b7a9592caa278256787adb6\"\u003eav_fifo_generic_read\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#a612be59edb6ab388a82d1487d1bd0c4d\"\u003eav_fifo_freep\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gaa2c3e02a761d9fc0c5c9b2340408c332\"\u003eavsubtitle_free\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__buffer.html#ga135e9e929b5033bb8f68322497b2effc\"\u003eav_buffer_unref\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga294500a9856260eb1552354fd9d9a6c4\"\u003eavfilter_inout_free\u003c/a\u003e()\n\n\t\t\t// Close Files with \u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#ae118a1f37f1e48617609ead9910aac15\"\u003eavio_closep\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#gac2990b13b68e831a408fce8e1d0d6445\"\u003eavformat_free_context\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga1bafd682b1fbb90e48a4cc3814b820f7\"\u003eav_dict_free\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e()\n\n\t\t\t// Close Output Streams \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#ga08d53431e76355f88e27763b1940df4f\"\u003eav_bsf_free\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga1bafd682b1fbb90e48a4cc3814b820f7\"\u003eav_dict_free\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/eval_8c.html#a01c05d7049a9208c2b22147a3f16c58c\"\u003eav_expr_free\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gaf869d0829ed607cec3a4a02a1c7026b3\"\u003eavcodec_free_context\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga950c8da55b8112077e640b6a0cb8cf36\"\u003eavcodec_parameters_free\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ab708d2f19b7a9592caa278256787adb6\"\u003eav_fifo_generic_read\u003c/a\u003e(muxing_queue, \u0026pkt)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga63d5a489b419bd5d45cfd09091cbcbc2\"\u003eav_packet_unref\u003c/a\u003e(\u0026pkt)\t\t\t\t\t\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#a612be59edb6ab388a82d1487d1bd0c4d\"\u003eav_fifo_freep\u003c/a\u003e(muxing_queue)\n\n\t\t\tfree_input_threads()\n\t\t\t\t\n\t\t\t// Close input Files \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#gae804b99aec044690162b8b9b110236a4\"\u003eavformat_close_input\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e()\n\n\t\t\t// Close input Streams\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e(decoded_frame)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e(filter_frame)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga1bafd682b1fbb90e48a4cc3814b820f7\"\u003eav_dict_free\u003c/a\u003e(decoder_opts)\n\t\t\t\tavsubtitle_freesubtitle)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e(sub2video.frame)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e(filters)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e(hwaccel_device)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e(dts_buffer)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gaf869d0829ed607cec3a4a02a1c7026b3\"\u003eavcodec_free_context\u003c/a\u003e(dec_ctx)\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e(input_streams)\n\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#ga245f2875f80ce67ec3d1e0f54dacf2c4\"\u003eavformat_network_deinit\u003c/a\u003e()\n\n\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__log.html#gaf8143cc9a7cd364af1ff525c6181c0ce\"\u003eav_log_set_flags\u003c/a\u003e()\n\n\t// if CONFIG_AVDEVICE set \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavd.html#ga7c90a3585267b55941ae2f7388c006b6\"\u003eavdevice_register_all\u003c/a\u003e();\n\n\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#ga84542023693d61e8564c5d457979c932\"\u003eavformat_network_init\u003c/a\u003e()\n\n\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L3324\"\u003effmpeg_parse_options\u003c/a\u003e()\n\t\toptions = \u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L751\"\u003esplit_commandline\u003c/a\u003e() /* split the commandline into an internal representation */\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L245\"\u003eprepare_app_arguments\u003c/a\u003e() /* perform system-dependent conversions for arguments list */\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L703\"\u003einit_parse_context\u003c/a\u003e() \n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L82\"\u003einit_opts\u003c/a\u003e() \n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga8d9c2de72b310cef8e6a28c9cd3acbbe\"\u003eav_dict_set\u003c/a\u003e()\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L412\"\u003eparse_optgroup\u003c/a\u003e(\"GLOABAL\")\n\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L1998\"\u003eopen_files\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1059\"\u003eopen_input_file\u003c/a\u003e()\n\t\t\t\t// Check if supported file format with \n\t\t\t\tlibavformat::\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#ga7d2f532c6653c2419b17956712fdf3da\"\u003eav_find_input_format\u003c/a\u003e()\n\t\t\t\tinputContext = libavformat::\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#gac7a91abf2f59648d995894711f070f62\"\u003eavformat_alloc_context\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#gafd013a88620b2da7d497b083f6ea7d29\"\u003eav_dict_set_int\u003c/a\u003e() /* Setting global Opts as per Input file opts */\n\t\t\t\tfind_codec_or_die()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__encoding.html#gaa614ffc38511c104bdff4a3afa086d37\"\u003eavcodec_find_encoder_by_name\u003c/a\u003e()\n\t\t\t\t// Set inputContext's members as per codec\n\t\t\t\tlibavformat::\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#ga31d601155e9035d5b0e7efedc894ee49\"\u003eavformat_open_input\u003c/a\u003e()\n\t\t\t\tlibavformat::\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#gad42172e27cddafb81096939783b157bb\"\u003eavformat_find_stream_info\u003c/a\u003e()\n\t\t\t\t// if specified in cmd line options, \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#ga3b40fc8d2fda6992ae6ea2567d71ba30\"\u003eavformat_seek_file\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L767\"\u003eadd_input_streams\u003c/a\u003e()/* Add all the streams from the given input file to the global list of input streams. */\n\t\t\t\t\tdec_Context = \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gae80afec6f26df6607eaacf39b561c315\"\u003eavcodec_alloc_context3\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gac7b282f51540ca7a99416a3ba6ee0d16\"\u003eavcodec_parameters_to_context\u003c/a\u003e(dec_Context, cmdLineParameters)\n\t\t\t\t\t\t// Based on Codec_Type (VID, AUD, SUB, etc, etc)\n\t\t\t\t\t\t\tVID:\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga19a0ca553277f019dd5b0fec6e1f9dca\"\u003eavcodec_find_decoder\u003c/a\u003e()\n\t\t\t\t\t\t\t\t// Specific to HwAccelearation \n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/pixdesc_8c.html#a925ef18d69c24c3be8c53d5a7dc0660e\"\u003eav_get_pix_fmt\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/hwcontext_8c.html#a541943ddced791765349645a30adfa4d\"\u003eav_hwdevice_find_type_by_name\u003c/a\u003e()\n\t\t\t\t\t\t\tAUD:\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2124\"\u003eguess_input_channel_layout\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__channel__mask__c.html#gacb84f3e93a583e1f84a5283162a606a2\"\u003eav_get_default_channel_layout\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__channel__mask__c.html#ga99d0b5bb80534d13a6cc96336cf9076a\"\u003eav_get_channel_layout_string\u003c/a\u003e()\n\t\t\t\t\t\t\tDATA, SUB:\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga19a0ca553277f019dd5b0fec6e1f9dca\"\u003eavcodec_find_decoder\u003c/a\u003e()\n\t\t\t\t\t\t\tATTACHMENT, UNKNOWN:\n\t\t\t\t\t\t\t// Do Nothing here\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga0c7058f764778615e7978a1821ab3cfe\"\u003eavcodec_parameters_from_context\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__misc.html#gae2645941f2dc779c307eb6314fd39f10\"\u003eav_dump_format\u003c/a\u003e()\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L2119\"\u003einit_complex_filters\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c\"\u003effmpeg_filter.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c#L342\"\u003einit_complex_filtergraph\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga6c778454b86f845805ffd814b4ce51d4\"\u003eavfilter_graph_alloc\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga6c3c39e0861653c71a23f90d1397239d\"\u003eavfilter_graph_parse2\u003c/a\u003e()\n\t\t\t\t\ton fail,\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga294500a9856260eb1552354fd9d9a6c4\"\u003eavfilter_inout_free\u003c/a\u003e();\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga871684449dac05050df238a18d0d493b\"\u003eavfilter_graph_free\u003c/a\u003e();\n\t\t\t\tFor all Inputs,\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c\"\u003effmpeg_filter.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c#L255\"\u003einit_input_filter\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga2d241a0066fc3724ec3335e25bc3912e\"\u003eavfilter_pad_get_type\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L1998\"\u003echeck_stream_specifier\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__misc.html#ga7e45597834e9ef3098ddb74bc5e1550c\"\u003eavformat_match_stream_specifier\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#adae9b18c5eed14fe851c5bb984ce374b\"\u003eav_fifo_alloc\u003c/a\u003e()\n\t\t\t\tFor all outputs,\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0a8cc057ae9723ce3b9203cb5365971a\"\u003eav_mallocz\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga2d241a0066fc3724ec3335e25bc3912e\"\u003eavfilter_pad_get_type\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c\"\u003effmpeg_filter.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c#L236\"\u003edescribe_filter_link\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#adb5259ad07633518173eaa47fe6575e2\"\u003eavio_open_dyn_buf\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#a79127cec97b09a308b549253119ff38f\"\u003eavio_printf\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#a1dddee2b73f4dd6512ac9821cf5adc18\"\u003eavio_w8\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#a8faed62ce72e7411cbea2356494af8ce\"\u003eavio_close_dyn_buf\u003c/a\u003e()\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c\"\u003ecmdutils.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/cmdutils.c#L1998\"\u003eopen_files\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L2131\"\u003eopen_output_file\u003c/a\u003e()\n\t\t\t\t// if no Stream maps\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avformat_8h.html#a6ddf3d982feb45fa5081420ee911f5d5\"\u003eavformat_alloc_output_context2\u003c/a\u003e()\t\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#gae67f143237b2cb2936c9b147aa6dfde3\"\u003eav_dict_get\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__avoptions.html#gae31ae7fb20113b00108d0ecf53f25664\"\u003eav_opt_find\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__opt__eval__funcs.html#gae245940b870e13b759354d570decf3dc\"\u003eav_opt_eval_flags\u003c/a\u003e()\n\t\t\t\t\n\t\t\t\t\t/* create streams for all unlabeled output pads */\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L2077\"\u003einit_output_filter\u003c/a\u003e()\n\t\t\t\t\t\t// Based on Type\n\t\t\t\t\t\tVID:\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1679\"\u003enew_video_stream\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1413\"\u003enew_output_stream\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#gadcb0fd3e507d9b58fe78f61f8ad39827\"\u003eavformat_new_stream\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0a8cc057ae9723ce3b9203cb5365971a\"\u003eav_mallocz\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1378\"\u003echoose_encoder\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__encoding.html#gae8a1efab53a348857f209ea51037da4c\"\u003eav_guess_codec\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__encoding.html#ga9f820c481615c3a02d0407bac0bdbf25\"\u003eavcodec_find_encoder\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gae80afec6f26df6607eaacf39b561c315\"\u003eavcodec_alloc_context3\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga647755ab2252e93221bb345f3d5e414f\"\u003eavcodec_parameters_alloc\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1352\"\u003eget_preset_file_2\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga8d9c2de72b310cef8e6a28c9cd3acbbe\"\u003eav_dict_set\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#a079eab092887563f2bef9106c6120089\"\u003eav_free\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#ae118a1f37f1e48617609ead9910aac15\"\u003eavio_closep\u003c/a\u003e();\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/parseutils_8c.html#a8535b8693aa5a188cfb1356133c0e94e\"\u003eav_parse_ratio\u003c/a\u003e() // for Timebase and enc_Timebase\n\t\t\t\t\t\t\t\t\t// Parse and Set options\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/parseutils_8c.html#a63c6a2937ebf4b6722c255286755e557\"\u003eav_parse_video_rate\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/parseutils_8c.html#a8535b8693aa5a188cfb1356133c0e94e\"\u003eav_parse_ratio\u003c/a\u003e() // for AspectRatio\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/parseutils_8c.html#a4dcdb8a2792f2074ca4a1e1f4ddce2bf\"\u003eav_parse_video_size\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/pixdesc_8c.html#a925ef18d69c24c3be8c53d5a7dc0660e\"\u003eav_get_pix_fmt\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__misc.html#ga553b85a36da32c041738a89aa61f9fbd\"\u003eav_fopen_utf8\u003c/a\u003e() // log file\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1645\"\u003eget_ost_filters\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\tread_file() //read filter script from file\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#a371a670112abc5f3e15bc570da076301\"\u003eavio_open\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#adb5259ad07633518173eaa47fe6575e2\"\u003eavio_open_dyn_buf\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#abb4e58439be0bff0dc2e2974ee5fb6a3\"\u003eavio_read\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#acc3626afc6aa3964b75d02811457164e\"\u003eavio_write\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#a1dddee2b73f4dd6512ac9821cf5adc18\"\u003eavio_w8\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#ae118a1f37f1e48617609ead9910aac15\"\u003eavio_closep\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#a8faed62ce72e7411cbea2356494af8ce\"\u003eavio_close_dyn_buf\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\tor get from CmdLine \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga7c352f4cff02184f005323691375fea9\"\u003eav_strdup\u003c/a\u003e()\n\t\t\t\t\t\tAUD:\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1877\"\u003enew_audio_stream\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1413\"\u003enew_output_stream\u003c/a\u003e() // Same calls as above incase of VID\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__sampfmts.html#ga655c989b749667468e5e839e26fe63db\"\u003eav_get_sample_fmt\u003c/a\u003e()\n\t\t\t\t\t\t\tget_ost_filters()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#gad8fde0c159ac905909339e082a049cde\"\u003eav_reallocp_array\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga294500a9856260eb1552354fd9d9a6c4\"\u003eavfilter_inout_free\u003c/a\u003e()\n\t\t\t\t\t// Based on Type (VID, AUD)\n\t\t\t\t\tVID:\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__encoding.html#gae8a1efab53a348857f209ea51037da4c\"\u003eav_guess_codec\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__misc.html#gaa90b4c72d1bbb298e11096d3a09ec7db\"\u003eavformat_query_codec\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1679\"\u003enew_video_stream\u003c/a\u003e() // Same calls as above\n\t\t\t\t\tAUD:\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__encoding.html#gae8a1efab53a348857f209ea51037da4c\"\u003eav_guess_codec\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1877\"\u003enew_audio_stream\u003c/a\u003e() // Same calls as above\n\t\t\t\t\tSUBTITLE:\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__encoding.html#ga9f820c481615c3a02d0407bac0bdbf25\"\u003eavcodec_find_encoder\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#gac09f8ddc2d4b36c5a85c6befba0d0888\"\u003eavcodec_descriptor_get\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1984\"\u003enew_subtitle_stream\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1413\"\u003enew_output_stream\u003c/a\u003e() // Same Calls as above\n\t\t\t\t\tDATA:\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__encoding.html#gae8a1efab53a348857f209ea51037da4c\"\u003eav_guess_codec\u003c/a\u003e()\n\t\t\t\telse\n\t\t\t\t\t// For all stream maps\n\t\t\t\t\t\tif LinkLabel\n\t\t\t\t\t\t\tinit_output_filter() // Same class as above\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcase AVMEDIA_TYPE_VIDEO:      new_video_stream()\n\t\t\t\t\t\t\tcase AVMEDIA_TYPE_AUDIO:      new_audio_stream()\n\t\t\t\t\t\t\tcase AVMEDIA_TYPE_SUBTITLE:   new_subtitle_stream()\n\t\t\t\t\t\t\tcase AVMEDIA_TYPE_DATA:       new_data_stream()\n\t\t\t\t\t\t\tcase AVMEDIA_TYPE_ATTACHMENT: new_attachment_stream()\n\t\t\t\t\t\t\tcase AVMEDIA_TYPE_UNKNOWN:    new_unknown_stream()\n\t\t\t/* handle attached files */\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#ade8a63980569494c99593ebf0d1e891b\"\u003eavio_open2\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#ae97db1f58b6b1515ed57a83bea3dd572\"\u003eav_malloc\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#abb4e58439be0bff0dc2e2974ee5fb6a3\"\u003eavio_read\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L1976\"\u003enew_attachment_stream\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga8d9c2de72b310cef8e6a28c9cd3acbbe\"\u003eav_dict_set\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#ae118a1f37f1e48617609ead9910aac15\"\u003eavio_closep\u003c/a\u003e()\n\t\t\t// Set options\n\n\t\t\t/* set the decoding_needed flags and create simple filtergraphs */\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c\"\u003effmpeg_opt.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_opt.c#L3399\"\u003einit_simple_filtergraph\u003c/a\u003e()\n\t\t\t// set the filter output constraints\n\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avio_8h.html#ade8a63980569494c99593ebf0d1e891b\"\u003eavio_open2\u003c/a\u003e()\n\n\t\t\t// copy metadata\n\t\t\t// copy chapters\n\t\t\t// copy global metadata by default\n\n\t\t\t// process manually set programs\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#gab31f7c7c99dcadead38e8e83e0fdb828\"\u003eav_new_program\u003c/a\u003e()\n\t\ton fail, uninit_parse_context()\n\n\t/* The following code is the main loop of the file converter */\n\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4790\"\u003etranscode\u003c/a\u003e()\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3747\"\u003etranscode_init\u003c/a\u003e()\n\t\t\t//Link FilterGraphs and OutputFilter\n\n\t\t\t/* init framerate emulation */\n\t\t\tInputFile.InputStreams = \u003ca href=\"https://ffmpeg.org/doxygen/4.1/time_8c.html#adf0e36df54426fa167e3cc5a3406f3b7\"\u003eav_gettime_relative\u003c/a\u003e()\n\n\t\t\t/* init input streams */\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2959\"\u003einit_input_stream\u003c/a\u003e()\n\t\t\t\t/* Set Dec_Context Options */\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2\"\u003eav_opt_set_int\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#ga8d9c2de72b310cef8e6a28c9cd3acbbe\"\u003eav_dict_set\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L303\"\u003ehw_device_setup_for_decode\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L44\"\u003ehw_device_get_by_name\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L231\"\u003ehw_device_init_from_type\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L69\"\u003ehw_device_default_name\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/hwcontext_8c.html#afb2b99a15f3fdde25a2fd19353ac5a67\"\u003eav_hwdevice_get_type_name\u003c/a\u003e()\t\t\t\t\t\t\t\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/hwcontext_8c.html#a21fbd088225e4e25c4d9a01b3f5e8c51\"\u003eav_hwdevice_ctx_create\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L54\"\u003ehw_device_add\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#gad8fde0c159ac905909339e082a049cde\"\u003eav_reallocp_array\u003c/a\u003e(hw_devices)\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0a8cc057ae9723ce3b9203cb5365971a\"\u003eav_mallocz\u003c/a\u003e()\n\t\t\t\t\t\tOn fail, \u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e() \u0026 av_buffer_unref()\n\t\t\t\t\tif Generic HWACCEL_AUTO Device, \n\t\t\t\t\t\thw_device_match_by_codec()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga4f80582a2ea9c0e141de5d6f6152008f\"\u003eavcodec_get_hw_config\u003c/a\u003e()\n\t\t\t\t\t\thw_device_init_from_type()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d\"\u003eavcodec_open2\u003c/a\u003e()\n\t\t\tOn fail init_input_stream(), Close all Encoding contexts with \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gaf4daa92361efb3523ef5afeb0b54077f\"\u003eavcodec_close\u003c/a\u003e()\n\t\t\t/*\n\t\t\t * initialize stream copy and subtitle/data streams.\n\t\t\t * Encoded AVFrame based streams will get initialized as follows:\n\t\t\t * - when the first AVFrame is received in do_video_out\n\t\t\t * - just before the first AVFrame is received in either transcode_step\n\t\t\t *   or reap_filters due to us requiring the filter chain buffer sink\n\t\t\t *   to be configured with the correct audio frame size, which is only\n\t\t\t *   known after the encoder is initialized.\n\t\t\t */\n\t\t\t \u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L958\"\u003einit_output_stream_wrapper\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L955\"\u003einit_output_stream\u003c/a\u003e()\n\t\t\t\t\t/* If encoding_needed */\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3360\"\u003einit_output_stream_encode\u003c/a\u003e()\n\t\t\t\t\t\t\t// Set Options\n\t\t\t\t\t\t\tBased on Codec Type,\n\t\t\t\t\t\t\tAUD:\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga402ddbef6f7347869725696846ac81eb\"\u003eav_buffersink_get_format\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__sampfmts.html#ga0c3c218e1dd570ad4917c69a35a6c77d\"\u003eav_get_bytes_per_sample\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga2af714e82f48759551acdbc4488ded4a\"\u003eav_buffersink_get_sample_rate\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga87e21bf198fd932c30cc3cdc6b16bff1\"\u003eav_buffersink_get_channel_layout\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#gace78881c41bf449527826b95d21279a2\"\u003eav_buffersink_get_channels\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3336\"\u003einit_encoder_time_base\u003c/a\u003e() // Based on SampleRate\n\t\t\t\t\t\t\tVID:\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3336\"\u003einit_encoder_time_base\u003c/a\u003e() // Based on frameRate\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#gabc82f65ec7f4fa47c5216260639258a1\"\u003eav_buffersink_get_time_base\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#gac8c86515d2ef56090395dfd74854c835\"\u003eav_buffersink_get_w\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga955ecf3680e71e10429d7500343be25c\"\u003eav_buffersink_get_h\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#gaa38ee33e1c7f6f7cb190bd2330e5f848\"\u003eav_buffersink_get_sample_aspect_ratio\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga402ddbef6f7347869725696846ac81eb\"\u003eav_buffersink_get_format\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/pixdesc_8c.html#afe0c3e8aef5173de28bbdaea4298f5f0\"\u003eav_pix_fmt_desc_get\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\t// Set other options on Enc_Context\n\t\t\t\t\t\t\tSUB: // Set options\n\t\t\t\t\t\t\tDATA: // Set Options\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L419\"\u003ehw_device_setup_for_encode\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#gaa1415790bfe3dacb5af1c60e9eda3714\"\u003eav_buffersink_get_hw_frames_ctx\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga4f80582a2ea9c0e141de5d6f6152008f\"\u003eavcodec_get_hw_config\u003c/a\u003e()\n\t\t\t\t\t\t\t// Set Enc_Context Options\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#gac09f8ddc2d4b36c5a85c6befba0d0888\"\u003eavcodec_descriptor_get\u003c/a\u003e(deCodecContext)\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#gac09f8ddc2d4b36c5a85c6befba0d0888\"\u003eavcodec_descriptor_get\u003c/a\u003e(OutputStream)\n\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d\"\u003eavcodec_open2\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink.html#ga359d7d1e42c27ca14c07559d4e9adba7\"\u003eav_buffersink_set_frame_size\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga0c7058f764778615e7978a1821ab3cfe\"\u003eavcodec_parameters_from_context\u003c/a\u003e(ost-\u003est-\u003ecodecpar, ost-\u003eenc_ctx)\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gae381631ba4fb14f4124575d9ceacb87e\"\u003eavcodec_copy_context\u003c/a\u003e(ost-\u003est-\u003ecodec, ost-\u003eenc_ctx)\n\t\t\t\t\t\t/* if has coded_side_data, */\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#gae324697cedd36e7b47a1e142dc24b805\"\u003eav_stream_new_side_data\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__video__display.html#ga5964303bfe085ad33683bc2454768d4a\"\u003eav_display_rotation_set\u003c/a\u003e()\n\t\t\t\t\t/* else if StreamCopy */\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3115\"\u003einit_output_stream_streamcopy\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gac7b282f51540ca7a99416a3ba6ee0d16\"\u003eavcodec_parameters_to_context\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga0c7058f764778615e7978a1821ab3cfe\"\u003eavcodec_parameters_from_context\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga6d02e640ccc12c783841ce51d09b9fa7\"\u003eavcodec_parameters_copy\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__misc.html#gae35832b110d26ffa3e8805b3d55e8f36\"\u003eavformat_transfer_internal_stream_timing_info\u003c/a\u003e()\n\n\t\t\t\t\t\t\t// copy timebase while removing common factors\n\t\t\t\t\t\t\t// copy estimated duration as a hint to the muxer\n\t\t\t\t\t\t\t// copy disposition\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__core.html#gae324697cedd36e7b47a1e142dc24b805\"\u003eav_stream_new_side_data\u003c/a\u003e()\n\t\t\t\t\t\t\t// Set options on OutputStream\n\n\t\t\t\t\t// parse user provided disposition, and update stream values\n\t\t\t\t\t\n\t\t\t\t\t/* initialize bitstream filters for the output stream\n\t\t\t\t\t * needs to be done here, because the codec id for streamcopy is not\n\t\t\t\t\t * known until now */\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3086\"\u003einit_output_bsfs\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#ga6d02e640ccc12c783841ce51d09b9fa7\"\u003eavcodec_parameters_copy\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#ga242529d54013acf87e94273d298a5ff2\"\u003eav_bsf_init\u003c/a\u003e()\n\n\t\t\t\t\t/* open the muxer when all the streams are initialized */\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3039\"\u003echeck_init_output_file\u003c/a\u003e()\n\t\t\t\t\t\tOuputFile-\u003einterrupt_callback = int_cb;\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__encoding.html#ga18b7b10bb5b94c4842de18166bc677cb\"\u003eavformat_write_header\u003c/a\u003e()\n\n\t\t\t\t\t\t/* flush the muxing queues */\n\t\t\t\t\t\t/* try to improve muxing time_base (only possible if nothing has been written yet) */\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#a81f4cea70d96846df7111daccc5ecce2\"\u003eav_fifo_size\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ab708d2f19b7a9592caa278256787adb6\"\u003eav_fifo_generic_read\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L706\"\u003ewrite_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Audio encoders may split the packets --  #frames in != #packets out.\n\t\t\t\t\t\t\t * But there is no reordering, so we can limit the number of output packets\n\t\t\t\t\t\t\t * by simply dropping them here.\n\t\t\t\t\t\t\t * Counting encoded video frames needs to be done separately because of\n\t\t\t\t\t\t\t * reordering, see do_video_out().\n\t\t\t\t\t\t\t * Do not count the packet when unqueued because it has been counted when queued.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t if headers not written\n\t\t\t\t\t\t\t\t/* the muxer is not initialized yet, buffer the packet */\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ac1e0d8ee7f1568cb40fa95a740c60f13\"\u003eav_fifo_space\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#aeaf7aa802f3b18fef86bb72445eff5d8\"\u003eav_fifo_realloc2\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga8a6deff6c1809029037ffd760db3e0d4\"\u003eav_packet_make_refcounted\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga91dbb1359f99547adb544ee96a406b21\"\u003eav_packet_move_ref\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ae95c15dcdd266b4005f8919e4f571180\"\u003eav_fifo_generic_write\u003c/a\u003e()\n\n\t\t\t\t\t\t\tVID:\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga77a800026abd6dc2f4ac1e0ad7e3e999\"\u003eav_packet_get_side_data\u003c/a\u003e()\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gae5c86e4d93f6e7aa62ef2c60763ea67e\"\u003eav_packet_rescale_ts\u003c/a\u003e()\n\n\t\t\t\t\t\t\t// set pts, dts\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__encoding.html#ga37352ed2c63493c38219d935e71db6c1\"\u003eav_interleaved_write_frame\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga63d5a489b419bd5d45cfd09091cbcbc2\"\u003eav_packet_unref\u003c/a\u003e()\n\t\t\t// discard unused programs\n\n\t\t\t/* write headers for files with no streams */\n\t\t\tcheck_init_output_file() // Same calls as above\n\n\t\t\t// dump the stream mapping\n\n\t\t/// end transcode_init()\n\n\t\t/* Return 1 if there remain streams where more output is wanted, 0 otherwise. */\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3929\"\u003eneed_output\u003c/a\u003e()\n\t\t\tclose_output_stream()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e()\n\n\t\t/**\n\t\t * Run a single step of transcoding.\n\t\t *\n\t\t * @return  0 for success, \u003c0 for error\n\t\t */\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4698\"\u003etranscode_step\u003c/a\u003e()\n\t\t\t/**\n\t\t\t * Select the output stream to process.\n\t\t\t *\n\t\t\t * @return  selected output stream, or NULL if none available\n\t\t\t */\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L3959\"\u003echoose_output\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e()\n\n\t\t\tif \u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4255\"\u003egot_eagain\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4264\"\u003ereset_eagain\u003c/a\u003e()\n\t\t\t// return 0 // Stop FFMPEG\n\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2163\"\u003eifilter_has_all_input_formats\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c\"\u003effmpeg_filter.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c#L1012\"\u003econfigure_filtergraph\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c\"\u003effmpeg_filter.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c#L1002\"\u003ecleanup_filtergraph\u003c/a\u003e()\n\t\t\t\t\t// Null Output and Input filters\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga871684449dac05050df238a18d0d493b\"\u003eavfilter_graph_free\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga6c778454b86f845805ffd814b4ce51d4\"\u003eavfilter_graph_alloc\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__dict.html#gae67f143237b2cb2936c9b147aa6dfde3\"\u003eav_dict_get\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/avstring_8c.html#a98e5858f933c6e6be64f03a76e22b272\"\u003eav_strlcatf\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga6c3c39e0861653c71a23f90d1397239d\"\u003eavfilter_graph_parse2\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L525\"\u003ehw_device_setup_for_filter\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__buffer.html#gaa40ce7d3ede946a89d03323bbd7268c1\"\u003eav_buffer_ref\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga294500a9856260eb1552354fd9d9a6c4\"\u003eavfilter_inout_free\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#gae7e75e3df70de53fae2cf7950c1247a8\"\u003eavfilter_graph_set_auto_convert\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#ga1896c46b7bc6ff1bdb1a4815faa9ad07\"\u003eavfilter_graph_config\u003c/a\u003e()\n\n                /* limit the lists of allowed formats to the ones selected, to\n                 * make sure they stay the same if the filtergraph is reconfigured later */\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga402ddbef6f7347869725696846ac81eb\"\u003eav_buffersink_get_format\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#gac8c86515d2ef56090395dfd74854c835\"\u003eav_buffersink_get_w\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga955ecf3680e71e10429d7500343be25c\"\u003eav_buffersink_get_h\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga2af714e82f48759551acdbc4488ded4a\"\u003eav_buffersink_get_sample_rate\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga87e21bf198fd932c30cc3cdc6b16bff1\"\u003eav_buffersink_get_channel_layout\u003c/a\u003e()\n\n\t\t\t\tAUD: and AV_CODEC_CAP_VARIABLE_FRAME_SIZE = 0\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink.html#ga359d7d1e42c27ca14c07559d4e9adba7\"\u003eav_buffersink_set_frame_size\u003c/a\u003e()\n\n\t\t\t\tRead all input frame queue, \u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#a81f4cea70d96846df7111daccc5ecce2\"\u003eav_fifo_size\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ab708d2f19b7a9592caa278256787adb6\"\u003eav_fifo_generic_read\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersrc.html#ga8fc71cb48c1ad1aa78b48f87daa4cf19\"\u003eav_buffersrc_add_frame\u003c/a\u003e()\n\t\t\t\t\tav_frame_free\n\n\t\t\t\t/* send the EOFs for the finished inputs */\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersrc.html#ga8fc71cb48c1ad1aa78b48f87daa4cf19\"\u003eav_buffersrc_add_frame\u003c/a\u003e()\n\n\t\t\t\t/* process queued up subtitle packets */\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ab708d2f19b7a9592caa278256787adb6\"\u003eav_fifo_generic_read\u003c/a\u003e()\n\t\t\t\t\tsub2video_update()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__core.html#gaa2c3e02a761d9fc0c5c9b2340408c332\"\u003eavsubtitle_free\u003c/a\u003e()\n\t\t\t\tOn any fail,\n\t\t\t\t\tcleanup_filtergraph() // Calls same as above\n\n\t\t\t/*\n\t\t\t * Similar case to the early audio initialization in reap_filters.\n\t\t\t * Audio is special in ffmpeg.c currently as we depend on lavfi's\n\t\t\t * audio frame buffering/creation to get the output audio frame size\n\t\t\t * in samples correct. The audio frame size for the filter chain is\n\t\t\t * configured during the output stream initialization.\n\t\t\t *\n\t\t\t * Apparently avfilter_graph_request_oldest (called in\n\t\t\t * transcode_from_filter just down the line) peeks. Peeking already\n\t\t\t * puts one frame \"ready to be given out\", which means that any\n\t\t\t * update in filter buffer sink configuration afterwards will not\n\t\t\t * help us. And yes, even if it would be utilized,\n\t\t\t * av_buffersink_get_samples is affected, as it internally utilizes\n\t\t\t * the same early exit for peeked frames.\n\t\t\t *\n\t\t\t * In other words, if avfilter_graph_request_oldest would not make\n\t\t\t * further filter chain configuration or usage of\n\t\t\t * av_buffersink_get_samples useless (by just causing the return\n\t\t\t * of the peeked AVFrame as-is), we could get rid of this additional\n\t\t\t * early encoder initialization.\n\t\t\t */\n\t\t\t \u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L958\"\u003einit_output_stream_wrapper\u003c/a\u003e() // Same calls as above\n\n\t\t\t /**\n\t\t\t * Perform a step of transcoding for the specified filter graph.\n\t\t\t *\n\t\t\t * @param[in]  graph     filter graph to consider\n\t\t\t * @param[out] best_ist  input stream where a frame would allow to continue\n\t\t\t * @return  0 for success, \u003c0 for error\n\t\t\t */\n\t\t\t \u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4652\"\u003etranscode_from_filter\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi.html#gab20535e0685fb5f9b4f02e436412c3f0\"\u003eavfilter_graph_request_oldest\u003c/a\u003e()\n\t\t\t\t/**\n\t\t\t\t * Get and encode new output from any of the filtergraphs, without causing\n\t\t\t\t * activity.\n\t\t\t\t *\n\t\t\t\t * @return  0 for success, \u003c0 for severe errors\n\t\t\t\t */\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1491\"\u003ereap_filters\u003c/a\u003e()\n\t\t\t\t\tAUD:\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L958\"\u003einit_output_stream_wrapper\u003c/a\u003e() // Same Calls as before\n\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink.html#ga71ae9c529c8da51681e12faa37d1a395\"\u003eav_buffersink_get_frame_flags\u003c/a\u003e()\n\t\t\t\t\t\n\t\t\t\t\tVID:\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1124\"\u003edo_video_out\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L958\"\u003einit_output_stream_wrapper\u003c/a\u003e() // Same Calls as before\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L911\"\u003eadjust_frame_pts_to_encoder_tb\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e(pts,etc...)\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersink__accessors.html#ga55614fd28de2fa05b04f427390061d5b\"\u003eav_buffersink_get_frame_rate\u003c/a\u003e()\n\n\t\t\t\t\t\t\t// Keyframe settings, pts, dts, SYNC Settings, Calculations\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga9395cb802a5febf1f00df31497779169\"\u003eavcodec_send_frame\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga132d6c01d0a21e5b48b96cd7c988de91\"\u003eav_frame_remove_side_data\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga5b8eff59cf259747cf0b31563e38ded6\"\u003eavcodec_receive_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gae5c86e4d93f6e7aa62ef2c60763ea67e\"\u003eav_packet_rescale_ts\u003c/a\u003e()\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Send a single packet to the output, applying any bitstream filters\n\t\t\t\t\t\t\t * associated with the output stream.  This may result in any number\n\t\t\t\t\t\t\t * of packets actually being written, depending on what bitstream\n\t\t\t\t\t\t\t * filters are applied.  The supplied packet is consumed and will be\n\t\t\t\t\t\t\t * blank (as if newly-allocated) when this function returns.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * If eof is set, instead indicate EOF to all bitstream filters and\n\t\t\t\t\t\t\t * therefore flush any delayed packets to the output.  A blank packet\n\t\t\t\t\t\t\t * must be supplied in this case.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L871\"\u003eoutput_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\t/* apply the output bitstream filters */\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#gaada9ea8f08d3dcf23c14564dbc88992c\"\u003eav_bsf_send_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#ga7fffb6c87b91250956e7a2367af56b38\"\u003eav_bsf_receive_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\twrite_packet() // Same Calls as above\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108\"\u003eav_frame_unref\u003c/a\u003e()\n\t\t\t\t\tAUD:\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L979\"\u003edo_audio_out\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73\"\u003eav_init_packet\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L911\"\u003eadjust_frame_pts_to_encoder_tb\u003c/a\u003e() // Same calls as above\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L898\"\u003echeck_recording_time\u003c/a\u003e()\n\t\t\t\t\t\t\t\tclose_output_stream() // Same calls as above\n\n\t\t\t\t\t\t\t// Update pts, opts, frames, etc, etc..\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga9395cb802a5febf1f00df31497779169\"\u003eavcodec_send_frame\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga5b8eff59cf259747cf0b31563e38ded6\"\u003eavcodec_receive_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gae5c86e4d93f6e7aa62ef2c60763ea67e\"\u003eav_packet_rescale_ts\u003c/a\u003e()\n\n\t\t\t\t\t\t\toutput_packet() // Same calls as above\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108\"\u003eav_frame_unref\u003c/a\u003e()\n\t\t\t/*\n\t\t\t * Return\n\t\t\t * - 0 -- one packet was read and processed\n\t\t\t * - \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca\"\u003eAVERROR\u003c/a\u003e(EAGAIN) -- no packets were available for selected file,\n\t\t\t *   this function should be called again\n\t\t\t * - AVERROR_EOF -- this function should not be called again\n\t\t\t */\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4363\"\u003eprocess_input\u003c/a\u003e()\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4235\"\u003eget_input_packet\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#ga4fdb3084415a82e3810de6ee60e46a61\"\u003eav_read_frame\u003c/a\u003e()\n\n\t\t\t\t/* pkt = NULL means EOF (needed to flush decoder buffers) */\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2625\"\u003eprocess_input_packet\u003c/a\u003e()\n\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73\"\u003eav_init_packet\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e(dts, ...)\n\n\t\t\t\t\tAUD:\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2329\"\u003edecode_audio\u003c/a\u003e()\n\t\t\t\t\t\t\t/* This does not quite work like avcodec_decode_audio4/avcodec_decode_video2.\n\t\t\t\t\t\t\t * There is the following difference: if you got a frame, you must call\n\t\t\t\t\t\t\t * it again with pkt=NULL. pkt==NULL is treated differently from pkt-\u003esize==0\n\t\t\t\t\t\t\t *(pkt==NULL means get more output, pkt-\u003esize==0 is a flush/drain packet)\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2279\"\u003edecode\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3\"\u003eavcodec_send_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga11e6542c4e66d3028668788a1a74217c\"\u003eavcodec_receive_frame\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2144\"\u003echeck_decode_result\u003c/a\u003e()\n\t\t\t\t\t\t\t\texit_program(1)\n\n\t\t\t\t\t\t\t// Update timeBases, pts, dts, sample rates etc...\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2302\"\u003esend_frame_to_filters\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga88b0ecbc4eb3453eef3fbefa3bddeb7c\"\u003eav_frame_ref\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2174\"\u003eifilter_send_frame\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c\"\u003effmpeg_filter.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_filter.c#L1186\"\u003eifilter_parameters_from_frame\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\t\t/* (re)init the graph if possible, otherwise buffer the frame and return */\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga46d6d32f6482a3e9c19203db5877105b\"\u003eav_frame_clone\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#aeaf7aa802f3b18fef86bb72445eff5d8\"\u003eav_fifo_realloc2\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ae95c15dcdd266b4005f8919e4f571180\"\u003eav_fifo_generic_write\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1491\"\u003ereap_filters\u003c/a\u003e() // calls same as above\n\n\t\t\t\t\t\t\t\t\tffmpeg_filters.c::configure_filtergraph() // CSAA\n\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersrc.html#ga73ed90c3c3407f36e54d65f91faaaed9\"\u003eav_buffersrc_add_frame_flags\u003c/a\u003e(AV_BUFFERSRC_FLAG_PUSH)\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108\"\u003eav_frame_unref\u003c/a\u003e()\n\t\t\t\t\tVID:\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2397\"\u003edecode_video\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#gac700017c5270c79c1e1befdeeb008b2f\"\u003eav_frame_alloc\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e(Timebase)\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#gaadc230ece36ef112710b262a6601a16b\"\u003eav_realloc_array\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2279\"\u003edecode\u003c/a\u003e() // CSAA\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2144\"\u003echeck_decode_result\u003c/a\u003e() // CSAA\n\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L474\"\u003ehwaccel_retrieve_data\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#gac700017c5270c79c1e1befdeeb008b2f\"\u003eav_frame_alloc\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/hwcontext_8c.html#abf1b1664b8239d953ae2cac8b643815a\"\u003eav_hwframe_transfer_data\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#gab9b275b114ace0db95c5796bc71f3012\"\u003eav_frame_copy_props\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108\"\u003eav_frame_unref\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga709e62bc2917ffd84c5c0f4e1dfc48f7\"\u003eav_frame_move_ref\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\ton Fail,\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga979d73f3228814aee56aeca0636e37cc\"\u003eav_frame_free\u003c/a\u003e()\n\n\t\t\t\t\t\t\t// Set pts, dts, timestams, etc..\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e(pts)\n\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2302\"\u003esend_frame_to_filters\u003c/a\u003e() // CSAA\n\n\t\t\t\t\t\t\tOn fail,\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108\"\u003eav_frame_unref\u003c/a\u003e()\n\t\t\t\t\t\t// Set framerates, next dts, etc etc...\n\t\t\t\t\tSUBTITLES:\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2531\"\u003etranscode_subtitles\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga47db1b7f294b9f92684401b9c66a7c4b\"\u003eavcodec_decode_subtitle2\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2144\"\u003echeck_decode_result\u003c/a\u003e()\n\n\t\t\t\t\t\t\ton Fail,\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L313\"\u003esub2video_flush\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L240\"\u003esub2video_update\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L191\"\u003esub2video_copy_rect\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L222\"\u003esub2video_push_ref\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersrc.html#ga8fc71cb48c1ad1aa78b48f87daa4cf19\"\u003eav_buffersrc_add_frame\u003c/a\u003e(NULL)\n\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#ga3daf97178dd1b08b5e916be381cd33e4\"\u003eav_rescale\u003c/a\u003e(pts)\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L240\"\u003esub2video_update\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#adae9b18c5eed14fe851c5bb984ce374b\"\u003eav_fifo_alloc\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#aeaf7aa802f3b18fef86bb72445eff5d8\"\u003eav_fifo_realloc2\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/libavutil_2fifo_8c.html#ae95c15dcdd266b4005f8919e4f571180\"\u003eav_fifo_generic_write\u003c/a\u003e()\n\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1041\"\u003edo_subtitle_out\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#ae97db1f58b6b1515ed57a83bea3dd572\"\u003eav_malloc\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e(pts)\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__encoding.html#ga37be256d85d78f665df27ad6c8f1d65b\"\u003eavcodec_encode_subtitle\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73\"\u003eav_init_packet\u003c/a\u003e()\n\t\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L871\"\u003eoutput_packet\u003c/a\u003e() // CSAA\n\n\t\t\t\t\t/* after flushing, send an EOF on all the filter inputs attached to the stream */\n\t\t\t\t\t/* except when looping we need to flush but not to send an EOF */\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2609\"\u003esend_filter_eof\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2251\"\u003eifilter_send_eof\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersrc.html#ga828fc86955dc0530ea53c123862e3da6\"\u003eav_buffersrc_close\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1903\"\u003eifilter_parameters_from_codecpar\u003c/a\u003e()\n\n\t\t\t\t\t/* handle stream copy */\n\t\t\t\t\t// Set pts, dts, etc..\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2043\"\u003edo_streamcopy\u003c/a\u003e()\n\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73\"\u003eav_init_packet\u003c/a\u003e()\n\t\t\t\t\t\toutput_packet(NULL) // flush\n\n\t\t\t\t\t\tif past recoding time, cli, \n\t\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L849\"\u003eclose_output_stream\u003c/a\u003e() // CSAA\n\n\t\t\t\t\t\t// force the input stream PTS and other ptd, dts, settings\n\t\t\t\t\t\tAUD:\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#ga3266a8c3df0790c62259f91afcde45a9\"\u003eav_get_audio_frame_duration\u003c/a\u003e()\n\t\t\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#ga29b7c3d60d68ef678ee1f4adc61a25dc\"\u003eav_rescale_delta\u003c/a\u003e()\n\n\t\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L871\"\u003eoutput_packet\u003c/a\u003e() // CSAA\n\n\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__misc.html#gaf60b0e076f822abcb2700eb601d352a6\"\u003eavcodec_flush_buffers\u003c/a\u003e()\n\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4293\"\u003eseek_to_start\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavf__decoding.html#ga3b40fc8d2fda6992ae6ea2567d71ba30\"\u003eavformat_seek_file\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e()\n\t\t\t\t\t// Set samples, framerates, duration, etc...\n\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4235\"\u003eget_input_packet\u003c/a\u003e() // CSAA\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2625\"\u003eprocess_input_packet\u003c/a\u003e() // CSAA\n\n\t\t\t\t/* mark all outputs that don't go through lavfi as finished */\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1472\"\u003efinish_output_stream\u003c/a\u003e()\n\t\t\t\t\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L4264\"\u003ereset_eagain\u003c/a\u003e()\n\n\t\t\t\t// WRAP_CORRECTION Correcting starttime based on the enabled streams\n\t\t\t\t// Settings related to pts, dts, startime, etc, etc..\n\n\t\t\t\t/* add the stream-global side data to the first packet */\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga77a800026abd6dc2f4ac1e0ad7e3e999\"\u003eav_packet_get_side_data\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gac59f9714ac34774b43b3797c80b06c68\"\u003eav_packet_new_side_data\u003c/a\u003e()\n\t\t\t\t\tmemcpy()\n\n\t\t\t\t// Dispositon correction.. etc...Settings related to pts, dts, startime, etc, etc..\n\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L281\"\u003esub2video_heartbeat\u003c/a\u003e()\n\t\t\t\t\t/* When a frame is read from a file, examine all sub2video streams in\n\t\t\t\t\t   the same file and send the sub2video frame again. Otherwise, decoded\n\t\t\t\t\t   video frames could be accumulating in the filter graph while a filter\n\t\t\t\t\t   (possibly overlay) is desperately waiting for a subtitle frame. */\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f\"\u003eav_rescale_q\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L240\"\u003esub2video_update\u003c/a\u003e() // CSAA\n\t\t\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavfi__buffersrc.html#ga996e96007a0fda870549ac3c4e1e0967\"\u003eav_buffersrc_get_nb_failed_requests\u003c/a\u003e()\n\t\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L222\"\u003esub2video_push_ref\u003c/a\u003e() // CSAA\n\n\t\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2625\"\u003eprocess_input_packet\u003c/a\u003e() // CSAA\n\n\t\t\t\tif discard packet, \u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga63d5a489b419bd5d45cfd09091cbcbc2\"\u003eav_packet_unref\u003c/a\u003e()\n\t\t// End of trasncode_step()\n\n\t\t/* at the end of stream, we must flush the decoder buffers */\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L2625\"\u003eprocess_input_packet\u003c/a\u003e(NULL) // CSAA\n\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1916\"\u003eflush_encoders\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L1472\"\u003efinish_output_stream\u003c/a\u003e() // CSAA\n\t\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c\"\u003effmpeg.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg.c#L958\"\u003einit_output_stream_wrapper\u003c/a\u003e(NULL) // CSAA\n\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73\"\u003eav_init_packet\u003c/a\u003e(NULL)\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga5b8eff59cf259747cf0b31563e38ded6\"\u003eavcodec_receive_packet\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga9395cb802a5febf1f00df31497779169\"\u003eavcodec_send_frame\u003c/a\u003e(NULL)\n\n\t\t\toutput_packet(NULL)\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavc__packet.html#ga63d5a489b419bd5d45cfd09091cbcbc2\"\u003eav_packet_unref\u003c/a\u003e()\n\n\t\t\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c\"\u003effmpeg_hw.c\u003c/a\u003e::\u003ca href=\"https://github.com/ShootingKing-AM/ffmpeg-psedocode-tutorial/tree/master/ffmpeg-cli/ffmpeg_hw.c#L274\"\u003ehw_device_free_all\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/tableprint__vlc_8h.html#adba82e1bcd02de510a858fcbedf79ef1\"\u003eav_freep\u003c/a\u003e()\n\t\t\t\u003ca href=\"https://ffmpeg.org/doxygen/4.1/group__lavu__buffer.html#ga135e9e929b5033bb8f68322497b2effc\"\u003eav_buffer_unref\u003c/a\u003e()\n\n\t\t// Free all output streams, dicts\n\t/// End of transcode()\n/// End of main()\n\u003c/pre\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshootingking-am%2Fffmpeg-pseudocode-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshootingking-am%2Fffmpeg-pseudocode-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshootingking-am%2Fffmpeg-pseudocode-tutorial/lists"}