Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg + docker : make install not installing libx265 when building the image, but works inside container

    14 mars, par Alexander Santos

    I have this Dockerfile

    FROM ubuntu:22.04
    
    WORKDIR /usr/local/src
    
    ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    
    RUN apt update && apt install -y \
        build-essential cmake git pkg-config \
        libxml2-dev yasm nasm libtool autoconf automake \
        libx264-dev libx265-dev libnuma-dev libvpx-dev \
        libfdk-aac-dev libmp3lame-dev libopus-dev \
        libass-dev libfreetype6-dev libvorbis-dev
    
    RUN apt-get install libx265-dev
    
    RUN git clone --depth 1 https://github.com/fraunhoferhhi/vvenc.git && \
        cd vvenc && \
        mkdir build && cd build && \
        cmake .. -DCMAKE_BUILD_TYPE=Release && \
        make -j$(nproc)
      
    RUN cd vvenc && \
        make install install-prefix=/usr/local
      
    
    RUN git clone --depth 1 https://github.com/FFmpeg/FFmpeg.git ffmpeg 
    
    RUN cd ffmpeg && \
        ./configure --enable-libx265 --enable-gpl --enable-nonfree --enable-pthreads --enable-pic --enable-shared \
                    --enable-rpath --enable-demuxer=dash \
                    --enable-libxml2 --enable-libvvenc --extra-libs=-lpthread && \
        make -j$(nproc)
    
    RUN cd ffmpeg && make install
    
    RUN rm -rf /var/lib/apt/lists/*
    
    # Some other irrelevant commands
    

    It works for VVenC. As for works, i mean that i can enter the container with /bin/bash, execute ffmpeg -codecs | grep vvc and this is the response:

     DEV.L. vvc                  H.266 / VVC (Versatile Video Coding) (encoders: libvvenc)
    

    But for libx265 it's not working.

    ffmpeg -codecs | grep x265 
    
    In another try:
    
    ffmpeg -codecs | grep 265
     DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_v4l2m2m) (encoders: hevc_v4l2m2m)
    

    After i enter the ffmpeg directory again and execute make install it works.

    root@0a2ad1086abd:/usr/local/src# cd ffmpeg
    root@0a2ad1086abd:/usr/local/src/ffmpeg# make install
    ... installation logs ...
    root@0a2ad1086abd:/usr/local/src/ffmpeg# ffmpeg -codecs | grep x265
     DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_v4l2m2m) (encoders: libx265 hevc_v4l2m2m)
    

    Is there anything i can do here? I tried separating layers, unifying... I really don't know what else should i do.

  • How can I crop and encode a video using flutter natively, now that flutter_ffmpeg is discontinued with no alternatives ? [closed]

    13 mars, par Rageh Azzazy

    As of January 6, 2025, FFmpegKit is officially retired (Taner's article).

    This also affects the flutter_ffmpeg and ffmpeg_kit_flutter packages.

    Most packages for executing video editing commands were built depending on them and so won't work after April 1, 2025 as mentioned in the package documentation and Taner's article. Some packages that depend on flutter_ffmpeg or ffmpeg_kit_flutter are:

    • video_trimmer
    • zero_video_trimmer
    • flutter_video_trimmer
    • video_trim
    • bemeli_compress
    • video_trimmer_pro
    • ... others

    Editing video using video_editor or video_editor_2 or video_editor_pits has become a problem.

    I believe downloading the binaries and doing the whole thing locally is not just tedious but illegal as well.

    I broke down exactly what I need to edit videos in my flutter app and I found those package but have not yet tested them.

    • Trimming: flutter_native_video_trimmer

    • Compression: video_compress or video_compress_plus

    • Muting: video_compress handles this

    • Encoding: Not sure, I just need a simple MP4 video files

    • Cropping: I can't find a solution for video cropping

    I don't need to rotate, reverse or do any fancy stuff to the videos, just those five functions.

    Now the only way forward is to find a simple video cropping function and an encoder that work on flutter IOS & Android

    My question is not looking for external library recommendations but:

    Do you have any ideas how to crop a video in flutter natively?

  • How can I use physical computer's GPU on VMware Workstation ?

    13 mars, par ching

    I want to use the GPU to accelerate video transcoding time by using FFmpeg on the virtual machine, VMware Workstation.

    When I use the command lspci | grep VGA, the output is

    00:0f.0 VGA compatible controller: VMware SVGA II Adapter
    

    It seems that I only can use its own Graphic Card on VMware, right?

    How can I use my host computer's GPU, NVIDIA Quadro K2000, from a program running in a guest VM?

    Or is there another solution that can solve the problem mentioned in the title?

  • Convert video MP4 audio to MP3 using C#

    13 mars, par Tom Lee

    I have some videos in MP4 format and I'm trying to extract the audio from them.

    My code is:

    public static void Converter(string toConvert)
    {
        toConvert = VideoFile + ".mp4";
    
        var join = VideoFile.Split("-").ToList();
    
        VideoFile = string.Format("{0} - {1}", join[0], join[1]);
    
        var outputFile = VideoFile + ".mp3";
        var mp3Out = "";
    
        var ffmpegProcess = new Process
        {
            StartInfo =
            {
                UseShellExecute = false,
                RedirectStandardInput = true,
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                CreateNoWindow = true,
                FileName = Directory,
                Arguments = " -i " + toConvert + " -vn -f mp3 -ab 320k output " + outputFile
            }
        };
    
        ffmpegProcess.Start();
        ffmpegProcess.StandardOutput.ReadToEnd();
        mp3Out = ffmpegProcess.StandardError.ReadToEnd();
        ffmpegProcess.WaitForExit();
    
        if (!ffmpegProcess.HasExited)
        {
            ffmpegProcess.Kill();
        }
        Console.WriteLine(mp3Out);
    }
    

    However, I get this error message:

    System.ComponentModel.Win32Exception: 'Access is denied'

    Any Ideas?

  • Force FFmpeg to use a non-standard codec in container/extension (opus in .m4b)

    13 mars, par Craig Stevenson

    For my audiobooks I am using a non standard combination of using the opus audio codec in m4b files (this works without issue on most devices for me as they support opus audio streams in mp4 containers).

    currently having to instruct ffmpeg to encode it into mp4 and i manually change the extension to m4b, as it gives this error if i try and do it directly despite it being the same container format:

    [ipod @ 0x64872b2de9c0] Could not find tag for codec opus in stream #1, codec not currently supported in container
    

    Is there any comand or options to let me overide this and force it to let me use and opus stream directly in .m4b?