如何在FFMPEG流中播放音频文件数据?
亲爱的FFMPEG实用程序的尊敬的专家!告诉我谁知道这一点: 我想通过循环视频和音轨在YouTube音乐上进行24/7流。 我这样做是这样的:
ffmpeg -loglevel info -stream_loop -1 -y -re \
-i video.mp4 \
-f concat -safe 0 -i playlist.txt \
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k \
-framerate 25 -video_size 1280x720 -vf "format=yuv420p" -g 50 -shortest -strict experimental \
-c:a aac -b:a 128k -ar 44100 \
-f flv rtmp://localhost/live/my-stream
IE Video.mp4在循环中旋转,从playlist.txt文件中我播放mp3。 这样,一切都可以,一切都可以。但是我也想显示比赛曲目的标题。 例如,在一些YouTube收音机上:
封面非常完美!
有什么想法如何实施?
我知道可以通过绘制文字显示文本。您可以从文件中输出文本,您可以单独更新自己。但是如何获取当前播放文件的数据? FFMPEG不提供此类信息,仅提供流参数:fps,framerate ...还是可以得到它?
还是有更好,更轻松的方法?
事先感谢您的帮助!
Dears experts of the wonderful ffmpeg utility! Tell me please who knows this:
I want to make a 24/7 stream on YouTube of music from looped video and audio tracks.
I do it like this:
ffmpeg -loglevel info -stream_loop -1 -y -re \
-i video.mp4 \
-f concat -safe 0 -i playlist.txt \
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k \
-framerate 25 -video_size 1280x720 -vf "format=yuv420p" -g 50 -shortest -strict experimental \
-c:a aac -b:a 128k -ar 44100 \
-f flv rtmp://localhost/live/my-stream
i.e. video.mp4 is spinning in a loop and from the playlist.txt file I play mp3 in turn.
With this everything is ok, everything works. But I also want to show the title of the playing track.
As for example on some YouTube radios:
With cover is perfect!
Any ideas how this can be implemented?
I know that it is possible to display text through drawtext. You can output text from a file, which you can separately update yourself. But how to get the data of the currently playing file? ffmpeg does not give such information, only stream parameters: fps, framerate... Or is it still possible to get it?
Or are there better and easier ways?
Thanks in advance for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ffprobe 从文件中提取元数据。
you can use FFprobe to extract metadata from files.