我有一个带有Wowza Media Server的H.264 / AAC流的mp4文件。 切割后,使用以下命令将文件强制为mp4格式:
ffmpeg -i wowza_output_file -vcodec copy -acodec copy -f mp4 -y wowza_output_file_copy
从那里我将它重命名为test_f4v.mp4并使用ffprobe来查看该文件:
ffprobe version 0.8, Copyright (c) 2007-2011 the FFmpeg developers
built on Jul 20 2011 13:32:19 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264
libavutil 51. 9. 1 / 51. 9. 1
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 4. 0 / 53. 4. 0
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 23. 0 / 2. 23. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_f4v.mp4':
Metadata:
major_brand : f4v
minor_version : 0
compatible_brands: isommp42m4v
creation_time : 2012-04-23 12:36:06
Duration: 01:00:01.84, start: 0.000000, bitrate: 2004 kb/s
Stream #0.0(eng): Video: h264 (Baseline), yuv420p, 854x480 [PAR 1:1 DAR 427:240], 1903 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
creation_time : 2012-04-23 12:36:06
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 96 kb/s
Metadata:
creation_time : 2012-04-23 12:36:06
现在有一个问题。我需要一个文件,其中包含以下元数据:
major_brand : mp42
compatible_brands: isom
有没有办法通过ffmpeg重新启动mp4文件以使major_brand
和compatible_brands
获得所描述的值?
答案 0 :(得分:0)
您可以使用FFmpeg的-metadata
标志设置任意元数据。
来自the man page:
-metadata[:metadata_specifier] key=value (output,per-metadata)
Set a metadata key/value pair.
An optional metadata_specifier may be given to set metadata on
streams or chapters. See "-map_metadata" documentation for details.
This option overrides metadata set with "-map_metadata". It is also
possible to delete metadata by using an empty value.
For example, for setting the title in the output file:
ffmpeg -i in.avi -metadata title="my title" out.flv
To set the language of the first audio stream:
ffmpeg -i INPUT -metadata:s:a:1 language=eng OUTPUT
答案 1 :(得分:0)
我对Wowza格式化知之甚少,但由于您只是复制实际的流数据而只是更改包装,因此您可以尝试HandBrakeCLI转换为mp4。默认情况下,它会将major_brand
设置为mp42
,将compatible_brands
设置为mp42isomavc1
。也许足够接近?