记录使用ffmpeg下载m3u8转成mp4时遇到的问题

先上报错

[hls,applehttp @ 0x55efcdf226c0] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, hls,applehttp, from 'https://pv.xbottle.top/demo/rick.m3u8':
  Duration: 00:03:32.44, bitrate: 0 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: png, none(pc), 25 tbr, 25 tbn, 25 tbc
    Metadata:
      variant_bitrate : 0
Output #0, mp4, to 'rick.mp4':
Output file #0 does not contain any stream

这是m3u8伪装成图片之后拉取失败的提示

解决办法

需要自己去下载ffmpeg的源码,将png格式的验证去掉

git clone --depth=1 https://github.com/FFmpeg/FFmpeg.git
./configure --disable-doc --disable-asm --disable-x86asm --enable-protocols --enable-protocol=https --disable-demuxer=image2,image2_alias_pix,image2_brender_pix,image2pipe,image_bmp_pipe,image_cri_pipe,image_dds_pipe,image_dpx_pipe,image_exr_pipe,image_gem_pipe,image_gif_pipe,image_hdr_pipe,image_j2k_pipe,image_jpeg_pipe,image_jpegls_pipe,image_jpegxl_pipe,image_pam_pipe,image_pbm_pipe,image_pcx_pipe,image_pfm_pipe,image_pgm_pipe,image_pgmyuv_pipe,image_pgx_pipe,image_phm_pipe,image_photocd_pipe,image_pictor_pipe,image_png_pipe,image_ppm_pipe,image_psd_pipe,image_qdraw_pipe,image_qoi_pipe,image_sgi_pipe,image_sunrast_pipe,image_svg_pipe,image_tiff_pipe,image_vbn_pipe,image_webp_pipe,image_xbm_pipe,image_xpm_pipe,image_xwd_pipe
make -j4
make install

这样就可以下载了

你可能感兴趣的:(记录使用ffmpeg下载m3u8转成mp4时遇到的问题)