You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

HLS分段伪装为PNG转MP3失败,求格式识别及转换方案

问题:识别被伪装为PNG的HLS分段真实格式

我有一个HLS播放列表,其中包含多个分段链接(示例片段如下):

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:6,
[分段链接1]
#EXTINF:6,
[分段链接2]
...
#EXTINF:2.24,
[最后一个分段链接]
#EXT-X-ENDLIST

我可以下载任意分段文件,通过Android的ExoPlayer正常播放,但无法使用FFmpeg将其转换为MP3或MP4格式。例如执行以下命令:

ffmpeg -i /Users/user1/Downloads/response0.png /Users/user1/Downloads/response0.mp3

返回错误结果:

libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
Input #0, png_pipe, from '/Users/user1/Downloads/response0.png':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: png, ya8(pc, gbr/unknown/unknown), 1x1, 25 fps, 25 tbr, 25 tbn
Output #0, mp3, to '/Users/user1/Downloads/response0.mp3':
[out#0/mp3 @ 0x7fe879206b00] Output file does not contain any stream
Error opening output file /Users/user1/Downloads/response0.mp3.
Error opening output files: Invalid argument

(注:response0.png为下载的第一个分段文件)

FFmpeg将该文件识别为PNG格式且无音频轨道,但实际文件包含音视频内容并可正常播放。推测这些分段采用了伪装的非标准格式,请问如何识别其真实格式?

补充信息

  • 执行file命令的结果:
    file /Users/user1/Downloads/response0.png
    
    返回:
    /Users/user1/Downloads/response0.png: PNG image data, 1 x 1, 8-bit gray+alpha, non-interlaced
    
  • 执行xxd命令查看文件头的结果:
    xxd /Users/user1/Downloads/response0.png | head -4
    
    返回:
    00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452  .PNG........IHDR
    00000010: 0000 0001 0000 0001 0804 0000 00b5 1c0c  ................
    00000020: 0200 0000 0b49 4441 5478 da63 64f8 0f00  .....IDATx.cd...
    00000030: 0105 0101 2718 e366 0000 0000 4945 4e44  ....'..f....IEND
    

内容的提问来源于stack exchange,提问作者Maxim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 05:24:54