Recherche avancée

Médias (1)

Mot : - Tags -/géodiversité

Autres articles (61)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (7741)

  • Use SDL2 play yuv file but actually no display [closed]

    14 juin 2024, par guan xi

    I use ffmpeg to demux and decode the media file, and then use SDL2 to play the raw data, everything is ok. no error no warning, but SDL2 windows does not dispaly video content.&#xA;All i know is frame dts is ordered in SDL2 play queue and data is good.

    &#xA;

    void VideoPlay::play_video() {&#xA;  while (is_running_) {&#xA;    refresh_loop_wait_event(&amp;event_);&#xA;&#xA;    switch (event_.type) {&#xA;      case SDL_KEYDOWN:&#xA;        if (event_.key.keysym.sym == SDLK_q) {&#xA;          LOG_INFO("Q quit");&#xA;          is_running_ = false;&#xA;          frame_queue_->abort();&#xA;        }&#xA;        break;&#xA;      case SDL_QUIT:&#xA;        LOG_INFO("SDL_QUIT");&#xA;        is_running_ = false;&#xA;        frame_queue_->abort();&#xA;        break;&#xA;&#xA;      default:&#xA;        break;&#xA;    }&#xA;  }&#xA;}&#xA;&#xA;void VideoPlay::refresh_loop_wait_event(SDL_Event *event) {&#xA;  SDL_PumpEvents();&#xA;&#xA;  while (&#xA;      !SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {&#xA;    video_refresh();&#xA;    SDL_PumpEvents();&#xA;  }&#xA;}&#xA;&#xA;void VideoPlay::video_refresh() {&#xA;  int ret = 0;&#xA;  frame_queue_->pop(frame_);&#xA;  if (!frame_) {&#xA;    LOG_ERROR("frame_queue_ pop failed.");&#xA;    is_running_ = false;&#xA;    frame_queue_->abort();&#xA;    return;&#xA;  }&#xA;&#xA;  rect_.x = 0;&#xA;  rect_.y = 0;&#xA;  rect_.w = video_width_;&#xA;  rect_.h = video_height_;&#xA;&#xA;  ret = SDL_UpdateYUVTexture(&#xA;      texture_, &amp;rect_, frame_->data[0], frame_->linesize[0], frame_->data[1],&#xA;      frame_->linesize[1], frame_->data[2], frame_->linesize[2]);&#xA;&#xA;  LOG_DEBUG("frame pts: %ld, tot size: %d, Y size: %d, U size: %d, V size: %d",&#xA;            frame_->pts, video_width_ * video_height_, frame_->linesize[0],&#xA;            frame_->linesize[1], frame_->linesize[2]);&#xA;  if (ret != 0) {&#xA;    LOG_ERROR("SDL_UpdateYUVTexture failed. %s", SDL_GetError());&#xA;    is_running_ = false;&#xA;    frame_queue_->abort();&#xA;    return;&#xA;  }&#xA;  ret = SDL_RenderClear(renderer_);&#xA;  if (ret != 0) {&#xA;    LOG_ERROR("SDL_RenderClear failed. %s", SDL_GetError());&#xA;    is_running_ = false;&#xA;    frame_queue_->abort();&#xA;    return;&#xA;  }&#xA;  ret = SDL_RenderCopy(renderer_, texture_, nullptr, &amp;rect_);&#xA;  if (ret != 0) {&#xA;    LOG_ERROR("SDL_RenderCopy failed. %s", SDL_GetError());&#xA;    is_running_ = false;&#xA;    frame_queue_->abort();&#xA;    return;&#xA;  }&#xA;  SDL_RenderPresent(renderer_);&#xA;  SDL_Delay(10);&#xA;  av_frame_free(&amp;frame_);&#xA;  frame_ = nullptr;&#xA;}&#xA;

    &#xA;

    log file out put

    &#xA;

    ~/A_CODES/ffmpeg_official/cmake-build-debug ᐅ cat sdlplay.log&#xA;[info]  [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/core/sp_demux.cpp:50  init] audio idx 1 video idx 0&#xA;[info]  [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/core/sp_decode.cpp:39  init] codec: h264&#xA;[info]  [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/core/sp_decode.cpp:68  init] yuv fmt: yuv420p&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x1100&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x1100&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x200&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x200&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x200&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x200&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x200&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x300&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x300&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x301&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:100  play_video] event 0x200&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 67, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 133, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 200, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 267, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 333, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 400, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 467, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 533, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 600, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 667, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 733, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 800, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 867, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;[debug] [2024-06-14 15:39:33] [/home/xiguan/A_CODES/ffmpeg_official/SDLPlayer/sdl/video_play.cpp:151  video_refresh] frame pts: 933, tot size: 82944, Y size: 384, U size: 192, V size: 192&#xA;

    &#xA;

    I try to handle SDL2 events correctly as ffplay but no use.&#xA;I also gdb to search anything error but nothing happen too.

    &#xA;

  • How can I remove every nth frame from raw video using ffmpeg ?

    15 juin 2024, par DaveB44

    Question moved to SuperUser, please reply there

    &#xA;

    I have many cine films that have been digitally converted. They have been converted as a 25 fps with 2 frames in every 23 duplicated. I need to remove the duplicated frames using a bitstream filter so there is no decoding/encoding.

    &#xA;

    After removing the frames I will change to the original cine frame rate of 18 fps. I will then change the frame rate to 25 fps using duplicated frames. I don't want to interpolate as I want to preserve the jerky format of the cine. Finally I will video editing software that will do the final encoding.

    &#xA;

    All the additional steps will cause several stages of decoding/encoding, that I need to avoid.

    &#xA;

    First I used a combination of the answers to FFmpeg remove video frames at specific intervals and FFmpeg remove every 6th frame starting from the 3rd frame, on an mp4 file to check it works. I modified it to remove every 4th and 17th frame in 25.

    &#xA;

    ffmpeg -loglevel warning -i cine.mp4 -an -vf "select=&#x27;if((mod(n-4,25)),(mod(n-17,25)))&#x27;,setpts=&#x27;N/FRAME_RATE/TB&#x27;" cine-23.mp4&#xA;

    &#xA;

    This works fine, but I end up with a file a quarter the size.

    &#xA;

    I now used Gyan's answer in Using ffmpeg to change framerate to extract the raw bitstream.

    &#xA;

    ffmpeg -loglevel warning -i cine.mp4 -c copy -f h264 cine.h264&#xA;

    &#xA;

    This created the h264 file as expected, surprisingly it was 16 kB smaller than the original (67 GB file size).

    &#xA;

    I then modified the code to use the .h264 file.

    &#xA;

    ffmpeg -loglevel warning -i cine.h264 -vf "select=&#x27;if((mod(n-4,25)),(mod(n-17,25)))&#x27;,setpts=&#x27;N/FRAME_RATE/TB&#x27;" cine-23.h264&#xA;

    &#xA;

    This gave the following error, but created the cine-23.h264 file although it was the same size as cine-23.mp4 in the test above

    &#xA;

    [h264 @ 00000245ec0bfb80] non-existing SPS 0 referenced in buffering period&#xA;    Last message repeated 1 times&#xA;

    &#xA;

    I then checked the ffmpeg bitstream filter documentation and found the bitstream filter setts. I changed my code to the following.

    &#xA;

    ffmpeg -loglevel warning -i cine.h264 -bsf:v "select=&#x27;if((mod(n-4,25)),(mod(n-17,25)))&#x27;,setts=pts=&#x27;N/FRAME_RATE/TB&#x27;" cine-23.h264&#xA;

    &#xA;

    Which resulted in the following error.

    &#xA;

    [vost#0:0/libx264 @ 000002916cf173c0] Error parsing bitstream filter sequence &#x27;select=&#x27;if((mod(n-4,25)),(mod(n-17,25)))&#x27;,setts=pts=&#x27;N/FRAME_RATE/TB&#x27;&#x27;: Bitstream filter not found&#xA;Error opening output file cine-23.h264.&#xA;Error opening output files: Bitstream filter not found&#xA;

    &#xA;

    I'm assuming the error is because setts does not support select. Is there another way to achieve what I am looking for ?

    &#xA;

    I could use mpdecimate but as that has to compare each frame it is much slower than defining it only needs to delete frames 4 and 17 in every second.

    &#xA;

    This is the output of ffprobe on my original file.

    &#xA;

    ffprobe version 2023-11-28-git-47e214245b-full_build-www.gyan.dev Copyright (c) 2007-2023 the FFmpeg developers&#xA;  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --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-libcodec2 --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&#xA;  libavutil      58. 32.100 / 58. 32.100&#xA;  libavcodec     60. 35.100 / 60. 35.100&#xA;  libavformat    60. 18.100 / 60. 18.100&#xA;  libavdevice    60.  4.100 / 60.  4.100&#xA;  libavfilter     9. 14.100 /  9. 14.100&#xA;  libswscale      7.  6.100 /  7.  6.100&#xA;  libswresample   4. 13.100 /  4. 13.100&#xA;  libpostproc    57.  4.100 / 57.  4.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;cine.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 19529864&#xA;    compatible_brands: mp42isom&#xA;    creation_time   : 2024-02-19T21:01:10.000000Z&#xA;  Duration: 00:01:00.00, start: 0.000000, bitrate: 9245 kb/s&#xA;  Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x576 [SAR 35:32 DAR 175:128], 9243 kb/s, 25 fps, 25 tbr, 25 tbn (default)&#xA;    Metadata:&#xA;      creation_time   : 2024-02-19T21:01:10.000000Z&#xA;      handler_name    : Video Media Handler&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : AVC Coding&#xA;

    &#xA;

  • What is the best way to split videos into equally sized parts using ffmpeg ? [closed]

    18 juin 2024, par GBPU

    I have tried to split an mp4 file into smaller parts of equal time length like this ffmpeg -i ../data/2024-06-02_12-34-51.mp4 -c copy -map 0 -segment_time 00:00:05 -f segment v1_%03d.mp4. However, this produced videos of highly variables size, some 25x larger than others. I assume this was due to inconsistent framerate during recording.

    &#xA;

    Next, I tried a script that would split based and limit each part to a specific size :

    &#xA;

    #!/bin/sh&#xA;# Short script to split videos by filesize using ffmpeg by LukeLR&#xA;&#xA;if [ $# -ne 3 ]; then&#xA;    echo &#x27;Illegal number of parameters. Needs 3 parameters:&#x27;&#xA;    echo &#x27;Usage:&#x27;&#xA;    echo &#x27;./split-video.sh FILE SIZELIMIT "FFMPEG_ARGS&#x27;&#xA;    echo &#xA;    echo &#x27;Parameters:&#x27;&#xA;    echo &#x27;    - FILE:        Name of the video file to split&#x27;&#xA;    echo &#x27;    - SIZELIMIT:   Maximum file size of each part (in bytes)&#x27;&#xA;    echo &#x27;    - FFMPEG_ARGS: Additional arguments to pass to each ffmpeg-call&#x27;&#xA;    echo &#x27;                   (video format and quality options etc.)&#x27;&#xA;    exit 1&#xA;fi&#xA;&#xA;FILE="../data/$1"&#xA;SIZELIMIT="$2"&#xA;FFMPEG_ARGS="$3"&#xA;&#xA;# Duration of the source video&#xA;DURATION=$(ffprobe -i "$FILE" -show_entries format=duration -v quiet -of default=noprint_wrappers=1:nokey=1|cut -d. -f -2)&#xA;&#xA;# Duration that has been encoded so far&#xA;CURDURATION=0&#xA;&#xA;# Filename of the source video (without extension)&#xA;BASENAME="${FILE%.*}"&#xA;&#xA;# Extension for the video parts&#xA;#EXTENSION="${FILE##*.}"&#xA;EXTENSION="mp4"&#xA;&#xA;# Number of the current video part&#xA;i=1&#xA;&#xA;# Filename of the next video part&#xA;NEXTFILENAME="$BASENAME-$i.$EXTENSION"&#xA;&#xA;echo "Duration of source video: $DURATION"&#xA;&#xA;# Until the duration of all partial videos has reached the duration of the source video&#xA;#while [[ $CUR_DURATION -lt $DURATION ]]; do&#xA;while [[ $(bc &lt;&lt;&lt; "$CURDURATION &lt; $DURATION") -eq 1 ]]; do&#xA;    # Encode next part&#xA;    echo ffmpeg -i "$FILE" -ss "$CURDURATION" -fs "$SIZELIMIT" $FFMPEG_ARGS "$NEXTFILENAME"&#xA;    ffmpeg -ss "$CURDURATION" -i "$FILE" -fs "$SIZELIMIT" $FFMPEG_ARGS "$NEXTFILENAME"&#xA;&#xA;    # Duration of the new part&#xA;    NEWDURATION=$(ffprobe -i "$NEXTFILENAME" -show_entries format=duration -v quiet -of default=noprint_wrappers=1:nokey=1|cut -d. -f -2)&#xA;&#xA;    # Total duration encoded so far&#xA;    echo $CURDURATION&#xA;    CURDURATION=$(bc &lt;&lt;&lt; "$CURDURATION &#x2B; $NEWDURATION")&#xA;    echo $CURDURATION&#xA;&#xA;    i=$((i &#x2B; 1))&#xA;&#xA;    echo "Duration of $NEXTFILENAME: $NEWDURATION"&#xA;    echo "Part No. $i starts at $CURDURATION"&#xA;    echo "Current Duration: $CURDURATION"&#xA;&#xA;    NEXTFILENAME="$BASENAME-$i.$EXTENSION"&#xA;done&#xA;

    &#xA;

    I call the script like this : bash split-video.sh 2024-06-02_12-34-51.mp4 10000000 "-c copy"&#xA;Unfortunately, this has an issue where some of the sub videos are extremely short and have wildly inconsistent numbers of frames in them (some with nearly 400, others with 1), despite being similar sizes. I am guessing this has something to do with inconsistent framerate and keyframes or something ?

    &#xA;

    I am curious what the best way to split a video into equally sized parts, and ideally with similar numbers of frames, is using ffmpeg.

    &#xA;