将元数据嵌入H.264编码文件 [英] Embedding Metadata to H.264 encoded file

查看:215
本文介绍了将元数据嵌入H.264编码文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一种应用程序,该应用程序相对于来自相机的预览帧产生某些元数据。我可以看到这个元数据正确生成,这里没有问题。

I am currently developing an application which produces certain metadata with respect to preview frames coming from the camera. I can see this metadata being produced properly and I have no problems here.

但是,我必须将这个元数据嵌入到这些感兴趣的框架中(框架由本机算法来生成这个元数据)。我正在使用x264的ffmpeg将帧编码为H.264。我已经检查了x264.h和一些文件,但找不到我所寻求的东西。

However, I have to embed this metadata to these frames of interest (frames are processed by a native algorithm to produce this metadata). I am using ffmpeg with x264 to encode the frames into H.264. I have checked x264.h and some documentations but failed to find what I seek.

我的问题是是否有任何未使用的H.264语法部分,我可以将我的元数据嵌入编码帧?

My question is; is there any unused portion of H.264 syntax that I can embed my metadata to encoded frames?

我希望我足够清楚。感谢提前。

I hope I was clear enough. Thanks in advance.

推荐答案

大多数视频基本流都有用户数据的规定。在h.264这是SEI第一单位的一部分。您可以在要将其关联的每个框架之前添加一个。我不认为x264支持从外部添加用户数据。

Most video elementary streams have a provision for "user data". In h.264 this is part of the SEI nal unit. You can add one before every frame you want to associate it with. I don't think that x264 has support to add user data from outside.

两个选择:


  1. 修改x264 / ffmpeg以添加SEI消息,其中你有没有想要以你喜欢的形式进行输入。

  2. 创建你的流,创建你的元数据。现在分别写一个小程序来读取元数据并解析文件,然后在所需框架之前推入SEI NAL。

对于SEI语法,您应该能够使用google并获取它。看最好的地方是H.264标准。一个更简单的方法是看看x264中的代码。它在开始(编码参数)中插入一个用户数据。

For SEI syntax you should be able to google and get it. The best place to look though is the H.264 standard. A easier way is to just look at the code in x264. It does insert one user data at the begining (the encoding parameters).

这篇关于将元数据嵌入H.264编码文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆