DeepFaceLab是一款支持视频或图片的换脸开源软件,其使用非常简单,有官方的juptyer notebook案例,这里不做过多的教程介绍。
在使用过程中遇到的一点问题,在这里记录一下。DeepFaceLab的详细步骤分为五步:
上述过程按照流程走都挺顺利的,到了转换输出这一步骤的第二步出现问题:
Unknown encoder 'libx264'
问题出在ffmpeg包上,没有编码器,查找相关的资料:
https://stackoverflow.com/questions/9764740/unknown-encoder-libx264
按照以下流程走了一遍,还是不通:
最终放弃,从头开始捋一遍。在main.py
函数中调用了ffmpeg,是python版本的,之前按照requrest.txt
安装了,不能正常使用,原因在于调用的时候出现的配置如下:
--disable-libx264
disable-libx264导致无法找到编码器,卸载后重新安装,使用conda在虚拟环境中安装一遍:
conda install ffmpeg -c conda-forge
重新运行,成功运行将图片转成视频:
-dir ../workspace/yc_dst/Enter FPS ( ?:help skip:fullfps ) : fullfps 0 Output image format? ( jpg png ?:help skip:png ) : jpg ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0) configuration: --prefix=/home/duanzhicheng/anaconda3/envs/deepface --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1566210161358/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-libx264 --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/duanzhicheng/DeepFaceLab/workspace/39435.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.58.101 Duration: 00:00:10.03, start: 0.000000, bitrate: 580 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x640, 541 kb/s, 24 fps, 24 tbr, 12288 tbn, 96 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 48 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native)) Press [q] to stop, [?] for help
可以看到配置文件变成
--enable-libx264
整个过程正常运行,踩坑完毕。
本文分享自微信公众号 - AI科技时讯(aiblog_research),作者:unclell
原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。
原始发表时间:2019-09-18
本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。
我来说两句