From 2011517c3719a40a2583c05163eba0075b468cd2 Mon Sep 17 00:00:00 2001 From: Unknown <870709864@qq.com> Date: Sun, 27 Jan 2019 18:05:55 +0800 Subject: [PATCH] =?UTF-8?q?linux=E4=B8=8B=E9=87=8D=E6=96=B0=E7=BC=96?= =?UTF-8?q?=E8=AF=91ffmpeg=E6=9D=A5=E6=94=AF=E6=8C=81=E5=B0=81=E8=A3=85h26?= =?UTF-8?q?4=E5=88=B0mp4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtScrcpy/recorder/recorder.cpp | 6 ++++-- backup/myconfig.sh | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 backup/myconfig.sh diff --git a/QtScrcpy/recorder/recorder.cpp b/QtScrcpy/recorder/recorder.cpp index 702d0be..0feb356 100644 --- a/QtScrcpy/recorder/recorder.cpp +++ b/QtScrcpy/recorder/recorder.cpp @@ -72,7 +72,9 @@ bool Recorder::open(AVCodec *inputCodec) int ret = avio_open(&m_formatCtx->pb, m_fileName.toUtf8().toStdString().c_str(), AVIO_FLAG_WRITE); if (ret < 0) { - qCritical(QString("Failed to open output file: %1").arg(m_fileName).toUtf8().toStdString().c_str()); + char errorbuf[255] = { 0 }; + av_strerror(ret, errorbuf, 254); + qCritical(QString("Failed to open output file: %1 %2").arg(errorbuf).arg(m_fileName).toUtf8().toStdString().c_str()); // ostream will be cleaned up during context cleaning avformat_free_context(m_formatCtx); m_formatCtx = Q_NULLPTR; @@ -121,7 +123,7 @@ const AVOutputFormat *Recorder::findMp4Muxer() #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100) outFormat = av_muxer_iterate(&opaque); #else - outFormat = av_oformat_next(oformat); + outFormat = av_oformat_next(outFormat); #endif // until null or with name "mp4" } while (outFormat && strcmp(outFormat->name, "mp4")); diff --git a/backup/myconfig.sh b/backup/myconfig.sh new file mode 100755 index 0000000..3d72c95 --- /dev/null +++ b/backup/myconfig.sh @@ -0,0 +1,4 @@ +./configure --disable-everything --disable-x86asm --prefix=../ffmpeg_build \ + --enable-shared --enable-static \ + --enable-decoder=h264 --enable-parser=h264 --enable-demuxer=h264 \ + --enable-muxer=mp4 --enable-protocol=file