Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (21)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (2866)

  • After ffmpeg encode, AVPacket pts and dts is AV_NOPTS_VALUE

    29 novembre 2017, par Li Zehan

    I would like to ask a question about ffmpeg when i use encoder (x264).

    this is my code :

    int
    FFVideoEncoder::init(AVCodecID codecId, int bitrate, int fps, int gopSize,
                        int width, int height, AVPixelFormat format) {
       release();

       const AVCodec *codec = avcodec_find_encoder(codecId);
       m_pCodecCtx = avcodec_alloc_context3(codec);
       m_pCodecCtx->width = width;
       m_pCodecCtx->height = height;
       m_pCodecCtx->pix_fmt = format;
       m_pCodecCtx->bit_rate = bitrate;
       m_pCodecCtx->thread_count = 5;
       m_pCodecCtx->max_b_frames = 0;
       m_pCodecCtx->gop_size = gopSize;

       m_pCodecCtx->time_base.num = 1;
       m_pCodecCtx->time_base.den = fps;

       //H.264
       if (m_pCodecCtx->codec_id == AV_CODEC_ID_H264) {
    //        av_dict_set(&opts, "preset", "slow", 0);
           av_dict_set(&m_pEncoderOpts, "preset", "superfast", 0);
           av_dict_set(&m_pEncoderOpts, "tune", "zerolatency", 0);

           m_pCodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
           m_pCodecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
       }
       int ret = avcodec_open2(m_pCodecCtx, m_pCodecCtx->codec, &m_pEncoderOpts);
       if (ret == 0) {
           LOGI("open avcodec success!");
       } else {
           LOGE("open avcodec error!");
           return -1;
       }
       return ret;
    }

    int FFVideoEncoder::encode(const Frame &inFrame, AVPacket *outPacket) {
       AVFrame *frame = av_frame_alloc();
    //    avpicture_fill((AVPicture *) frame, inFrame.getData(), AV_PIX_FMT_YUV420P, inFrame.getWidth(),
    //                   inFrame.getHeight());
       av_image_fill_arrays(frame->data, frame->linesize, inFrame.getData(), m_pCodecCtx->pix_fmt,
                            inFrame.getWidth(), inFrame.getHeight(), 1);

       int ret = 0;
       ret = avcodec_send_frame(m_pCodecCtx, frame);
       if (ret != 0) {
           LOGE("send frame error! %s", av_err2str(ret));
       } else {
           ret = avcodec_receive_packet(m_pCodecCtx, outPacket);
           LOGI("extract data size = %d", m_pCodecCtx->extradata_size);
           if (ret != 0) {
               LOGE("receive packet error! %s", av_err2str(ret));
           }
       };
       av_frame_free(&frame);
       return ret;
    }

    I expect that the AVPacket will carry the pts and dts about this frame.

    but in fact, i only can get encoded frame data and size.

    //====================================

    except this question, i have another quesiont :

    x264 docs say that "tune" opts can be set like film、animation and others. but i only can get a normal video when i set "zerolatency" params. When i set others opts, video’s bitrate is very low.

    Thanks your answer.

  • FFMPEG Take 1 second clips each video file from a directory of files, and until total playtime reached

    3 février 2021, par Matthew

    I'm working on a music art video project for a song.

    


    I have a directory that contains approximately 400 individual videos

    


      

    • varying lengths (as short as 3 seconds and as long as 31 minutes)
    • 


    • varying file types (mp4 and webm)
    • 


    • varying resolutions/framerates/bitrates
    • 


    


    The output video should consist of :

    


      

    • 1 second chunks of each video
    • 


    • in round-robin fashion
    • 


    • until all videos are played fully or the output total video length reaches a certain limit (example, 20 minutes).
    • 


    • Output video should be 1280×720 at 24fps, with no preference to bitrate.
    • 


    • Videos that are larger should be scaled down and letterboxed (vertically or horizontally).
    • 


    • Audio is not important at all. The video can be silent. I can overlay audio separately.
    • 


    


    I do not want to loop short videos. In the example below, you can see that, for top-left-view-take-1.mp4, each 'clip' that's taken is incrementally further into the video. In other words, it shouldn't take the same 1 second clip from the beginning. The goal is to get further in to each individual video as the output video progresses.

    


    For example, say my directory contains files such as the following (and, for the example here, we'll say that this is all files in the directory) :

    


    overhead-view-take-1.mp4 (3 seconds, for the sake of the question)
top-right-view-take-1.mp4 (3 seconds, for the sake of the question)
top-right-view-take-2.mp4 (5 seconds, for the sake of the question)
outside-kaleidoscope-1.mp4
yellow-kaleidoscope-1.mp4
red-kaleidoscope-1.mp4
brake-lights-slow-1.mp4
soft-city-lights.webm


    


    Assume anything that isn't marked with a video duration is at least 5 seconds long.

    


    Based on the above files & times, here would be the order and time code of each clip during the first 30 seconds of the output video :

    


    Based on each video's total duration, the output video should include 1 second clips from all videos in the directory.

    


    





    


    


    


    


    


    



    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    Output time Clip time Clip file
    00:00-00:01 00:00-00:01 overhead-view-take-1.mp4
    00:01-00:02 00:00-00:01 top-right-view-take-1.mp4
    00:02-00:03 00:00-00:01 top-right-view-take-2.mp4
    00:03-00:04 00:00-00:01 outside-kaleidoscope-1.mp4
    00:04-00:05 00:00-00:01 yellow-kaleidoscope-1.mp4
    00:05-00:06 00:00-00:01 red-kaleidoscope-1.mp4
    00:06-00:07 00:00-00:01 brake-lights-slow-1.mp4
    00:07-00:08 00:00-00:01 soft-city-lights.webm
    00:08-00:09 00:01-00:02 overhead-view-take-1.mp4
    00:09-00:10 00:01-00:02 top-right-view-take-1.mp4
    00:10-00:11 00:01-00:02 top-right-view-take-2.mp4
    00:11-00:12 00:01-00:02 outside-kaleidoscope-1.mp4
    00:12-00:13 00:01-00:02 yellow-kaleidoscope-1.mp4
    00:13-00:14 00:01-00:02 red-kaleidoscope-1.mp4
    00:14-00:15 00:01-00:02 brake-lights-slow-1.mp4
    00:15-00:16 00:01-00:02 soft-city-lights.webm
    00:16-00:17 00:02-00:03 overhead-view-take-1.mp4
    00:17-00:18 00:02-00:03 top-right-view-take-1.mp4
    00:18-00:19 00:02-00:03 top-right-view-take-2.mp4
    00:19-00:20 00:02-00:03 outside-kaleidoscope-1.mp4
    00:20-00:21 00:02-00:03 yellow-kaleidoscope-1.mp4
    00:21-00:22 00:02-00:03 red-kaleidoscope-1.mp4
    00:22-00:23 00:02-00:03 brake-lights-slow-1.mp4
    00:23-00:24 00:02-00:03 soft-city-lights.webm

    


    


    Now, the output video should include 1 second clips only from videos that still have time remaining. The videos that don't have any time remaining, such as overhead-view-take-1.mp4 and top-right-view-take-1.mp4, are not present here.

    


    





    


    


    


    


    


    



    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    Output time Clip time Clip file
    00:24-00:25 00:03-00:04 top-right-view-take-2.mp4
    00:25-00:26 00:03-00:04 outside-kaleidoscope-1.mp4
    00:26-00:27 00:03-00:04 yellow-kaleidoscope-1.mp4
    00:27-00:28 00:03-00:04 red-kaleidoscope-1.mp4
    00:28-00:29 00:03-00:04 brake-lights-slow-1.mp4
    00:29-00:30 00:03-00:04 soft-city-lights.webm

    


    


    What I've tried

    


      

    • I've read through the docs and cobbled together some code that produces output, but it only seems to work with images ; I can't get the same thing to work with videos (specifically the incremental chunks).
    • 


    • I've tried manipulating commands meant to `create a snapshot every x seconds/frames' but I've hit dead ends there.
    • 


    • I've also started trying to create a text file to run the input from. That's the point where I thought it would make sense to ask here.
    • 


    


    My main issue is picking off incremental chunks of individual videos, and playing those in sequence.

    


    Thoughts ?

    


    Environment details
I have access to Win, Mac, and Linux machines. So, that environment isn't as important to me. Here's ffmpeg's output :

    


    ffmpeg version 4.3.1-0york0~16.04 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609
  configuration: --prefix=/usr --extra-version='0york0~16.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Hyper fast Audio and Video encoder


    


  • Anomalie #3418 : Les tables des plugins ne s’installent pas

    9 mai 2015, par Maïeul Rouquette

    Ma config local

    PHP Version 5.2.17

    System Darwin FTSR22998 12.6.0 Darwin Kernel Version 12.6.0 : Wed Mar 18 16:23:48 PDT 2015 ; root:xnu-2050.48.19 1/RELEASE_X86_64 x86_64
    Build Date Sep 18 2013 13:58:06
    Configure Command ’./configure’ ’—with-mysql=/Applications/MAMP/Library’ ’—with-apxs2=/Applications/MAMP/Library/bin/apxs’ ’—with-gd’ ’—with-jpeg-dir=/Applications/MAMP/Library’ ’—with-png-dir=/Applications/MAMP/Library’ ’—with-zlib’ ’—with-freetype-dir=/Applications/MAMP/Library’ ’—prefix=/Applications/MAMP/bin/php/php5.2.17’ ’—exec-prefix=/Applications/MAMP/bin/php/php5.2.17’ ’—sysconfdir=/Applications/MAMP/bin/php/php5.2.17/conf’ ’—with-soap’ ’—with-config-file-path=/Applications/MAMP/bin/php/php5.2.17/conf’ ’—enable-track-vars’ ’—enable-bcmath’ ’—enable-ftp’ ’—enable-gd-native-ttf’ ’—with-bz2=/usr’ ’—with-ldap’ ’—with-mysqli=/Applications/MAMP/Library/bin/mysql_config’ ’—with-sqlite’ ’—with-ttf’ ’—with-t1lib=/Applications/MAMP/Library’ ’—enable-mbstring=all’ ’—with-curl=/Applications/MAMP/Library’ ’—enable-dbx’ ’—enable-sockets’ ’—enable-bcmath’ ’—with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f’ ’—enable-soap’ ’—with-kerberos’ ’—enable-calendar’ ’—with-pgsql=shared,/Applications/MAMP/Library/pg’ ’—enable-dbase’ ’—enable-exif’ ’—with-libxml-dir=/Applications/MAMP/Library’ ’—with-gettext=shared,/Applications/MAMP/Library’ ’—with-xsl=/Applications/MAMP/Library’ ’—with-pdo-mysql=shared,/Applications/MAMP/Library’ ’—with-pdo-pgsql=shared,/Applications/MAMP/Library/pg’ ’—with-mcrypt=shared,/Applications/MAMP/Library’ ’—with-openssl’ ’—enable-zip’ ’—with-iconv=/Applications/MAMP/Library’
    Server API Apache 2.0 Handler
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /Applications/MAMP/bin/php/php5.2.17/conf
    Loaded Configuration File /Applications/MAMP/bin/php/php5.2.17/conf/php.ini
    Scan this dir for additional .ini files (none)
    additional .ini files parsed (none)
    PHP API 20041225
    PHP Extension 20060613
    Zend Extension 220060519
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    IPv6 Support enabled
    Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, data, http, ftp, zip
    Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
    Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed

    Mon test
    1) spip 3.1 svn 22109
    2) pas de plugins/auto mais le flux déclaré
    3) plugin tickets mis manuellement dans plugins
    4) j’active le plugin. Il se "préactive" en entendance les dépendances
    5) lorsque j’installe saisies, le plugin tickets peut bien s’activer
    6) mais les tables n’ont pas été installées