HFrost0 / bilix

⚡️Lightning-fast async download tool for bilibili and more
Apache License 2.0
1.6k stars 166 forks source link

[bug] m3u8 下载合并失败 #136

Closed imgradeone closed 1 year ago

imgradeone commented 1 year ago

现象:m3u8 下载执行 ffmpeg 时无法正常合并视频文件

ffmpeg 版本:N-94813-g85386c36e3-ffmpeg-for-N_m3u8DL-CLI(调用 nilaoda/N_m3u8DL-CLI

PS D:\Archive\others> ffmpeg
ffmpeg version N-94813-g85386c36e3-ffmpeg-for-N_m3u8DL-CLI Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.0 (GCC)
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 56.101 / 58. 56.101
  libavformat    58. 32.104 / 58. 32.104
  libavfilter     7. 58.102 /  7. 58.102
  libavresample   4.  0.  0 /  4.  0.  0
  libswresample   3.  6.100 /  3.  6.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

log:

1 包含 605 个分段

来源:https://weibo.com/l/wblive/p/show/1022:2321324901986356297800

PS D:\Archive\others> bilix m3u8 "https://live.video.weibocdn.com/c7bb59b2-7432-4db6-bbf6-b167fb11ccc9_index.m3u8"
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\bilix.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python310\lib\site-packages\bilix\cli\main.py", line 374, in main
    loop.run_until_complete(cor)
  File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Python310\lib\site-packages\bilix\download\base_downloader_m3u8.py", line 122, in get_m3u8_video
    await ffmpeg.concat(file_list, path)
  File "C:\Python310\lib\site-packages\bilix\ffmpeg.py", line 18, in concat
    await run_process(cmd)
  File "C:\Python310\lib\site-packages\anyio\_core\_subprocesses.py", line 90, in run_process
    raise CalledProcessError(cast(int, process.returncode), command, output, errors)
subprocess.CalledProcessError: Command '['ffmpeg', '-f', 'concat', '-safe', '0', '-i', 'D:\\Archive\\others\\videos\\tmpgex2lqr2', '-c', 'copy', '-loglevel', 'quiet', 'videos\\c7bb59b2-7432-4db6-bbf6-b167fb11ccc9_index.mp4']' returned non-zero exit status 1.

2 包含 599 个分段

来源:http://app.bjtitle.com/8816/videoshow.php?newsid=6346903

PS D:\Archive\others> bilix m3u8 "https://recordcdn.quklive.com/broadcast/activity/1684122279140271/record.m3u8"
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\bilix.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python310\lib\site-packages\bilix\cli\main.py", line 374, in main
    loop.run_until_complete(cor)
  File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Python310\lib\site-packages\bilix\download\base_downloader_m3u8.py", line 122, in get_m3u8_video
    await ffmpeg.concat(file_list, path)
  File "C:\Python310\lib\site-packages\bilix\ffmpeg.py", line 18, in concat
    await run_process(cmd)
  File "C:\Python310\lib\site-packages\anyio\_core\_subprocesses.py", line 90, in run_process
    raise CalledProcessError(cast(int, process.returncode), command, output, errors)
subprocess.CalledProcessError: Command '['ffmpeg', '-f', 'concat', '-safe', '0', '-i', 'D:\\Archive\\others\\videos\\tmp8u6bgfq7', '-c', 'copy', '-loglevel', 'quiet', 'videos\\record.mp4']' returned non-zero exit status 1.
HFrost0 commented 1 year ago

我的ffmpeg可以合成你提到的第一个视频

ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 14.0.0 (clang-1400.0.29.202)

版本供参考

imgradeone commented 1 year ago

我这边的 ffmpeg 情况有点复杂,一堆 ffmpeg.exe,我都不知道应该调用哪个了(qwq)

image

HFrost0 commented 1 year ago

这👀...,检查一下哪个被配置进环境变量了吧,一般来说大家用同一个ffmpeg就好了,只是很多工具都自己把ffmpeg打包了呢

imgradeone commented 1 year ago

刚刚第一个视频使用 ffmpeg 6.0 合并完成了

PS C:\Users\imgradeone> ffmpeg
ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
PS C:\Users\imgradeone> bilix m3u8 "https://live.video.weibocdn.com/c7bb59b2-7432-4db6-bbf6-b167fb11ccc9_index.m3u8"
INFO     已完成 c7bb59b2-7432-4db6-bbf6-b167fb11ccc9_index.mp4

PS C:\Users\imgradeone>