Recherche avancée

Médias (91)

Autres articles (1)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (353)

  • Amplification of recorded audio in flutter app using FFMPEG not working correctly

    20 mai, par Noman khanbhai

    In my app I need to record audio and send it to server, server then sends the file to a hardware using mqtt and then file gets played on the hardware. I am using flutter to build app and using record 5.0.5 package for audio recording and for amplification ffmpeg_kit_flutter 6.0.3 package to do the amplification.

    


    The issue is it doesnt seems like there is much change in amplitude, I used different values for amplification factor but audio remains same.

    


    Here is the code for amplification

    


    Future<string>? amplifyAudio(&#xA;      String inputPath, String outputPath) async {&#xA;&#xA;    // Build FFmpeg command to amplify audio&#xA;    outputPath = await modifyOutputPath(inputPath)!;&#xA;    String audioFilter = &#x27;volume=${amplificationFactor}dB&#x27;; &#xA;    //-c:a aac&#xA;    String command = &#x27;-i $inputPath -af $audioFilter $outputPath&#x27;;&#xA;&#xA;    // Execute FFmpeg command&#xA;    await FFmpegKit.executeAsync(command).then((session) async {&#xA;      debugPrint("After executeAsync session ${session.toString()}");&#xA;      debugPrint(&#xA;          "After executeAsync returncode ${await session.getReturnCode()}");&#xA;      debugPrint("After executeAsync command ${session.getCommand()}");&#xA;      log("After executeAsync alllogs ${await session.getAllLogs()}");&#xA;      log("After executeAsync alllogstring ${await session.getAllLogsAsString()}");&#xA;      log("After executeAsync failStackTrace ${await session.getFailStackTrace()}");&#xA;    }).onError((error, stackTrace) {&#xA;      debugPrint("After executeAsync error ${error.toString()}");&#xA;    });&#xA;&#xA;    return outputPath;&#xA;  }&#xA;&#xA;</string>

    &#xA;

    This are the logs when above method gets executed.

    &#xA;

    FFMpeg command -> `-i /data/user/0/com.orgname.flutter.appname/app_flutter/1716209206469.aac -af volume=10.0dB /storage/emulated/0/Download/1716209213238_amplified.aac`&#xA;&#xA;> Logs&#xA;> After executeAsync alllogstring ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers&#xA;> built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)&#xA;> configuration: --cross-prefix=aarch64-linux-android- --sysroot=/Users/sue/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/sysroot --prefix=/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang&#x2B;&#x2B; --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs=&#x27;-L/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat&#x27; --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-iconv --disable-sdl2 --disable-openssl --enable-zlib --enable-mediacodec&#xA;> libavutil      58.  2.100 / 58.  2.100&#xA;> libavcodec     60.  3.100 / 60.  3.100&#xA;> libavformat    60.  3.100 / 60.  3.100&#xA;> libavdevice    60.  1.100 / 60.  1.100&#xA;> libavfilter     9.  3.100 /  9.  3.100&#xA;> libswscale      7.  1.100 /  7.  1.100&#xA;> libswresample   4. 10.100 /  4. 10.100&#xA;> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/data/user/0/com.orgname.flutter.appname/app_flutter/1716209206469.aac&#x27;:&#xA;> Metadata:&#xA;> major_brand     : mp42&#xA;> minor_version   : 0&#xA;> compatible_brands: isommp42&#xA;> creation_time   : 2024-05-20T12:46:52.000000Z&#xA;> com.android.version: 12&#xA;> Duration: 00:00:04.76, start: 0.000000, bitrate: 131 kb/s&#xA;> Stream #0:0[0x1](eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)&#xA;> Metadata:&#xA;> creation_time   : 2024-05-20T12:46:52.000000Z&#xA;> handler_name    : SoundHandle&#xA;> vendor_id       : [0][0][0][0]&#xA;> Stream mapping:&#xA;> Stream #0:0 -> #0:0 (aac (native) -> aac (native))&#xA;> Press [q] to stop, [?] for help&#xA;

    &#xA;

    Note - I am also playing the audio after recording and before amplification in app, and also saving in download. to make sure audio file is correct.

    &#xA;

    Amplified file also gets saved but there is almost no difference.

    &#xA;

    I have also searched/googled/ and also done chatgpt to resolve issue. but nothing worked.

    &#xA;

  • How do I configure codec parameters for a RTSP stream ?

    16 mai, par Kermit

    I am trying to stream a network camera source into /dev/video0. However, all attempts keep telling me I have set incorrect codec parameters. Any suggestions ?

    &#xA;

    # works&#xA;ffplay rtsp://admin:password@172.16.0.184:554/live&#xA;

    &#xA;

    Then trying any of these to feed into /dev/video0 (valid from list of ls /dev/video*) :

    &#xA;

    ffmpeg -rtsp_transport tcp -i "rtsp://admin:password@172.16.0.184:554/live" -c:v rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0&#xA;

    &#xA;

    Results in

    &#xA;

    ffmpeg version 5.1.4-0&#x2B;rpt3&#x2B;deb12u1 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with gcc 12 (Debian 12.2.0-14)&#xA;  configuration: --prefix=/usr --extra-version=0&#x2B;rpt3&#x2B;deb12u1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared&#xA;  libavutil      57. 28.100 / 57. 28.100&#xA;  libavcodec     59. 37.100 / 59. 37.100&#xA;  libavformat    59. 27.100 / 59. 27.100&#xA;  libavdevice    59.  7.100 / 59.  7.100&#xA;  libavfilter     8. 44.100 /  8. 44.100&#xA;  libswscale      6.  7.100 /  6.  7.100&#xA;  libswresample   4.  7.100 /  4.  7.100&#xA;  libpostproc    56.  6.100 / 56.  6.100&#xA;Input #0, rtsp, from &#x27;rtsp://admin:password@172.16.0.184:554/live&#x27;:&#xA;  Metadata:&#xA;    title           : Media Server&#xA;  Duration: N/A, start: 0.000000, bitrate: N/A&#xA;  Stream #0:0: Video: hevc (Main), yuv420p(tv), 3840x2160, 30 fps, 100 tbr, 90k tbn&#xA;  Stream #0:1: Audio: aac (LC), 32000 Hz, mono, fltp&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (hevc (native) -> rawvideo (native))&#xA;Press [q] to stop, [?] for help&#xA;[video4linux2,v4l2 @ 0x55562d9faa70] ioctl(VIDIOC_G_FMT): Invalid argument&#xA;Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument&#xA;Error initializing output stream 0:0 -- &#xA;Conversion failed!&#xA;

    &#xA;

  • File conversion to mp3 returning failure everytime using flutter package ffmpeg_kit_flutter

    10 mai, par Sanath balthar

    I am trying to convert a .wav audio file generated from a flutter's text to speech package - "flutter_tts" to mp3 file but it is failing everytime.&#xA;I have written the below code for file conversion. I have imported the package ffmpeg_kit_flutter. It doesnt even show why the conversion is failing.&#xA;I have looked up in stackoverflow and other sites but could not find any relevant solutions. I am using vscode as editor. I have attached flutter doctor output below as well. Could anyone please guide me ? Let me know if you need more information.

    &#xA;

    List<string> command = [&#xA;              &#x27;-i&#x27;, &#x27;$filePath/998tts.wav&#x27;,&#xA;              &#x27;-c:a&#x27;, &#x27;mp3&#x27;,&#xA;              &#x27;$filePath/998.mp3&#x27;&#xA;            ];&#xA;&#xA; await FFmpegKitConfig.enableLogs();&#xA;            FFmpegKitConfig.enableLogCallback((log) =>print(&#x27;FFmpeg log: $log&#x27;));        &#xA;          FFmpegSession result = await FFmpegKit.executeWithArguments(command);&#xA;          dynamic resultcode = await result.getReturnCode();&#xA;          dynamic resultlogs = await result.getLogsAsString();&#xA;          // FFmpegKitConfig.setLogLevel(logLevel)&#xA;          if(ReturnCode.isSuccess(resultcode)){&#xA;          print("file saved after conversion at $filePath/998.mp3 and result : Success and logs : $resultlogs");&#xA;          }&#xA;          else{&#xA;            print("Result : failure and logs : $resultlogs");&#xA;          }&#xA;&#xA;Flutter doctor output:&#xA;[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.22631.3296], locale en-IN)&#xA;[√] Windows Version (Installed version of Windows is version 10 or higher)&#xA;[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)&#xA;[√] Chrome - develop for the web&#xA;[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.5)&#xA;X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C&#x2B;&#x2B;"&#xA;workload, and include these components:&#xA;MSVC v142 - VS 2019 C&#x2B;&#x2B; x64/x86 build tools&#xA;- If there are multiple build tool versions available, install the latest&#xA;C&#x2B;&#x2B; CMake tools for Windows&#xA;Windows 10 SDK&#xA;[√] Android Studio (version 2023.2)&#xA;[√] VS Code (version 1.89.0)&#xA;[√] Connected device (3 available)&#xA;[√] Network resources&#xA;&#xA;! Doctor found issues in 1 category.&#xA;&#xA;</string>

    &#xA;

    Edit : Attaching error logs :

    &#xA;

    I/flutter (25865): Loading ffmpeg-kit-flutter.&#xA;D/ffmpeg-kit-flutter(25865): FFmpegKitFlutterPlugin com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin@a5d9788 started listening to events on io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler$EventSinkImplementation@4cfb5f2.&#xA;I/flutter (25865): Loaded ffmpeg-kit-flutter-android-audio-arm64-v8a-6.0.3.&#xA;I/flutter (25865): Result : failure and logs : ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers&#xA;I/flutter (25865):   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)&#xA;&#xA;I/flutter (25865):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/Users/sue/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/sysroot --prefix=/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang&#x2B;&#x2B; --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs=&#x27;-L/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat&#x27; --disable-autodetect --enable-cross-compile &#xA;

    &#xA;