How to tag or add metadata to a video file with GStreamer?

…衆ロ難τιáo~ 提交于 2020-01-06 19:50:53

问题


I would like to add metadatas to an MP4 video file with GStreamer:

  1. How to do it while recording the file?
  2. How to do it when the file is already recorded?
  3. Is that possible to check these modifications with GStreamer?

For example, with FFmpeg, I can add a title to my video with this command line:

ffmpeg -i in.mp4 -metadata title="my title" out.mp4

And then, I check the result with mediainfo:

mediainfo out.mp4

回答1:


I found a way to do it with a debug plugin: taginject

For example, in order to tag a file:

gst-launch-1.0 filesrc location=file.mp4 ! qtdemux ! h264parse ! taginject tags="title=\"MyTitle\",artist=\"MyArtist\"" ! mp4mux ! filesink location=tagged_file.mp4

If you want to check it:

gst-launch-1.0 -t filesrc location=tagged_file.mp4 ! qtdemux ! fakesink


来源:https://stackoverflow.com/questions/41470961/how-to-tag-or-add-metadata-to-a-video-file-with-gstreamer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!