Recherche avancée

Médias (91)

Autres articles (63)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (9091)

  • FFMPEG/C++ How to simply write out/passthrough h264 stream ?

    11 août 2021, par Schuerta

    Im trying to learn the basics of ffmpeg writing (reading already works), so im just trying to take in an input .ts file and write out/passthrough the exact same h264 stream to a new output file. I dont get any compilation errors, but for some reason i cant figure out why my output file's framerate is very wrong. Also when i read in my output file, i get printouts saying "Packet corrupt (stream = 0, dts = #)"

    


    I followed the instructions in the ffmpeg library comments so im not sure what im missing. I call initOutStream(), then initH264encoder(), then during the reading/decoding readH264Packet() is called repeatedly. (Removed code for readability sake, left relevant sections below) ;

    


    Edit : If i put my output file through the actuall ffmpeg cmd app, the framerate issue seems to get fixed. Wonder where im messing up

    


    void test::initOutStream() {

//create muxing context
outstreamContext = avformat_alloc_context();

//oformat
AVOutputFormat *guessFormat; //Populate oformat
guessFormat = av_guess_format(NULL, inputVideoUrl.c_str(), NULL);
outstreamContext->oformat = guessFormat; 
outstreamContext->oformat->video_codec = AV_CODEC_ID_H264; 
//outstreamContext->bit_rate = 400000; //No affect; 

//pb
AVIOContext *outAVIOContext = nullptr;
//int result = avio_open(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE);
int result = avio_open2(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE, NULL, NULL); //Documentain said to use this method
outstreamContext->pb = outAVIOContext;
}


    


    .

    


    void test::initH264encoder() { //Frame -> packet&#xA;int result;&#xA;&#xA;h264OutCodec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;&#xA;h264OutStream = avformat_new_stream(outstreamContext, h264OutCodec);&#xA;h264OutStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;h264OutStream->codecpar->codec_id = AV_CODEC_ID_H264;&#xA;h264OutStream->codecpar->width = 640;&#xA;h264OutStream->codecpar->height = 480;&#xA;h264OutStream->id = H264_STREAM_ID;&#xA;h264OutStream->codecpar->color_range = AVCOL_RANGE_MPEG;&#xA;//h264OutStream->codecpar->bit_rate = 400000;&#xA;&#xA;h264OutContext = avcodec_alloc_context3(h264OutCodec);&#xA;&#xA;h264OutContext->width = 640;&#xA;h264OutContext->height = 480;&#xA;h264OutContext->time_base = (AVRational){1,static_cast<int>(29.97)};&#xA;h264OutContext->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;&#xA;result = avcodec_open2(h264OutContext, h264OutCodec, nullptr);&#xA;&#xA;//Alloc packet &#x2B; finish&#xA;outPacket = av_packet_alloc();&#xA;&#xA;//Write header&#xA;result = avformat_write_header(outstreamContext, NULL);&#xA;}&#xA;</int>

    &#xA;

    Assume that reading was set up correctly

    &#xA;

    void test::readH264Packet(__unused uint64_t tick) {&#xA;//...av_read_frame(streamContext, inPacket);&#xA;//...avcodec_send_packet(h264Context, inPacket);&#xA;//...avcodec_receive_frame(h264Context, yuvFrame)&#xA;//My passthrough:&#xA;if(shouldOutputH264Stream){&#xA;        result = avcodec_send_frame(h264OutContext, yuvFrame); //1. Encode frame to packet&#xA;        result = avcodec_receive_packet(h264OutContext, outPacket2); //2. get encoded packet&#xA;        result = av_interleaved_write_frame(outstreamContext, outPacket2); //3. write packet&#xA;        //Write trailer and free happens later&#xA;    }&#xA;}&#xA;

    &#xA;

  • ffmpeg regenerate m3u8 from multi ts file

    17 juin 2021, par Mulham Aryan

    I have generated hls videos using FFmpeg with output m3u8.&#xA;m3u8 file content

    &#xA;

    #EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:2&#xA;#EXT-X-MEDIA-SEQUENCE:1&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie1.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie2.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie3.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie4.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie5.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie6.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie7.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie8.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie9.ts&#xA;#EXTINF:2.400000,&#xA;ffmpegmovie10.ts&#xA;

    &#xA;

    so let suppose that I'm going to take only files from 1 to 5&#xA;the m3u8 file should be like this

    &#xA;

    #EXTM3U&#xA;    #EXT-X-VERSION:3&#xA;    #EXT-X-TARGETDURATION:2&#xA;    #EXT-X-MEDIA-SEQUENCE:1&#xA;    #EXTINF:2.400000,&#xA;    ffmpegmovie1.ts&#xA;    #EXTINF:2.400000,&#xA;    ffmpegmovie2.ts&#xA;    #EXTINF:2.400000,&#xA;    ffmpegmovie3.ts&#xA;    #EXTINF:2.400000,&#xA;    ffmpegmovie4.ts&#xA;    #EXTINF:2.400000,&#xA;    ffmpegmovie5.ts&#xA;

    &#xA;

    so the question is : is there any command from FFmpeg lets me input multiple ts files and get an output in m3u8 ?&#xA;example

    &#xA;

    ffmpeg -i ffmpegmovie1.ts, ffmpegmovie2.ts, ffmpegmovie3.ts, .... >> output.m3u8&#xA;

    &#xA;

  • Timestamp not printed on thumbnails with FFMPEG

    26 août 2021, par mlatelcom

    I have a script using FFMPEG to generate an image with tiled thumbnails every 45 seconds for several videos on a given folder. The images are named with the name of the video it was generated from. It generates the thumbnails for each video but it does not print the time stamps on them. The path to the font file is correct ; so I don't know where the issue is. I'm using the script in Fedora Linux.

    &#xA;

    Here is the FFMPEG command line code on the script :

    &#xA;

     ffmpeg -ss 00:00:05 -i test.mp4 -loglevel 40 -frames 1 -bt 20M -vf "drawtext=fontfile=/usr/share/fonts/open-sans/OpenSans-Light.ttf:timecode=&#x27;00\\:00\\:00\\:00&#x27;:r=30:fontcolor=white:x=220:y=220:box=1:boxcolor=black@0.5,select=not(mod(n\,1350)),scale=200:150,tile=15x48" -n "${name}.png"&#xA;

    &#xA;

    and this is the console output

    &#xA;

    ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 11 (GCC)&#xA;  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags=&#x27;-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection&#x27; --extra-ldflags=&#x27;-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld &#x27; --extra-cflags=&#x27; -I/usr/include/rav1e&#x27; --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-libsmbclient --enable-version3 --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;[h264 @ 0x56051b4b3cc0] Reinit context to 1280x720, pix_fmt: yuv420p&#xA;[mpegts @ 0x56051b4acc80] max_analyze_duration 5000000 reached at 5000000 microseconds st:0&#xA;Input #0, mpegts, from &#x27;test.mp4&#x27;:&#xA;  Duration: 00:04:57.02, start: 1.400000, bitrate: 2853 kb/s&#xA;  Program 1 &#xA;    Metadata:&#xA;      service_name    : Service01&#xA;      service_provider: FFmpeg&#xA;  Stream #0:0[0x100]: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc&#xA;  Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 96 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> png (native))&#xA;Press [q] to stop, [?] for help&#xA;[h264 @ 0x56051ba69e00] Reinit context to 1280x720, pix_fmt: yuv420p&#xA;[Parsed_scale_2 @ 0x56051b5953c0] w:200 h:150 flags:&#x27;bicubic&#x27; interl:0&#xA;[graph 0 input from stream 0:0 @ 0x56051b725ac0] w:1280 h:720 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:1/1&#xA;[Parsed_scale_2 @ 0x56051b5953c0] w:1280 h:720 fmt:yuv420p sar:1/1 -> w:200 h:150 fmt:rgb24 sar:4/3 flags:0x4&#xA;Output #0, image2, to &#x27;.png&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.76.100&#xA;  Stream #0:0: Video: png, 1 reference frame, rgb24(pc, progressive, left), 3000x7200 (0x0) [SAR 4:3 DAR 5:9], q=2-31, 200 kb/s, 0.04 fps, 0.04 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc58.134.100 png&#xA;No more output streams to write to, finishing.00.00 bitrate=N/A speed=   0x    &#xA;[AVIOContext @ 0x56051b84c8c0] Statistics: 0 seeks, 2 writeouts&#xA;frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:24.00 bitrate=N/A speed=0.47x    &#xA;video:465kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;Input file #0 (test.mp4):&#xA;  Input stream #0:0 (video): 8761 packets read (96159422 bytes); 8760 frames decoded; &#xA;  Input stream #0:1 (audio): 0 packets read (0 bytes); &#xA;  Total: 8761 packets (96159422 bytes) demuxed&#xA;Output file #0 (.png):&#xA;  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (476224 bytes); &#xA;  Total: 1 packets (476224 bytes) muxed&#xA;[AVIOContext @ 0x56051b4b5d00] Statistics: 107090352 bytes read, 18 seeks&#xA;

    &#xA;