如何设置报头元数据为编码视频
How to set header metadata to encoded video?
我正在将一些图像编码为mp4容器内的h264视频。我实际上是在使用ffmpeg的例子muxing.c。问题是我试图在mp4容器中设置一些元数据,如艺术家,标题等…
我原以为用下面的代码就可以了,但是没有:
AVDictionary *opts = NULL;
av_dict_set(&opts, "title", "Super Lucky Dude", 0);
av_dict_set(&opts, "author", "Jacky Chan", 0);
av_dict_set(&opts, "album", "Chinese Movie", 0);
av_dict_set(&opts, "year", "05/10/2013", 0);
av_dict_set(&opts, "comment", "This video was created using example app.", 0);
av_dict_set(&opts, "genre", "Action", 0);
// Write the stream header, if any.
ret = avformat_write_header(oc, &opts);
创建整个视频后,我没有看到任何元数据写入视频文件。任何指针如何真正做到这一点正确吗?
解决方案是实际使用AVFormatContext
中的metadata
变量,而不是创建我自己的AVDictionary
并将其传递给avformat_write_header function
。
相关文章:
- 在C++中打印指向不同基元数据类型的指针的内存地址
- 以非特权用户身份查询 NTFS 特殊文件的元数据?
- 如何使用 Google Test 向测试添加元数据 / 如何将数据从 Google Test 发送到 TestEven
- 将复杂的非基元C++数据类型转换为 Erlang/Elixir 格式,以使用 NIF 导出方法
- 从模板创建通用打印函数,以打印基元数据类型变量的值
- 在 C++ 中修改 Grpc 双向流式处理期间的元数据
- cpp / c ++中的grpc客户端代码,元数据x-api-key/x-goog-api-key不起作用,给了我语音A
- 如何使用gRPC在客户端和服务器之间双向发送和接收流元数据
- 即使基类和派生类只使用基元数据类型,我是否需要定义虚拟析构函数
- 如何处理错误"E1696命令行错误:无法在Visual Studio 2017中打开元数据文件"mscorlib.dll"?
- 元数据操作失败LNK2022错误 (8013118D):重复类型中的布局信息不一致 (选择设备参数):(0x020002
- C++11 标准中的哪一部分规定了基元数据类型大小之间的相对顺序?
- 使用 ffmpeg 添加元数据信息
- WIC - Exif 元数据查询 - 如何获取图像说明
- 从Qt应用程序读取元数据
- 如何将编译时元数据/行为添加到特定函数
- 从编码域中的 MPEG 文件中读取元数据
- 在C 中显示图像及其元数据
- 如何用libcurl定义元数据
- 如何设置报头元数据为编码视频