如何使用ffmpeg管道? [英] How do I use piping with ffmpeg?

查看:322
本文介绍了如何使用ffmpeg管道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是使用wget下载flv文件,并将输出管道转换为ffmpeg,将其转换为MP3。这样用户可以下载MP3,而无需等待FLV首先下载到我的服务器。我一直在玩它,似乎ffmpeg只能在原始视频上进行管道。所以我正在这样工作:

My goal is to use wget to download an flv file, and pipe the output to ffmpeg to convert it to an MP3. This way the user can download the MP3 without waiting for the FLV to download to my server first. I've been playing around with it, and it seems that ffmpeg can only do piping on raw video. So I was working with something like this:

wget -O - 'videoinput.flv' | ffmpeg -y -i - -vcodec rawvideo -f yuv4mpegpipe - |  ffmpeg -y -i - -ab 128k audiooutput.mp3

任何人都有这种类型的飞行ffmpeg编码过程?

Anybody have experience with this type of on-the-fly ffmpeg encoding process?

推荐答案

我没有测试过,但应该是这样或非常接近。

I haven't tested this but should be like this or very close.

wget [URL] | ffmpeg -i pipe:0 -vcodec mpeg4 -s qcif -f m4v -y output.flv

这篇关于如何使用ffmpeg管道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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