ffmpeg 编码视频和音频以使用 flowplayer 进行流式传输

发布于 2024-11-19 08:40:17 字数 207 浏览 9 评论 0原文

我正在使用启用了 h264 库的 FFmpeg 0.6 版,并且很难对视频和音频进行编码以与 flowplayer 一起使用。

我已经用已经正确编码的视频测试了 flowplayer,它确实可以流式传输它们。

所以我的问题是如何使用 ffmpeg 对视频进行编码,以使用 flowplayer 进行 h264 伪流传输。我确实设置了流媒体服务器并正确流式传输测试视频。

I'm using FFmpeg version 0.6 enabled with h264 libraries and having a hard time encoding video and audio to work with flowplayer.

I have tested flowplayer with videos that have already been encoded properly and it does indeed stream them.

so my question is how would I encode videos using ffmpeg for h264 pseudo streaming with flowplayer. I do have my streaming server set up and properly streaming the test videos.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百变从容 2024-11-26 08:40:17

这是一个 shell 脚本

#!/bin/bash
  infile="billboardReplaceFvS_jun29.mov"
  tmpfile="billboardReplaceFvS_jun29.mov_tmp.mp4"
  tmpfile2="billboardReplaceFvS_jun29.mov_tmp2.mp4"
  outfile="video.mp4"
  options="-vcodec libx264 -b 1200k -flags +loop+mv4 -cmp 256 \
       -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 \
       -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 \
       -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 \
           -g 150 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10\
       -qmax 51 -qdiff 4"

  ffmpeg -y -i "$infile" -an -pass 1 -threads 2 $options "$tmpfile"

  ffmpeg -y -i "$tmpfile" -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 $options "$tmpfile2"

  qt-faststart "$tmpfile2" "$outfile"

this worked as a shell script

#!/bin/bash
  infile="billboardReplaceFvS_jun29.mov"
  tmpfile="billboardReplaceFvS_jun29.mov_tmp.mp4"
  tmpfile2="billboardReplaceFvS_jun29.mov_tmp2.mp4"
  outfile="video.mp4"
  options="-vcodec libx264 -b 1200k -flags +loop+mv4 -cmp 256 \
       -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 \
       -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 \
       -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 \
           -g 150 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10\
       -qmax 51 -qdiff 4"

  ffmpeg -y -i "$infile" -an -pass 1 -threads 2 $options "$tmpfile"

  ffmpeg -y -i "$tmpfile" -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 $options "$tmpfile2"

  qt-faststart "$tmpfile2" "$outfile"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文