I'm trying to convert audio streams to AAC in C++. FFplay plays everything fine (now) but VLC still has problems with one particular situation: 5.1(side). FFplay only plays it if I filter 5.1(side) to 5.1. Filtering to stereo or mono works well and as expected.
My setup right now is:
send packet
receive audio AVFrame
apply filter
resample to produce output AVFrame with 1024 samples (required by AAC)
send new audio frame
receive audio packet
Weirdly enough, using FFmpeg's CLI converts my file properly.
ffmpeg -i test.mp4
But FFprobe tells me that the audio stream is now 6 channels instead of 5.1(side) or 5.1. I did try to set AAC to 6 channels in both the AVStream and the AVCodecContext. Setting it in the AVStream doesn't change anything in FFprobe and the AVCodecContext for AAC doesn't allow it.
I can't build my project on Android ( on Ios it works and the project itself without ffmpeg_kit_flutter_new builds without problems )
This is the error i obtain:
/GeneratedPluginRegistrant.java:51: error: cannot find symbol
com.antonkarpenko.ffmpegkit.MainActivity.registerWith(shimPluginRegistry.registrarFor("com.antonkarpenko.ffmpegkit.MainActivity"));
^
symbol: class MainActivity
location: package com.antonkarpenko.ffmpegkit
This is my flutter doctor :
[✓] Flutter (Channel stable, 3.19.4, on macOS 15.4.1 24E263 darwin-x64, locale it-IT)
• Flutter version 3.19.4 on channel stable at ….
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 68bfaea224 (1 year, 2 months ago), 2024-03-20 15:36:31 -0700
• Engine revision a5c24f538d
• Dart version 3.3.2
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at …..
• Platform android-35, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.99.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.110.0
[✓] Connected device (5 available)
• SM A135F (mobile) • RF8T40TMS6Z • android-arm • Android 12 (API 31)
• cri SE 128 (mobile) • 00008030-001268303E38402E • ios • iOS 18.4.1 22E252
• iPhone di WacMini (mobile) • 00008030-00121D543CE8802E • ios • iOS 18.4.1 22E252
• macOS (desktop) • macos • darwin-x64 • macOS 15.4.1 24E263 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 136.0.7103.93
[✓] Network resources
• All expected network resources are available.
My android/app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'org.jetbrains.kotlin.android'
android {
compileSdkVersion 35
namespace = "com.app.app"
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.appid.appid"
minSdkVersion 24
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// insert this line of code in order to manage correct build abi configuration only on supported devices not supported tablet device emulator
/* ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}*/
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
debug {
debuggable true
}
release {
signingConfig signingConfigs.release
debuggable false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.24"
}
If I open this (playlist.m3u8) file in VLC media player then it plays.
It also works in desktop chrome and desktop firefox browsers with Video-js plugin flash fallback.
I set the correct MIME types to the .ts and .m3u8 files in .htaccess file:
I see in the folder of some application FFMPEG files avcodec.dll, avformat.dll, avutil.dll, etc.
They are all old version of FFMPEG. I wanted to update them, but I did not find where to download them on the FFMPEG website.
Are these complete libraries available for download? Or do they exist only in development files and the authors of some application create FFMPEG .dll files themselves? In other words, avcodec.dll files from different applications are not interchangeable?
Help me figure it out.