乐闻世界logo
搜索文章和话题

How to Set video stream metadata using Ffmpeg

1个答案

1

FFmpeg is a highly versatile multimedia framework capable of handling various tasks related to video and audio, including setting video stream metadata.

If you want to set video stream metadata using FFmpeg, you can use the -metadata option. This enables you to add or modify metadata during the encoding or transcoding process. Here is a simple example:

bash
ffmpeg -i input.mp4 -metadata title="My Video Title" -metadata author="Author Name" -codec copy output.mp4

In this command:

  • -i input.mp4 specifies the input file.
  • -metadata title="My Video Title" sets the video title to "My Video Title".
  • -metadata author="Author Name" sets the video author to "Author Name".
  • -codec copy indicates that the video and audio streams are copied without re-encoding, which speeds up processing while preserving the original quality.
  • output.mp4 is the name of the output file.

This command does not alter the video content or quality; it simply adds or updates the metadata.

You can also use FFmpeg to view the metadata of a video file, with the following command:

bash
ffmpeg -i input.mp4

This command outputs detailed information about the video, including existing metadata.

2024年7月2日 12:11 回复

你的答案