Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Converting audio/video tracks to AAC format in C# app

    13 février, par Alex1347

    I try convert audio/video tracks to AAC format using qaac lib. In CMD it works and output information about progress of convertation. In my C# app it works too, but I can't get information about progress, i try use these events: OutputDataReceived, ErrorDataReceived. In handler of ErrorDataReceived I don't get needed information, in handler of OutputDataReceived I get received.Data like null value. How can I get conversion progress information during conversion in C# code?

    (I use qaac lib because ffmpeg lib convert tracks to AAC incorrect - incorrect duration of result track, resolving not find for this problem, some analog apps have the same bug.)

    Creating process for converting:

    string arguments = $"\"{engineParameters.InputFile.Filename}\" -no-delay -o \"{engineParameters.OutputFile.Filename}\"";
    
    processStartInfo = new ProcessStartInfo
    {
        FileName = QaacFilePath,
        Arguments = arguments,
        RedirectStandardOutput = true,
        UseShellExecute = false,
        CreateNoWindow = true,
        WindowStyle = ProcessWindowStyle.Hidden
    };
    

    Also I call these methods for process:

    BeginOutputReadLine();
    BeginErrorReadLine();
    WaitForExit();
    

    Handlers:

    this.Process.OutputDataReceived += (sender, received) =>
    {
        if (received.Data == null) return;
        //Some code...
    }
    
    this.Process.ErrorDataReceived += (sender, received) =>
    {
        if (received.Data == null) return;
        //Some code...
    }
    
  • How to disable slf4j log in java

    12 février, par Model123123

    Sorry for my poor English.

    I'm using ffmpeg-cli-wrapper library in java

    [main] INFO net.bramp.ffmpeg.RunProcessFunction - .\ffprobe.exe -version

    [main] INFO net.bramp.ffmpeg.RunProcessFunction - .\ffprobe.exe -v quiet -print_format json -show_error -show_format -show_streams -show_chapters

    How to remove this log?

    try this:

    1. java.util.logging.Logger.getLogger("net.bramp.ffmpeg").setLevel(Level.OFF);

    2. /logger name="net.bramp.ffmpeg" level="OFF"/ in logback.xml

    but not work...

    RunProcessFunction src: https://github.com/bramp/ffmpeg-cli-wrapper/blob/master/src/main/java/net/bramp/ffmpeg/RunProcessFunction.java

  • Use FFmpeg in Visual Studio

    12 février, par box

    I'm trying to use FFmpeg in a C++ project in Visual Studio 2010. I want to include the libraries as statically linked files. Simple programs like libavcodec/api-example.c compile without error and no linker error appears in the error view when starting them. However, a message box shows up after starting the application, saying that avutil-51.dll is missing. Do you have any hints on how to fix that?

    I used the latest dev build from http://ffmpeg.zeranoe.com/builds/. Then I specified include as additional include directory, avcodec.lib;avfilter.lib;avformat.lib;avutil.lib as additional dependencies and lib as additional library directory.

  • FFmpegKitFlutter, Error : MissingPluginException(No implementation found for method ffmpegSession on channel flutter.arthenica.com/ffmpeg_kit)

    12 février, par 7Solomon

    I Have this simple Flutter function, to compress Audio Files

    import 'package:ffmpeg_kit_flutter/ffmpeg_kit.dart';
    import 'package:ffmpeg_kit_flutter/return_code.dart';
    
    
    Future compressAudio(String inputPath) async {
        try {
          //     ...
          final command = '-y -i "$inputPath" ' // Input file
              '-af "loudnorm=I=-16:TP=-1.5:LRA=11,' // Loudness normalization
              'acompressor=threshold=${_config['threshold_db']}:'
              'ratio=${_config['ratio']}:'
              'attack=${_config['attack']}:'
              'release=${_config['release']},'
              'highpass=f=20,lowpass=f=20000" ' // Audio filters
              '-ar 44100 ' // Sample rate
              '-b:a 128k ' // Bitrate
              '-codec:a libmp3lame ' // MP3 encoder
              '-q:a 2 ' // Quality setting for LAME (0-9, lower is better)
              '-map_metadata 0 ' // Copy metadata
              '"$outputPath"'; // Output file
    
          // Execute FFmpeg command
          final session = await FFmpegKit.execute(command);
          final returnCode = await session.getReturnCode();
          final logs = await session.getLogs();
          print('FFmpeg logs: $logs');
    
          if (ReturnCode.isSuccess(returnCode)) {
            return outputFileName;
          } else {
            final logs = await session.getLogs();
            throw Exception(
                'FFmpeg process failed with code $returnCode\nLogs: $logs');
          }
        } catch (e, stackTrace) {
          print('Error: $e');
          print('Stack trace: $stackTrace');
          throw Exception('Failed to compress audio: $e\nStack trace: $stackTrace');
        }
      }
    

    And I get this error Error: MissingPluginException(No implementation found for method ffmpegSession on channel flutter.arthenica.com/ffmpeg_kit)

    This is the Stacktrace

    flutter: Error: MissingPluginException(No implementation found for method ffmpegSession on channel flutter.arthenica.com/ffmpeg_kit)
    flutter: Stack trace: #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
    
    #1      AbstractSession.createFFmpegSession (package:ffmpeg_kit_flutter/abstract_session.dart:71:11)
    
    #2      FFmpegSession.create (package:ffmpeg_kit_flutter/ffmpeg_session.dart:40:21)
    
    #3      FFmpegKit.executeWithArguments (package:ffmpeg_kit_flutter/ffmpeg_kit.dart:44:9)
    
    #4      FileProcessor.compressAudio (package:predigt_upload_fl/file.dart:182:23)
    
    #5      _DetailPageState._handleSubmit (package:predigt_upload_fl/GUIs/LiveStreamDetailPage.dart:334:30)
    
    
    
    ══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
    flutter.arthenica.com/ffmpeg_kit_event)
    
    When the exception was thrown, this was the stack:
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
    
    #1      EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:676:9)        
    
    

    And i think this comes from abstract class FFmpegKitPlatform extends PlatformInterface inside ffmpeg_kit_flutter_platform_interface.dart, because in there are a lot of functions that are not Implemented.

    This happens not just because of one functions:

        // ...
        final logLevel = await _getLogLevel();
        print('logLevel: $logLevel');
        if (logLevel != null) {
          FFmpegKitConfig.setLogLevel(logLevel);
        }
        final version = FFmpegKitFactory.getVersion();
        final platform = await FFmpegKitConfig.getPlatform();
        final arch = await ArchDetect.getArch();
        final packageName = await Packages.getPackageName();
        await FFmpegKitConfig.enableRedirection();
        final isLTSPostfix = (await FFmpegKitConfig.isLTSBuild()) ? "-lts" : "";
        // ...
    
    

    All of these Functions and more in FFmpegKitInitializer are not Implemented. So im pretty sure im missing something else here than just some outdated Version.

    These are my Dependencies:

    dependencies:
      flutter:
        sdk: flutter
      path_provider: ^2.0.15
      just_audio: ^0.9.34
      file_picker: ^5.3.1
      path: ^1.8.3
      id3_codec: ^1.0.3
      ftpconnect: ^2.0.5
      http: ^1.1.0
      shared_preferences: ^2.2.0
      html: ^0.15.5
      youtube_explode_dart: ^2.3.9
      intl: ^0.19.0
      ffmpeg_kit_flutter: ^6.0.3
    

    Im pretty new to Flutter Development so Im not quiete sure how to go about this Problem because every other FFmpeg Wrapper also has some problems that i couldnt fix.

    If you need any other Information feel free to ask me, because I also dont know what someone would need to go fix the problem.

  • ffmpeg sequence starting at frame 1001

    11 février, par Kernowkid

    I have an image sequence starting at 1001 that I'd like to convert to a mp4 using ffmpeg. Here's what I'm putting in cmd shell:

    ffmpeg -i plates_sh01_%04d.jpeg start_number 1001 -s 1920x1080 -vcodec libx264 -crf 25 -b:v 4M -pix_fmt yuv420p plates_sh01_%04d.mp4
    

    This works for image sequences starting at frame numbers below 999. For any sequence starting at 1000 or above I get this error:

    Could find no file with path 'plates_sh01_%04d.jpeg' and index in the range 0-4 plates_sh01_%04d.jpeg_%04d.jpeg: No such file or directory

    I can't find any solutions to this apart from re-number the image sequence.

    Any help is greatly appreciated.