Showfreqs和showwave在背景图片上? [英] Showfreqs and showwaves over background image?

查看:40
本文介绍了Showfreqs和showwave在背景图片上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让FFMPEG将播客音频导出到一个我可以上传到youtube的文件中,该文件在视觉上很有趣.

I'm wanting to get FFMPEG to export my podcast audio to a file I can upload to youtube that is visually interesting.

当前,我正在使用以下代码,但我并未完全掌握:

currently I am using the following piece of code, which I don't fully grasp:

ffmpeg -i E04_ProphetsPrey.wav -filter_complex \
"    [0:a]showfreqs=mode=line:ascale=log:fscale=rlog:s=1280x518,pad=1280:720[vs]; \
 [0:a]showfreqs=mode=line:ascale=log:fscale=rlog:s=1x1[ss]; \
 [0:a]showwaves=s=1280x202:mode=p2p[sw]; \
 [vs][ss]overlay=w[bg]; \
 [bg][sw]overlay=0:H-h,drawtext=fontfile=/usr/share/fonts/TTF/Vera.ttf:fontcolor=white:x=10:y=10:text='\"Rated80s Prophets Prey\" by Comics On Film'[out]" \
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy -threads 0 output.mkv

我想做的是设置一个(品牌化的)背景图像,并在上半部分显示showfreqs,在下半部分显示showwaves.

what I would like to do is set a (branded) background image, and have showfreqs render over it on the top half and showwaves render over it on the bottom half.

有可能吗,如果可以的话,您能提供一个详细的例子吗?

Is that possible, and if so could you provide me a detailed example?

(我在Arch Linux上)

(I'm on arch linux)

推荐答案

ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex \
"[0:a]showfreqs=mode=line:ascale=log:fscale=log:s=1280x518[sf]; \
 [0:a]showwaves=s=1280x202:mode=p2p[sw]; \
 [sf][sw]vstack[fg]; \
 [1:v]scale=1280:-1,crop=iw:720[bg]; \
 [bg][fg]overlay=shortest=1:format=auto,format=yuv420p,drawtext=fontfile=/usr/share/fonts/TTF/Vera.ttf:fontcolor=white:x=10:y=10:text='\"Rated80s Prophets Prey\" by Comics On Film'[out]" \
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a libopus output.mkv

  • vstack 垂直堆叠这两种效果.与使用叠加层相比,它更容易且通常更快.

    • vstack vertically stacks the two effects. It is easier and usually faster than using overlay to do so.

      示例背景图片过大,因此比例作物将图像制作为1280x720.

      The example background image was oversized, so scale and crop made the image 1280x720.

      然后使用叠加滤镜将vstacked效果分层放置在背景上方,格式滤镜使像素格式与非基于FFmpeg的播放器兼容(如果将其上传到YouTube,则可以将其删除),最后 drawtext 制作文本.

      The vstacked effects are then layered above the background using the overlay filter, format filter makes a more pixel format compatible with non-FFmpeg based players (you can remove it if just uploading to YouTube), and finally drawtext makes the text.

      如果得到 [overlay]无法解析选项值"auto" ,则您的版本太旧,应该升级.请参阅 FFmpeg下载页面以获取链接.

      If you get [overlay] Unable to parse option value "auto" your version is too old and you should upgrade. See the FFmpeg Download page for links.

      这篇关于Showfreqs和showwave在背景图片上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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