Recherche avancée

Médias (91)

Autres articles (67)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (11370)

  • MSVC fatal error LNK1120 : 1 unresolved externals with FFMPEG libs

    16 août 2019, par Jared

    I am trying to utilize the ffmpeg libraries in a program of my own and am having trouble linking them. Specifically, In my a basic program I am receiving fatal error LNK1120: 1 unresolved externals errors. The program is :

    #include <iostream>
    #include <libswresample></libswresample>swresample.h>

    int main()
    {
       std::cout &lt;&lt; "Hello World!\n";
       struct SwrContext* swr_ctx = swr_alloc();
       if (!swr_ctx) {
           std::cout &lt;&lt; "Could not allocate resampler context";
       }
    }
    </iostream>

    I downloaded prebuild libraries from https://ffmpeg.zeranoe.com/builds/, specifically the Windows x64 dev package which includes the .def/.lib as well as .dll files.

    I originally tried (and intend to ultimately use) cmake to generate the MSVC sln files. The cmake file is :

    cmake_minimum_required(VERSION 3.5)

    project(ffmpeg_jni)

    # Find the JNI bits
    find_package(JNI)

    # Search for the ffmpeg libraries
    set(ffmpeg_include_hint "ffmpeg-dev/include")
    set(ffmpeg_lib_hint "ffmpeg-dev/lib")

    find_path(SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h PATHS ${ffmpeg_include_hint})
    find_library(SWRESAMPLE_LIBRARY swresample PATHS ${ffmpeg_lib_hint})
    add_library(swresample SHARED IMPORTED)
    set_target_properties(swresample PROPERTIES
       IMPORTED_LOCATION "${SWRESAMPLE_LIBRARY}"
       IMPORTED_IMPLIB "${SWRESAMPLE_LIBRARY}"
       INTERFACE_INCLUDE_DIRECTORIES "${SWRESAMPLE_INCLUDE_DIR}"
    )

    # Setup basic include dirs
    set(includeDIRS
           src/main/cpp
           ${JAVA_INCLUDE_PATH})

    # Setup windows specific includes
    set(includeDIRS
           ${includeDIRS}
           ${JAVA_INCLUDE_PATH}/Win32)

    include_directories(${includeDIRS})

    set(WRAPPER_SRC
           src/main/cpp/logging.c
           src/main/cpp/logging.h
           src/main/cpp/main.cpp)

    add_library(ffmpeg_jni SHARED ${WRAPPER_SRC})
    target_link_libraries(ffmpeg_jni PRIVATE swresample)

    The generated solution compiles and has proper access to the include files (Visual Studio can even take me to the declarations). The issue comes in the linking phase of the build where I receive :

    error LNK2019 : unresolved external symbol "struct SwrContext * __cdecl
    swr_alloc(void)" (?swr_alloc@@YAPEAUSwrContext@@XZ) referenced in
    function main

    Thinking that I perhaps had something wrong in cmake since I am still pretty new with it I tried making a simple demo as a pure visual studio project following what I have found in countless online demos for adding an external library to a project. Specifically this included :

    • Adding the directory containing the header files to Properties->C/C++->General->Additional Include Directories
    • Adding the directory containing the .lib files to Properties->Linker->General->Additional Library Directories (Note that the cmake path did not do this but instead added the lib file via a relative path)
    • Adding the .lib file to Properties->Linker->Input->Additional Dependencies

    At this point any searching efforts I undertake show me different people doing the same things which tells me I’ve been looking at this too long to find the answer myself and its something trivial that I’m missing/not understanding.

  • "Undefined Reference" when compiling FFMPEG with librtmp on Android

    5 mars 2019, par elBradford

    I have searched, and while Building FFMPEG with librtmp for android answered part of my question, I ran into other issues further along in the compilation process.

    First, I am trying to use the script in this github repo, changing the flags to include

     --enable-librtmp \
     --extra-cflags=-I/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp/ \
     --extra-ldflags=-L/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp"

    I build librtmp with polarSSL following S74ck3r’s instructions on his github repo and stream-recorder thread. That appears to work correctly, and I have a librtmp.so, librtmp.a and rtmp.h

    When I try to compile ffmpeg with librtmp, I get the error

    ERROR: librtmp not found

    This SO question helped, and I modified ffmpeg’s config file so that it wouldn’t look at pkg-config for librtmp (even though pkg-config was aware of librtmp...) :

    #enabled librtmp    &amp;&amp; require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket

    When I build now, it starts successfully, and I get the hopeful line :

    librtmp enabled           yes

    And later on I see more good news :

    ...
    Enabled protocols:
    applehttp       http            mmsh
    cache           httpproxy       mmst
    concat          librtmp         mmsu
    crypto          librtmpe        pipe
    fd          librtmps        rtp
    file            librtmpt        tcp
    gopher          librtmpte       udp
    hls         md5
    ...

    but finally, after compiling everything and during the installation phase, I get these types of errors :

    INSTALL   libavutil/libavutil.pc
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_get_file_handle:libavformat/librtmp.c:190: error: undefined reference to 'RTMP_Socket'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read_seek:libavformat/librtmp.c:180: error: undefined reference to 'RTMP_SendSeek'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read_pause:libavformat/librtmp.c:161: error: undefined reference to 'RTMP_Pause'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_close:libavformat/librtmp.c:64: error: undefined reference to 'RTMP_Close'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_write:libavformat/librtmp.c:145: error: undefined reference to 'RTMP_Write'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read:libavformat/librtmp.c:153: error: undefined reference to 'RTMP_Read'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:96: error: undefined reference to 'RTMP_LogSetLevel'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:97: error: undefined reference to 'RTMP_LogSetCallback'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:118: error: undefined reference to 'RTMP_Init'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:119: error: undefined reference to 'RTMP_SetupURL'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:127: error: undefined reference to 'RTMP_Connect'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:127: error: undefined reference to 'RTMP_ConnectStream'
    /tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:125: error: undefined reference to 'RTMP_EnableWrite'
    collect2: ld returned 1 exit status

    And I can’t get past them. It sounds like it can’t find rtmp.h, which includes references to those functions, but that is present where it should be (afaik).

    Also, my project requires librtmp - the built-in rtmp features of ffmpeg are not sufficient because I require the authentication features of librtmp.

  • Invalid data found in the last hls segment after transcoding

    28 février 2024, par GalaDOS

    When I use ffmpeg to transcode some pure audio flv files to hls segments, the last .ts segment contains some decoding errors. It seems that it happens when the last segment's duration is short enough (about 1.5 second).

    &#xA;&#xA;

    Here is my transcode command :

    &#xA;&#xA;

    ffmpeg -i 111.flv -c:a aac -b:a 128k -f hls -hls_time 10.00 -hls_list_size 9999 tmp.m3u8&#xA;

    &#xA;&#xA;

    And output :

    &#xA;&#xA;

    ffmpeg version n4.0.1-5-gb5106c5 Copyright (c) 2000-2018 the FFmpeg developers&#xA;  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)&#xA;  configuration: --prefix=/home/zx/ffmpeg_build --extra-cflags=-I/home/zx/ffmpeg_build/include --extra-ldflags=&#x27;-L/home/zx/ffmpeg_build/lib -ldl&#x27; --bindir=/home/zx/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libspeex --enable-libvpx --enable-libx264 --disable-shared --enable-static --disable-debug&#xA;  libavutil      56. 14.100 / 56. 14.100&#xA;  libavcodec     58. 18.100 / 58. 18.100&#xA;  libavformat    58. 12.100 / 58. 12.100&#xA;  libavdevice    58.  3.100 / 58.  3.100&#xA;  libavfilter     7. 16.100 /  7. 16.100&#xA;  libswscale      5.  1.100 /  5.  1.100&#xA;  libswresample   3.  1.100 /  3.  1.100&#xA;  libpostproc    55.  1.100 / 55.  1.100&#xA;Input #0, flv, from &#x27;111.flv&#x27;:&#xA;  Metadata:&#xA;    major_brand     : M4A &#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2&#xA;    date            : 2018-05-31 01:31&#xA;    encoder         : Lavf57.25.100&#xA;  Duration: 00:12:11.40, start: 0.000000, bitrate: 135 kb/s&#xA;    Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (aac (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[hls @ 0x25d4280] Opening &#x27;tmp0.ts&#x27; for writing&#xA;[mpegts @ 0x26feb80] frame size not set&#xA;Output #0, hls, to &#x27;tmp.m3u8&#x27;:&#xA;  Metadata:&#xA;    major_brand     : M4A &#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2&#xA;    date            : 2018-05-31 01:31&#xA;    encoder         : Lavf58.12.100&#xA;    Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc58.18.100 aac&#xA;[hls @ 0x25d4280] Opening &#x27;tmp1.ts&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp2.ts&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp3.ts&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp4.ts&#x27; for writing&#xA;......&#xA;[hls @ 0x25d4280] Opening &#x27;tmp71.ts&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp72.ts&#x27; for writingx    &#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp73.ts&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;[hls @ 0x25d4280] Opening &#x27;tmp.m3u8.tmp&#x27; for writing&#xA;size=N/A time=00:12:11.39 bitrate=N/A speed=84.7x    &#xA;video:0kB audio:11421kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;[aac @ 0x25a0580] Qavg: 567.976&#xA;

    &#xA;&#xA;

    After transcoding, the duration of the last segment in m3u8 file is 1.39 second :

    &#xA;&#xA;

    ....&#xA;#EXTINF:9.984000,&#xA;tmp71.ts&#xA;#EXTINF:10.005333,&#xA;tmp72.ts&#xA;#EXTINF:1.386667,&#xA;tmp73.ts&#xA;#EXT-X-ENDLIST&#xA;

    &#xA;&#xA;

    But when I use ffprobe to parse the last segment, I got an error :

    &#xA;&#xA;

    ffprobe -i tmp73.ts &#xA;ffprobe version n4.0.1-5-gb5106c5 Copyright (c) 2007-2018 the FFmpeg developers&#xA;  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)&#xA;  configuration: --prefix=/home/zx/ffmpeg_build --extra-cflags=-I/home/zx/ffmpeg_build/include --extra-ldflags=&#x27;-L/home/zx/ffmpeg_build/lib -ldl&#x27; --bindir=/home/zx/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libspeex --enable-libvpx --enable-libx264 --disable-shared --enable-static --disable-debug&#xA;  libavutil      56. 14.100 / 56. 14.100&#xA;  libavcodec     58. 18.100 / 58. 18.100&#xA;  libavformat    58. 12.100 / 58. 12.100&#xA;  libavdevice    58.  3.100 / 58.  3.100&#xA;  libavfilter     7. 16.100 /  7. 16.100&#xA;  libswscale      5.  1.100 /  5.  1.100&#xA;  libswresample   3.  1.100 /  3.  1.100&#xA;  libpostproc    55.  1.100 / 55.  1.100&#xA;tmp73.ts: Invalid data found when processing input&#xA;

    &#xA;&#xA;

    The input flv :

    &#xA;&#xA;

    http://45.76.56.248/hls_transcode_fail.flv&#xA;md5sum: 4627bbb27bcb22c143ad4dfa47359650&#xA;

    &#xA;&#xA;

    Since my statistic module relies on the output of ffprobe, this exception will cause the entire transcoding task to fail. My temporary solution is to skip the last segment which is too short in the statistics phase. But I need a more reasonable and robust way to fix or bypass this issue. Any suggestion will be appreciated.

    &#xA;