diff --git a/CMakeLists.txt b/CMakeLists.txt index 5918f8b..ef7c5b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,9 @@ if (WIN32) ${CMAKE_SOURCE_DIR}/lib/swscale.lib ${CMAKE_SOURCE_DIR}/lib/libx264.lib ${CMAKE_SOURCE_DIR}/lib/x265-static.lib + ${CMAKE_SOURCE_DIR}/lib/aom.lib + ${CMAKE_SOURCE_DIR}/lib/vpx.lib + ${CMAKE_SOURCE_DIR}/lib/openh264.lib ${CMAKE_SOURCE_DIR}/lib/ws2_32.lib ${CMAKE_SOURCE_DIR}/lib/mfplat.lib ${CMAKE_SOURCE_DIR}/lib/mf.lib @@ -59,14 +62,24 @@ elseif (ANDROID) ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libavutil.a ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libswresample.a ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libswscale.a + ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libaom.a + ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libvpx.a + ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libx264.a + ${CMAKE_SOURCE_DIR}/lib/arm64-v8a/libx265.a ) # android elseif(ANDROID_ABI STREQUAL "armeabi-v7a") + add_definitions(-D__USE_FILE_OFFSET64) + add_definitions(-DANDROID_PLATFORM=24) set(STATIC_LIBS ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libavcodec.a ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libavformat.a ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libavutil.a ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libswresample.a ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libswscale.a + ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libaom.a + ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libvpx.a + ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libx264.a + ${CMAKE_SOURCE_DIR}/lib/armeabi-v7a/libx265.a ) # android endif() else () diff --git a/README.md b/README.md index 9aed2d8..09f4b07 100644 --- a/README.md +++ b/README.md @@ -59,15 +59,20 @@ void audioRaw() { ### Windows To get the needed libraries on Windows, you can use vcpkg: ```sh -vcpkg install ffmpeg[core,avcodec,avformat,avutil,swscale,swresample,amf,x264,x265,nvcodec]:x64-windows-static --recurse +vcpkg install ffmpeg[core,avcodec,avformat,avutil,swscale,swresample,amf,x264,x265,nvcodec,openh264,aom,vpx]:x64-windows-static --recurse ``` the other libraries are part of the Windows SDK ## Android -To get the needed libraries on Android, you can use [this](https://github.com/EclipseMenu/ffmpeg-android-maker/) script. Read the README in the repository for further instructions. +To get the needed libraries on Android, you can use [this](https://github.com/EclipseMenu/ffmpeg-android-maker/) script, make sure you have pkg-config installed before running it. Read the README in the repository for further instructions. ```sh git clone https://github.com/EclipseMenu/ffmpeg-android-maker/ cd ffmpeg-android-maker -./ffmpeg-android-maker.sh +./ffmpeg-android-maker.sh --enable-libaom --enable-libvpx --enable-libx264 --enable-libx265 --android-api-level=24 ``` You can either run it natively on Linux or using WSL on Windows. + +When building for android32 you need to set android version 24, you can do so by adding this arg to your geode build command +```sh +geode build --platform android32 --config Release -- -DANDROID_PLATFORM=24 +``` \ No newline at end of file diff --git a/mod.json b/mod.json index 579b3fc..bf3f64a 100644 --- a/mod.json +++ b/mod.json @@ -13,7 +13,7 @@ }, "id": "eclipse.ffmpeg-api", "name": "FFmpeg API", - "version": "v1.0.2", + "version": "v1.0.3", "developers": ["Eclipse Team", "maxnu"], "description": "Interaction with FFmpeg made easy", "tags": ["utility", "offline"], diff --git a/src/recorder.cpp b/src/recorder.cpp index 99d3b2c..fed1cfa 100644 --- a/src/recorder.cpp +++ b/src/recorder.cpp @@ -19,7 +19,9 @@ std::vector Recorder::getAvailableCodecs() { const AVCodec * codec; while ((codec = av_codec_iterate(&iter))) { - if(codec->type == AVMEDIA_TYPE_VIDEO && avcodec_find_encoder_by_name(codec->name) != nullptr) + if(codec->type == AVMEDIA_TYPE_VIDEO && + (codec->id == AV_CODEC_ID_H264 || codec->id == AV_CODEC_ID_HEVC || codec->id == AV_CODEC_ID_VP8 || codec->id == AV_CODEC_ID_VP9 || codec->id == AV_CODEC_ID_AV1 || codec->id == AV_CODEC_ID_MPEG4) && + avcodec_find_encoder_by_name(codec->name) != nullptr && codec->pix_fmts && std::find(vec.begin(), vec.end(), std::string(codec->name)) == vec.end()) vec.push_back(codec->name); }