Closed ansemz closed 4 months ago
可能是路径问题,我代码里写的是相对路径
https://github.com/hanxi/xiaomusic/blob/main/xiaomusic/xiaomusic.py#L312
你改成绝对路径试试,或者用cwd打印看看当前路径是什么?
看看你是在哪个目录执行启动命令的?
你看我的tree结果,ffmpeg就是在相对路径的位置。我也先改成绝对路径试试
改成绝对路径/usr/local/bin就可以了。
看看你是在哪个目录执行启动命令的?
项目根目录
$ ls
Dockerfile newversion.sh
LICENSE pdm.lock
README.md pyproject.toml
ffmpeg/ requirements.txt
ffmpeg-master-latest-linux64-gpl.tar.xz update-requirements.sh
install_dependencies.sh xiaomusic/
music/ xiaomusic.py
$ pdm run xiaomusic.py
INFO: Inside an active virtualenv /path/to/venvs/xiaomi-py311, reusing it.
Set env var PDM_IGNORE_ACTIVE_VENV to ignore it.
[02/06/24 11:46:55] INFO Serving on 0.0.0.0:8090 httpserver.py:74
INFO Running xiaomusic now, xiaomusic.py:394
用`播放歌曲/放歌曲/下一首/单曲循环/全部循环/随机播放/关机/停止
播放/分钟后关机/set_volume#`开头来控制
* Serving Flask app 'xiaomusic.httpserver'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:8090
* Running on http://192.168.18.142:8090
Press CTRL+C to quit
又试了一下,直接把ffmpeg的那两行注释也行,就直接调用系统路径下面的ffmpeg了。
@ansemz 已经支持配置 ffmpeg 路径,有空可以测测。
@hanxi 命令行参数指定路径以后,可以正常转换了,一切正常。感谢。
@ansemz 已经支持配置 ffmpeg 路径,有空可以测测。
用的是python virtualenv的虚拟环境。也安装了ffmpeg。