Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (71)

  • 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 (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • 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 (...)

Sur d’autres sites (9919)

  • ffmpeg programatically set the export date to download date using python

    16 janvier 2021, par Vladimir Tarasov

    i'm currently using the code below to export a youtube-dl converted video (with ffmpeg and youtube-dl for python)
how could i programatically set the good options for ffmpeg to add the download date (at least today's date) to the .mp3 file ?

    


    ydl_opts = {
    'format': 'bestaudio/best',
    'outtmpl': path + urlToTitleYT(link) + '.mp3',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '320',
    }],
}

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([link])



    


  • FFMPEG Can't Display The Duration Of a Video

    27 juillet 2015, par Malkavian

    I’m trying to use ffmpeg to capture frames from a video file, but I can’t even get the duration of a video. everytime when I try to access it with pFormatCtx->duration I’m getting 0. I know the pointer initialized and contains the correct duration because if I use av_dump_format(pFormatCtx, 0, videoName, 0); then I actually get the duration data along with other information about the video.
    This is what I get when I use av_dump_format(pFormatCtx, 0, videoName, 0); :

    Input #0, avi, from ’futurama.avi’ :

    Duration : 00:21:36.28, start : 0.000000, bitrate : 1135 kb/s

    Stream #0.0 : Video : mpeg4 (Advanced Simple Profile), yuv420p, 512x384

    [PAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc

    Stream #0.1 : Audio : ac3, 48000 Hz, stereo, s16, 192 kb/s

    I don’t understand why av_dum_format can display duration and I can’t. I checked the function definition, to display the duration, the function also uses pFormatCtx->duration. It’s not just the duration other member variables also don’t display the proper data when I call them in main.cpp

    Here’s my main.cpp :

    extern "C" {
       #include<libavcodec></libavcodec>avcodec.h>
       #include<libavformat></libavformat>avformat.h>
       #include<libswscale></libswscale>swscale.h>
    }


    int main(int argc, char *argv[]) {
       AVFormatContext *pFormatCtx = NULL;

       const char videoName[] = "futurama.avi";

       // Register all formats and codecs.
       av_register_all();
       cout &lt;&lt; "Opening the video file";
       // Open video file
       int ret = avformat_open_input(&amp;pFormatCtx, videoName, NULL, NULL) != 0;
       if (ret != 0) {
           cout &lt;&lt; "Couldn't open the video file." &lt;&lt; ret ;
           return -1;
       }
       if(avformat_find_stream_info(pFormatCtx, 0) &lt; 0) {
           cout &lt;&lt; "problem with stream info";
           return -1;
       }

       av_dump_format(pFormatCtx, 0, videoName, 0);
       cout &lt;&lt; pFormatCtx->bit_rate &lt;&lt; endl; // different value each time, not initialized properly.
       cout &lt;&lt; pFormatCtx->duration &lt;&lt; endl; // 0
       return 0;
    }

    I don’t know if it helps but, I use QtCreator on Ubuntu and linked the libraries statically.

    Thank you for your help.

  • Timeline Display Issue When Merging Multi-Track MP4 Files with FFmpeg

    9 juillet 2024, par EasonWaii

    I need to merge two videos into one using ffmpeg. The resulting video should have two video tracks and one audio track, with the audio track taken from the longer video.

    &#xA;

    When playing the merged video in a player like PotPlayer or VLC, it should default to playing the shorter video track. However, users should be able to switch to the other video track if they want.

    &#xA;

    The problem I am facing :&#xA;Everything is working fine, except when the player defaults to the shorter video track, it shows the timeline of the longer video track.

    &#xA;

     built with Apple clang version 15.0.0 (clang-1500.3.9.4)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox&#xA;  libavutil      59.  8.100 / 59.  8.100&#xA;  libavcodec     61.  3.100 / 61.  3.100&#xA;  libavformat    61.  1.100 / 61.  1.100&#xA;  libavdevice    61.  1.100 / 61.  1.100&#xA;  libavfilter    10.  1.100 / 10.  1.100&#xA;  libswscale      8.  1.100 /  8.  1.100&#xA;  libswresample   5.  1.100 /  5.  1.100&#xA;  libpostproc    58.  1.100 / 58.  1.100&#xA;{&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;output21.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf59.16.100&#xA;  Duration: 00:00:12.84, start: 0.000000, bitrate: 2207 kb/s&#xA;  Stream #0:0[0x1](und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 720x1280 [SAR 1:1 DAR 9:16], 1052 kb/s, 30 fps, 30 tbr, 15360 tbn&#xA;      Metadata:&#xA;        handler_name    : VideoHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;  Stream #0:1[0x2](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 720x1280, 1293 kb/s, 29.83 fps, 29.83 tbr, 11456 tbn (default)&#xA;      Metadata:&#xA;        handler_name    : ?Mainconcept Video Media Handler&#xA;        vendor_id       : [0][0][0][0]&#xA;  Stream #0:2[0x3](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s (default)&#xA;      Metadata:&#xA;        handler_name    : SoundHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;    "streams": [&#xA;        {&#xA;            "index": 0,&#xA;            "codec_name": "hevc",&#xA;            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",&#xA;            "profile": "Main",&#xA;            "codec_type": "video",&#xA;            "codec_tag_string": "hev1",&#xA;            "codec_tag": "0x31766568",&#xA;            "width": 720,&#xA;            "height": 1280,&#xA;            "coded_width": 720,&#xA;            "coded_height": 1280,&#xA;            "closed_captions": 0,&#xA;            "film_grain": 0,&#xA;            "has_b_frames": 2,&#xA;            "sample_aspect_ratio": "1:1",&#xA;            "display_aspect_ratio": "9:16",&#xA;            "pix_fmt": "yuv420p",&#xA;            "level": 93,&#xA;            "color_range": "tv",&#xA;            "chroma_location": "left",&#xA;            "field_order": "progressive",&#xA;            "refs": 1,&#xA;            "id": "0x1",&#xA;            "r_frame_rate": "30/1",&#xA;            "avg_frame_rate": "30/1",&#xA;            "time_base": "1/15360",&#xA;            "start_pts": 0,&#xA;            "start_time": "0.000000",&#xA;            "duration_ts": 196096,&#xA;            "duration": "12.766667",&#xA;            "bit_rate": "1052926",&#xA;            "nb_frames": "383",&#xA;            "extradata_size": 2480,&#xA;            "disposition": {&#xA;                "default": 0,&#xA;                "dub": 0,&#xA;                "original": 0,&#xA;                "comment": 0,&#xA;                "lyrics": 0,&#xA;                "karaoke": 0,&#xA;                "forced": 0,&#xA;                "hearing_impaired": 0,&#xA;                "visual_impaired": 0,&#xA;                "clean_effects": 0,&#xA;                "attached_pic": 0,&#xA;                "timed_thumbnails": 0,&#xA;                "non_diegetic": 0,&#xA;                "captions": 0,&#xA;                "descriptions": 0,&#xA;                "metadata": 0,&#xA;                "dependent": 0,&#xA;                "still_image": 0&#xA;            },&#xA;            "tags": {&#xA;                "language": "und",&#xA;                "handler_name": "VideoHandler",&#xA;                "vendor_id": "[0][0][0][0]"&#xA;            }&#xA;        },&#xA;        {&#xA;            "index": 1,&#xA;            "codec_name": "h264",&#xA;            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",&#xA;            "profile": "High",&#xA;            "codec_type": "video",&#xA;            "codec_tag_string": "avc1",&#xA;            "codec_tag": "0x31637661",&#xA;            "width": 720,&#xA;            "height": 1280,&#xA;            "coded_width": 720,&#xA;            "coded_height": 1280,&#xA;            "closed_captions": 0,&#xA;            "film_grain": 0,&#xA;            "has_b_frames": 2,&#xA;            "pix_fmt": "yuv420p",&#xA;            "level": 31,&#xA;            "color_range": "tv",&#xA;            "color_space": "bt709",&#xA;            "color_transfer": "bt709",&#xA;            "color_primaries": "bt709",&#xA;            "chroma_location": "left",&#xA;            "field_order": "progressive",&#xA;            "refs": 1,&#xA;            "is_avc": "true",&#xA;            "nal_length_size": "4",&#xA;            "id": "0x2",&#xA;            "r_frame_rate": "179/6",&#xA;            "avg_frame_rate": "3448256/115597",&#xA;            "time_base": "1/11456",&#xA;            "start_pts": 0,&#xA;            "start_time": "0.000000",&#xA;            "duration_ts": 115597,&#xA;            "duration": "10.090520",&#xA;            "bit_rate": "1293284",&#xA;            "bits_per_raw_sample": "8",&#xA;            "nb_frames": "301",&#xA;            "extradata_size": 46,&#xA;            "disposition": {&#xA;                "default": 1,&#xA;                "dub": 0,&#xA;                "original": 0,&#xA;                "comment": 0,&#xA;                "lyrics": 0,&#xA;                "karaoke": 0,&#xA;                "forced": 0,&#xA;                "hearing_impaired": 0,&#xA;                "visual_impaired": 0,&#xA;                "clean_effects": 0,&#xA;                "attached_pic": 0,&#xA;                "timed_thumbnails": 0,&#xA;                "non_diegetic": 0,&#xA;                "captions": 0,&#xA;                "descriptions": 0,&#xA;                "metadata": 0,&#xA;                "dependent": 0,&#xA;                "still_image": 0&#xA;            },&#xA;            "tags": {&#xA;                "language": "eng",&#xA;                "handler_name": "\u001fMainconcept Video Media Handler",&#xA;                "vendor_id": "[0][0][0][0]"&#xA;            }&#xA;        },&#xA;        {&#xA;            "index": 2,&#xA;            "codec_name": "aac",&#xA;            "codec_long_name": "AAC (Advanced Audio Coding)",&#xA;            "profile": "LC",&#xA;            "codec_type": "audio",&#xA;            "codec_tag_string": "mp4a",&#xA;            "codec_tag": "0x6134706d",&#xA;            "sample_fmt": "fltp",&#xA;            "sample_rate": "44100",&#xA;            "channels": 2,&#xA;            "channel_layout": "stereo",&#xA;            "bits_per_sample": 0,&#xA;            "initial_padding": 0,&#xA;            "id": "0x3",&#xA;            "r_frame_rate": "0/0",&#xA;            "avg_frame_rate": "0/0",&#xA;            "time_base": "1/44100",&#xA;            "start_pts": 0,&#xA;            "start_time": "0.000000",&#xA;            "duration_ts": 566244,&#xA;            "duration": "12.840000",&#xA;            "bit_rate": "130447",&#xA;            "nb_frames": "554",&#xA;            "extradata_size": 5,&#xA;            "disposition": {&#xA;                "default": 1,&#xA;                "dub": 0,&#xA;                "original": 0,&#xA;                "comment": 0,&#xA;                "lyrics": 0,&#xA;                "karaoke": 0,&#xA;                "forced": 0,&#xA;                "hearing_impaired": 0,&#xA;                "visual_impaired": 0,&#xA;                "clean_effects": 0,&#xA;                "attached_pic": 0,&#xA;                "timed_thumbnails": 0,&#xA;                "non_diegetic": 0,&#xA;                "captions": 0,&#xA;                "descriptions": 0,&#xA;                "metadata": 0,&#xA;                "dependent": 0,&#xA;                "still_image": 0&#xA;            },&#xA;            "tags": {&#xA;                "language": "und",&#xA;                "handler_name": "SoundHandler",&#xA;                "vendor_id": "[0][0][0][0]"&#xA;            }&#xA;        }&#xA;    ],&#xA;    "format": {&#xA;        "filename": "output21.mp4",&#xA;        "nb_streams": 3,&#xA;        "nb_programs": 0,&#xA;        "nb_stream_groups": 0,&#xA;        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",&#xA;        "format_long_name": "QuickTime / MOV",&#xA;        "start_time": "0.000000",&#xA;        "duration": "12.840000",&#xA;        "size": "3543155",&#xA;        "bit_rate": "2207573",&#xA;        "probe_score": 100,&#xA;        "tags": {&#xA;            "major_brand": "isom",&#xA;            "minor_version": "512",&#xA;            "compatible_brands": "isomiso2avc1mp41",&#xA;            "encoder": "Lavf59.16.100"&#xA;        }&#xA;    }&#xA;}&#xA;&#xA;

    &#xA;

    I want the timeline to display correctly according to the shorter video track when it is being played, without truncating the timeline of the longer video track and affecting its playback.

    &#xA;