Metadata in mp3 not working when piping from ffmpeg with album art

后端 未结 1 1833
深忆病人
深忆病人 2021-01-25 00:13

In my program I am piping a webm from a stream to ffmpeg and then pipe the output to a http request. Part of the process is adding metadata for the mp3. This has so far worked g

相关标签:
1条回答
  • 2021-01-25 00:42

    Yes, the ID3 header size cannot be filled in when the ID3v2 metadata has to be written in two steps (such as when an image packet has to be inserted) & the output is not seekable.

    You can still work around this to a degree by telling ffmpeg to not flush the data quickly. However, ffmpeg will flush if its buffer exceeds 256 kB. Make a small allowance for the other parts of the ID3 header, and that gives you a ceiling for the maximum size of the image.

    ffmpeg -i - -i image.jpeg -map 0 -map 1 -c:v copy -f mp3 -id3v2_version 4 -metadata title="Tiësto & KSHMR feat. Vassy - Secrets (Official Music Video)" -metadata album="YouTube" -metadata artist="Spinnin' Records" -metadata:s:v title="Album Cover" -metadata:s:v comment="Cover (front)" -flush_packets 0 - > output3.mp3 < video.webm

    0 讨论(0)
提交回复
热议问题