Recherche avancée

Médias (91)

Autres articles (74)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (11880)

  • How to configure FFmpeg in windows ? [closed]

    2 août 2021, par GrassWarlock

    Hey there i'm not very tech savvy.

    


    when i invoke this command :

    


    ffmpeg -i input.mp4 -i subtitles.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4


    


    ( which is supposed to overlay 'input.mp4' with subtitles from 'subtitle.srt' )

    


    i get the following output :

    


    ffmpeg version 2021-07-27-git-0068b3d0f0-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57.  2.100 / 57.  2.100
  libavcodec     59.  3.102 / 59.  3.102
  libavformat    59.  4.101 / 59.  4.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  1.103 /  8.  1.103
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Input #0, matroska,webm, from 'video.mkv':
  Metadata:
    ENCODER         : Lavf59.4.101
  Duration: 00:05:39.94, start: 0.000000, bitrate: 665 kb/s
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 720x480, SAR 1:1 DAR 3:2, 29.97 fps, 29.97 tbr, 1k tbn (default)
    Metadata:
      DURATION        : 00:05:39.839000000
  Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp (default)
    Metadata:
      HANDLER_NAME    : SoundHandler
      VENDOR_ID       : [0][0][0][0]
      DURATION        : 00:05:39.940000000
Input #1, srt, from 'subtitles.srt':
  Duration: N/A, bitrate: N/A
  Stream #1:0: Subtitle: subrip
[mp4 @ 000001aa596242c0] Could not find tag for codec subrip in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:2 --
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #1:0 -> #0:2 (copy)
    Last message repeated 1 times


    


    i searched the internet and the official documentation mentions that libass should be enabled in the configuration in order for subtitling to work

    


    


    11.218 subtitles

    


    Draw subtitles on top of input video using the libass library.

    


    To enable compilation of this filter you need to configure FFmpeg with
—enable-libass. This filter also requires a build with libavcodec and libavformat to convert the passed subtitles file to ASS (Advanced
Substation Alpha) subtitles format

    


    


    how do i enable libass in configuration on windows ? my FFmpeg directory doesn't contain a configuration file nor a command that configures it from cmd

    


    Thanks alot in advance

    


  • Ffmpeg examples run in debug mode [on hold]

    25 août 2017, par Saeid Zangeneh

    I’m not so professional in c and cpp. I want to run FFmpeg official examples but there are many errors on include files. I can’t solve them.

    below output :when i try to run or debug the sample code

    debug output :

    cd '/home/saeid/NetBeansProjects/CppApplication_2'
    /usr/bin/make -f Makefile CONF=Debug
    "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-  conf
    make[1]: Entering directory '/home/saeid/NetBeansProjects
    /CppApplication_2'

    "/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-
    Linux/cppapplication_2

    make[2]: Entering directory '/home/saeid/NetBeansProjects
    /CppApplication_2'

    mkdir -p dist/Debug/GNU-Linux

    gcc     -o dist/Debug/GNU-Linux/cppapplication_2 build/Debug/GNU-
    Linux/sample.o

    build/Debug/GNU-Linux/sample.o: In function `select_channel_layout':

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:87: undefined
    reference to `av_get_channel_layout_nb_channels'

    build/Debug/GNU-Linux/sample.o: In function `audio_encode_example':

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:112: undefined
    reference to `avcodec_find_encoder'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:117: undefined
    reference to `avcodec_alloc_context3'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:127: undefined
    reference to `av_get_sample_fmt_name'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:134: undefined
    reference to `av_get_channel_layout_nb_channels'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:136: undefined
    reference to `avcodec_open2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:146: undefined
    reference to `av_frame_alloc'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:156: undefined
    reference to `av_samples_get_buffer_size'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:162: undefined
    reference to `av_malloc'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:169: undefined
    reference to `avcodec_fill_audio_frame'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:179: undefined
    reference to `av_init_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:183: undefined
    reference to `sin'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:189: undefined
    reference to `avcodec_encode_audio2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:196: undefined
    reference to `av_free_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:201: undefined
    reference to `avcodec_encode_audio2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:208: undefined
    reference to `av_free_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:212: undefined
    reference to `av_freep'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:213: undefined
    reference to `av_frame_free'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:214: undefined
    reference to `avcodec_close'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:215: undefined
    reference to `av_free'

    build/Debug/GNU-Linux/sample.o: In function `audio_decode_example':

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:229: undefined
    reference to `av_init_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:232: undefined
    reference to `avcodec_find_decoder'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:237: undefined
    reference to `avcodec_alloc_context3'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:243: undefined
    reference to `avcodec_open2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:254: undefined
    reference to `av_free'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:264: undefined
    reference to `av_frame_alloc'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:269: undefined
    reference to `avcodec_decode_audio4'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:276: undefined
    reference to `av_get_bytes_per_sample'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:305: undefined reference to `avcodec_close'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:306: undefined reference to `av_free'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:307: undefined reference to `av_frame_free'

    build/Debug/GNU-Linux/sample.o : In function `video_encode_example’ :

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:323: undefined reference to `avcodec_find_encoder'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:328: undefined reference to `avcodec_alloc_context3'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:350: undefined reference to `av_opt_set'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:352: undefined reference to `avcodec_open2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:361: undefined reference to `av_frame_alloc'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:371: undefined reference to `av_image_alloc'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:379: undefined reference to `av_init_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:399: undefined reference to `avcodec_encode_video2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:407: undefined reference to `av_free_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:413: undefined reference to `avcodec_encode_video2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:421: undefined reference to `av_free_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:427: undefined reference to `avcodec_close'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:428: undefined reference to `av_free'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:429: undefined reference to `av_freep'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:430: undefined reference to `av_frame_free'

    build/Debug/GNU-Linux/sample.o: In function `decode_write_frame':

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:452: undefined reference to `avcodec_decode_video2'

    build/Debug/GNU-Linux/sample.o : In function `video_decode_example’ :

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:481: undefined reference to `av_init_packet'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:486: undefined reference to `avcodec_find_decoder'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:491: undefined reference to `avcodec_alloc_context3'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:502: undefined reference to `avcodec_open2'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:511: undefined reference to `av_frame_alloc'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:545: undefined reference to `avcodec_close'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:546: undefined reference to `av_free'

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:547: undefined reference to `av_frame_free'

    build/Debug/GNU-Linux/sample.o: In function `main':

    /home/saeid/NetBeansProjects/CppApplication_2/sample.c:556: undefined
    reference to `avcodec_register_all'

    collect2: error: ld returned 1 exit status

    nbproject/Makefile-Debug.mk:62: recipe for target 'dist/Debug/GNU-
    Linux/cppapplication_2' failed

    make[2]: *** [dist/Debug/GNU-Linux/cppapplication_2] Error 1

    make[2]: Leaving directory '/home/saeid/NetBeansProjects/CppApplication_2'

    nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed

    make[1]: *** [.build-conf] Error 2

    make[1]: Leaving directory '/home/saeid/NetBeansProjects/CppApplication_2'

    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

    make: *** [.build-impl] Error 2
  • What's wrong with my use of timestamps/timebases for frame seeking/reading using libav (ffmpeg) ?

    17 septembre 2013, par mtree

    So I want to grab a frame from a video at a specific time using libav for the use as a thumbnail.

    What I'm using is the following code. It compiles and works fine (in regards to retrieving a picture at all), yet I'm having a hard time getting it to retrieve the right picture.

    I simply can't get my head around the all but clear logic behind libav's apparent use of multiple time-bases per video. Specifically figuring out which functions expect/return which type of time-base.

    The docs were of basically no help whatsoever, unfortunately. SO to the rescue ?

    #define ABORT(x) do {fprintf(stderr, x); exit(1);} while(0)

    av_register_all();

    AVFormatContext *format_context = ...;
    AVCodec *codec = ...;
    AVStream *stream = ...;
    AVCodecContext *codec_context = ...;
    int stream_index = ...;

    // open codec_context, etc.

    AVRational stream_time_base = stream->time_base;
    AVRational codec_time_base = codec_context->time_base;

    printf("stream_time_base: %d / %d = %.5f\n", stream_time_base.num, stream_time_base.den, av_q2d(stream_time_base));
    printf("codec_time_base: %d / %d = %.5f\n\n", codec_time_base.num, codec_time_base.den, av_q2d(codec_time_base));

    AVFrame *frame = avcodec_alloc_frame();

    printf("duration: %lld @ %d/sec (%.2f sec)\n", format_context->duration, AV_TIME_BASE, (double)format_context->duration / AV_TIME_BASE);
    printf("duration: %lld @ %d/sec (stream time base)\n\n", format_context->duration / AV_TIME_BASE * stream_time_base.den, stream_time_base.den);
    printf("duration: %lld @ %d/sec (codec time base)\n", format_context->duration / AV_TIME_BASE * codec_time_base.den, codec_time_base.den);

    double request_time = 10.0; // 10 seconds. Video's total duration is ~20sec
    int64_t request_timestamp = request_time / av_q2d(stream_time_base);
    printf("requested: %.2f (sec)\t-> %2lld (pts)\n", request_time, request_timestamp);

    av_seek_frame(format_context, stream_index, request_timestamp, 0);

    AVPacket packet;
    int frame_finished;
    do {
       if (av_read_frame(format_context, &packet) < 0) {
           break;
       } else if (packet.stream_index != stream_index) {
           av_free_packet(&packet);
           continue;
       }
       avcodec_decode_video2(codec_context, frame, &frame_finished, &packet);
    } while (!frame_finished);

    // do something with frame

    int64_t received_timestamp = frame->pkt_pts;
    double received_time = received_timestamp * av_q2d(stream_time_base);
    printf("received:  %.2f (sec)\t-> %2lld (pts)\n\n", received_time, received_timestamp);

    Running this with a test movie file I get this output :

       stream_time_base: 1 / 30000 = 0.00003
       codec_time_base: 50 / 2997 = 0.01668

       duration: 20062041 @ 1000000/sec (20.06 sec)
       duration: 600000 @ 30000/sec (stream time base)
       duration: 59940 @ 2997/sec (codec time base)

       requested: 10.00 (sec)  -> 300000 (pts)
       received:  0.07 (sec)   -> 2002 (pts)

    The times don't match. What's going on here ? What am I doing wrong ?


    While searching for clues I stumbled upon this this statement from the libav-users mailing list…

    [...] packet PTS/DTS are in units of the format context's time_base,
    where the AVFrame->pts value is in units of the codec context's time_base.

    In other words, the container can have (and usually does) a different
    time_base than the codec. Most libav players don't bother using the
    codec's time_base or pts since not all codecs have one, but most
    containers do. (This is why the dranger tutorial says to ignore AVFrame->pts)

    …which confused me even more, given that I couldn't find any such mention in the official docs.

    Anyway, I replaced…

    double received_time = received_timestamp * av_q2d(stream_time_base);

    …with…

    double received_time = received_timestamp * av_q2d(codec_time_base);

    …and the output changed to this…

    ...

    requested: 10.00 (sec)  -> 300000 (pts)
    received:  33.40 (sec)  -> 2002 (pts)

    Still no match. What's wrong ?