Recherche avancée

Médias (91)

Autres articles (103)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (11771)

  • how to pass arguments to existing process instance in c#

    28 octobre 2013, par Akash Langhani

    I am using ffmpeg and I have start a process and I want to pass an argument to same instance after its start, so how to do this in c sharp any resource. Basically I am using ffmpeg to recored desktop screen and ffmpeg recording can be stop with "q" word.

  • A C language ffmpeg project organized with CMakeLists, encounters errors in the Windows MinGW64 environment

    20 juin 2023, par flywen

    Project Structure

    


    ffmpeg-tutorial

    


      

    • include

        

      • libavcodec
      • 


      • libavdevice
      • 


      • libavfilter
      • 


      • libavformat
      • 


      • libavutil
      • 


      • libswresample
      • 


      • libswscale
      • 


      


    • 


    • lib

        

      • pkgconfig
      • 


      • libavcodec.a
      • 


      • libavdevice.a
      • 


      • libavfilter.a
      • 


      • libformat.a
      • 


      • libavutil.a
      • 


      • libswresample.a
      • 


      • libswscale.a
      • 


      


    • 


    • CMakeLists.txt
    • 


    • main.c
    • 


    


    CMakeLists.txt

    


    cmake_minimum_required(VERSION 3.20)
project(ffmpeg_tutorial)

set(CMAKE_C_STANDARD 11)

include_directories(include)
link_directories(lib)
add_executable(ffmpeg_tutorial main.cpp)
target_link_libraries(ffmpeg_tutorial
        avformat
        avcodec
        avutil
        swscale
        swresample
        z
        bz2
        iconv
        ws2_32
        schannel
        kernel32
        advapi32
        kernel32
        user32
        gdi32
        winspool
        shell32
        ole32
        oleaut32
        uuid
        comdlg32
        advapi32
        )


    


    main.c

    


    #include 
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswresample/swresample.h"
int main() {
    std::cout << "Hello, World!" << std::endl;
    std::cout << av_version_info() << std::endl;
    printf("ffmpeg version is %s\n", av_version_info());
    // Open input file
    AVFormatContext *inputContext = nullptr;
    if (avformat_open_input(&inputContext, "input.mp3", nullptr, nullptr) != 0) {
        printf("Couldn't open input file\n");
        return -1;
    }

    // Read input stream
    if (avformat_find_stream_info(inputContext, nullptr) < 0) {
        printf("Couldn't find stream information\n");
        return -1;
    }

    // Get audio stream index
    int audioStream = -1;
    for (int i = 0; i < inputContext->nb_streams; i++) {
        if (inputContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
            audioStream = i;
            break;
        }
    }

    if (audioStream == -1) {
        printf("Couldn't find audio stream\n");
        return -1;
    }
}



    


    IDE

    


    clion

    


    ERRORS

    


    [ 50%] Building CXX object CMakeFiles/ffmpeg_tutorial.dir/main.cpp.obj
[100%] Linking CXX executable ffmpeg_tutorial.exe
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavformat.a(tls_schannel.o): in function `tls_write':
D:\Msys64\usr\src\ffmpeg/libavformat/tls_schannel.c:563: undefined reference to `EncryptMessage'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavformat.a(tls_schannel.o): in function `tls_read':
D:\Msys64\usr\src\ffmpeg/libavformat/tls_schannel.c:441: undefined reference to `DecryptMessage'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavcodec.a(mfenc.o):mfenc.c:(.rdata$.refptr.IID_ICodecAPI[.refptr.IID_ICodecAPI]+0x0): undefined reference to `IID_ICodecAPI'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavcodec.a(tiff.o): in function `tiff_uncompress_lzma':
D:\Msys64\usr\src\ffmpeg/libavcodec/tiff.c:577: undefined reference to `lzma_stream_decoder'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavcodec/tiff.c:582: undefined reference to `lzma_code'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavcodec/tiff.c:583: undefined reference to `lzma_end'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavutil.a(random_seed.o): in function `av_get_random_seed':
D:\Msys64\usr\src\ffmpeg/libavutil/random_seed.c:127: undefined reference to `BCryptOpenAlgorithmProvider'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavutil/random_seed.c:130: undefined reference to `BCryptGenRandom'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavutil/random_seed.c:131: undefined reference to `BCryptCloseAlgorithmProvider'
collect2.exe: error: ld returned 1 exit status
mingw32-make[3]: *** [CMakeFiles\ffmpeg_tutorial.dir\build.make:95: ffmpeg_tutorial.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:82: CMakeFiles/ffmpeg_tutorial.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:89: CMakeFiles/ffmpeg_tutorial.dir/rule] Error 2
mingw32-make: *** [Makefile:123: ffmpeg_tutorial] Error 2


    


    What is the way I compile ffmpeg

    


      

    • downlaod msys2

      


    • 


    • install mingw64

      


    • 


    


    pacman -S mingw-w64-x86_64-toolchain


    


      

    • install make,diffutils,nasm,yasm,pkg-config

      


    • 


    


    pacman -S base-devl yasm nasm pkg-config


    


      

    • download ffmpeg 5.1

      


    • 


    • compile

      


    • 


    


    cd ffmpeg
./configure --disable-shared --enable-static --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --pkg-config-flags=--static --prefix=../ffmpeg-build

make -j $(nproc)

make install



    


    Project Repoistory

    


    https://github.com/joinwen/learn_ffmpeg.git

    


    Expectation

    


      

    1. How to solve errors
    2. 


    3. In CMakeLists target_link_libraries's parameters is too much, Can I make it short
    4. 


    5. some advices on the project
    6. 


    


  • Shared Hosting + Static FFMPEG + PHP (or other scripting language) == failure on finding codec

    7 juillet 2012, par Ethan Allen

    here is the following environment :

    1. 1and1 shared hosting (they do not have ffmpeg installed, all good)
    2. i built a static ffmpeg binary that does not require dynamic loading of shared libaries (i built this on an Ubuntu system)
    3. ffmpeg binary is fully accessible and is able to get access
    4. executing the same command terminal or executing a php/perl script via terminal works fine...however, both scripts through a browser/web request fails with the following :

    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    array
    0 => string 'ffmpeg version git-2012-07-06-6936111 Copyright (c) 2000-2012 the FFmpeg developers' (length=83)
    1 => string ' built on Jul 5 2012 23:04:34 with gcc 4.4.3' (length=46)
    2 => string ' configuration : —prefix=' /ffmpeg' —enable-gpl —enable-libfaac —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libtheora —enable-libvorbis —enable-libvpx —enable-libx264 —enable-nonfree —enable-version3 —enable-static —disable-shared —extra-libs=-static —extra-cflags=-static' (length=323)
    3 => string ' libavutil 51. 64.100 / 51. 64.100' (length=40)
    4 => string ' libavcodec 54. 33.100 / 54. 33.100' (length=40)
    5 => string ' libavformat 54. 15.100 / 54. 15.100' (length=40)
    6 => string ' libavdevice 54. 1.100 / 54. 1.100' (length=40)
    7 => string ' libavfilter 3. 0.101 / 3. 0.101' (length=40)
    8 => string ' libswscale 2. 1.100 / 2. 1.100' (length=40)
    9 => string ' libswresample 0. 15.100 / 0. 15.100' (length=40)
    10 => string ' libpostproc 52. 0.100 / 52. 0.100' (length=40)
    11 => string 'Input #0, image2, from 'http://axiomchurch.co/main/wp-content/plugins/video-embed-thumbnail-generator/flash/skin/images/PlayNormal.png':' ; (length=136)
    12 => string ' Duration : 00:00:00.04, start : 0.000000, bitrate : N/A' (length=54)
    13 => string ' Stream #0:0 : Video : png, rgba, 100x100, 25 tbr, 25 tbn, 25 tbc' (length=66)
    14 => string '[graph 0 input from stream 0:0 @ 0x9482000] w:100 h:100 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2' (length=109)
    15 => string '[output stream 0:0 @ 0x948ccc0] No opaque field provided' (length=56)
    16 => string '[auto-inserted scaler 0 @ 0x948d160] w:100 h:100 fmt:rgba sar:0/1 -> w:100 h:100 fmt:yuvj420p sar:0/1 flags:0x4' (length=111)
    17 => string '[mjpeg @ 0x948c760] ff_frame_thread_encoder_init failed' (length=55)
    18 => string 'Output #0, image2, to '/homepages/17/d411786663/htdocs/main/wp-content/uploads/2012/07/ffmpeg_exists_test%d.jpg' :' (length=113)
    19 => string ' Stream #0:0 : Video : mjpeg, yuvj420p, 100x100, q=2-31, 200 kb/s, 90k tbn, 25 tbc' (length=83)
    20 => string 'Stream mapping :' (length=15)
    21 => string ' Stream #0:0 -> #0:0 (png -> mjpeg)' (length=36)
    22 => string 'Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height' (length=119)

    The command being executed :

    /kunden/homepages/17/.../htdocs/bin/ffmpeg -i http://....co/main/wp-content/plugins/video-embed-thumbnail-generator/flash/skin/images/PlayNormal.png -ac 2 /homepages/17/.../htdocs/main/wp-content/uploads/2012/07/ffmpeg_exists_test.jpg

    You can see i have the full path of my ffmpeg binary and that it is executing. Here is what it looks like successfully via terminal :

    ffmpeg version git-2012-07-06-6936111 Copyright (c) 2000-2012 the FFmpeg developers
    built on Jul 5 2012 23:04:34 with gcc 4.4.3
    configuration : —prefix=' /ffmpeg' —enable-gpl —enable-libfaac —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libtheora —enable-libvorbis —enable-libvpx —enable-libx264 —enable-nonfree —enable-version3 —enable-static —disable-shared —extra-libs=-static —extra-cflags=-static
    libavutil 51. 64.100 / 51. 64.100
    libavcodec 54. 33.100 / 54. 33.100
    libavformat 54. 15.100 / 54. 15.100
    libavdevice 54. 1.100 / 54. 1.100
    libavfilter 3. 0.101 / 3. 0.101
    libswscale 2. 1.100 / 2. 1.100
    libswresample 0. 15.100 / 0. 15.100
    libpostproc 52. 0.100 / 52. 0.100
    Input #0, image2, from 'http://axiomchurch.co/main/wp-content/plugins/video-embed-thumbnail-generator/flash/skin/images/PlayNormal.png':
    Duration : 00:00:00.04, start : 0.000000, bitrate : N/A
    Stream #0:0 : Video : png, rgba, 100x100, 25 tbr, 25 tbn, 25 tbc
    [graph 0 input from stream 0:0 @ 0x9482000] w:100 h:100 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
    [output stream 0:0 @ 0x948ccc0] No opaque field provided
    [auto-inserted scaler 0 @ 0x948d160] w:100 h:100 fmt:rgba sar:0/1 -> w:100 h:100 fmt:yuvj420p sar:0/1 flags:0x4
    Output #0, image2, to '/homepages/17/d411786663/htdocs/main/wp-content/uploads/2012/07/ffmpeg_exists_test.jpg' :
    Metadata :
    encoder : Lavf54.15.100
    Stream #0:0 : Video : mjpeg, yuvj420p, 100x100, q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream mapping :
    Stream #0:0 -> #0:0 (png -> mjpeg)
    Press [q] to stop, [?] for help
    frame= 1 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.04 bitrate= 0.0kbits/s
    video:2kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.000000%

    The user running the script at terminal AND the apache user are the same user...i have verified this.

    Something about the environment apache is running through is killing me...i dont have access to apache error logs unfortunately.

    As a side note...i am trying to utilize the Video Embed & Thumbnail Generator for wordpress.

    Any help appreciated, thanks !