【问题标题】:Only one .ts file is generating while encoding mp3 file to m3u8 using ffmpeg使用 ffmpeg 将 mp3 文件编码为 m3u8 时仅生成一个 .ts 文件
【发布时间】:2017-07-28 07:47:13
【问题描述】:

我无法播放某些特定文件的 m3u8 链接。

详情如下:

ffmpeg -i low_30.mp3 -codec:v libx264 -b:v 64k -maxrate 64k -bufsize 64k -vf scale=-2:480 -threads 0 -vsync 2 -pix_fmt yuv420p -codec:a aac -b:a 64k -hls_list_size 0 abc.m3u8

错误:

[libx264 @ 0x7fc83280ba00] MB rate (81000000) > level limit (2073600)
[libx264 @ 0x7fc83280ba00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fc83280ba00] profile High 4:4:4 Predictive, level 5.2, 4:4:4 8-bit
[hls @ 0x7fc832809e00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

示例文件网址:https://s3-ap-southeast-1.amazonaws.com/hog-original/low_30.mp3

在这种情况下只生成一个 TS 文件,无法播放 m3u8 链接。

【问题讨论】:

  • 您希望将封面图像保留在片段中吗?
  • 不,我不想保留封面图片。

标签: ffmpeg video-encoding m3u8


【解决方案1】:

使用

ffmpeg -i low_30.mp3 -c:a aac -b:a 64k -vn -hls_list_size 0 abc.m3u8

默认分段持续时间为 2 秒。添加-hls_time N 以创建N秒的片段。

【讨论】:

  • 我偶然发现了这篇文章,并想指出-segment_time 似乎不适用于 HLS(至少在更新版本的 FFMPEG 中不能)。但是,-hls_time N 正在工作。
  • 确实,segment_time是给segment muxer用的
  • 转换时如何保留封面图?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-03
  • 1970-01-01
  • 1970-01-01
  • 2019-12-04
  • 1970-01-01
  • 2011-03-13
相关资源
最近更新 更多