Recherche avancée

Médias (91)

Autres articles (111)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9566)

  • ffmpeg creating mpeg-dash chunk files too slowly resulting in 404 errors

    17 juillet 2021, par Danny

    I have a hardware encoder feeding FFmpeg to create a MPEG-DASH Low Latency stream. It works well for a while, but after letting FFmpeg run for a while and reloading the page there are many 404 errors.

    


    When that happens, the dash.js player tries to fetch the segment file on the "live edge" but the file has not been created yet by FFmpeg. For example, after running for 20-30 minutes and loading the web page player, debug code in the web server shows :

    


    2021-07-16 16:46:30.64 : GET REQUEST : /data/ott/chunk-stream0-00702.m4s
2021-07-16 16:46:30.67 : NOT FOUND. Latest files on filesystem:
    chunk-stream0-00699.m4s.tmp
    chunk-stream0-00698.m4s
    chunk-stream0-00697.m4s
    chunk-stream0-00696.m4s
    ...


    


    So you can see the browser requested chunk 702 but the latest on the server is (part of) 699. With 2 second chunks, that is 3-5 seconds of content not yet available.

    


    To analyze, I modified FFmpeg's dashenc.c to add a timestamp every time a file is opened which displays like :

    


    [dash @ 0x9b17c0] 21:48:52.935 1626443332.935  : dashenc_io_open() - opened /data/ott/chunk-stream0-00060.m4s.tmp


    


    And loaded the timestamps into Excel.

    


    Despite a segment duration of 2.000 seconds, the average time between file opens is 2.011 seconds. Over two hours this accumulated to a 45 second difference between the calculated live edge and the latest file on the server.

    


    The HW encoder is set to 25 fps and a GOP size of 5. I've confirmed both by analyzing the H.264 NALUs output by the HW encoder.

    


    My Question : Is this a bug in FFmpeg or can I avoid this problem by adjusting the settings of either the HW encoder and/or FFmpeg options ?

    


    REFERENCE

    


    FFmpeg: Version 4.4 
Centos 8 
Apache 2.4.37


    


    FFmpeg command line (pipe is fed by process reading HW encoder)

    


    ffmpeg -re -loglevel verbose -an -f h264 -i pipe:17 -c:v copy \
-f dash -dash_segment_type mp4 -b:v 1000000 -seg_duration 2.000000 \
-frag_type duration -frag_duration 0.200000 -target_latency 1 \
-window_size 10 -extra_window_size 5 -remove_at_exit 1 -streaming 1 \
-ldash 1 -use_template 1 -use_timeline 0 -write_prft 1 -avioflags direct \
-fflags +nobuffer+flush_packets -format_options movflags=+cmaf \
-utc_timing_url /web/be/time.php /data/ott/master.mpd


    


    Modified dash_io_open() from dashenc.c

    


    static int 
dashenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename, AVDictionary **options)
{
    DASHContext *c = s->priv_data;
    int http_base_proto = filename ? ff_is_http_proto(filename) : 0;
    int err = AVERROR_MUXER_NOT_FOUND;
    if (!*pb || !http_base_proto || !c->http_persistent)
    {
        err = s->io_open(s, pb, filename, AVIO_FLAG_WRITE, options);

        // My Debug
        {
            char buf[20], milli[60];
            struct timeb tp;

            ftime(&tp); // sec + ms
            struct tm *tmInfo = localtime(&tp.time);

            // 2020-05-15 21:15:12.123
            strftime(buf, sizeof(buf), "%H:%M:%S", tmInfo);
            snprintf(milli, 59, "%s.%03d %d.%03d ", buf, tp.millitm, tp.time, tp.millitm);

            av_log(s, AV_LOG_INFO, "%s : dashenc_io_open() - opened %s\n", milli, filename);
        }
    }
    return err;
}


    


  • ffmpeg : nvidia gpu performance sub-optimal

    3 août 2021, par david furst

    the problem seems fairly basic : i'd like to create thumbnails from incoming video in the shortest time possible, and i'm trying to do this by offloading processing to an nvidia gpu.

    


    while i run ffmpeg, i'm monitoring the gpu usage with the nvidia-smi utility. gpu usage never goes above 15% and the amount of time to encode the thumbnails with gpu is only 10% less than the time required without the gpu. these performance levels are very disappointing.

    


    my question : am i going about this the wrong way (and if so, how should i go about it), or is this gpu performance 'normal'/'reasonable' ?

    


    SYSTEM INFORMATION

    


    the machine is a desktop pc running windows 10, 8gb ram, intel i7-7700. the gpu is an nvidia quadro pro 4000 with cuda 11.4 installed. ffmpeg is version N-101372-gb5cb8c8767-g2fc309e699+4 (2021) running under mingw, with --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-libnpp --enable-nvdec and --enable-nvenc.

    


    a typical ffmpeg command line i've used is :

    


     1 ffmpeg -hide_banner \
 2     -init_hw_device cuda=cuda:0 -filter_hw_device cuda \
 3     -hwaccel_output_format cuda \
 4     -i "$infile" \
 5     -vf "hwupload_cuda,scale_npp=w=200:h=150:format=yuv420p:interp_algo=lanczos,fps=1/1,hwdownload,format=yuv420p" \
 6     -y "$outdir/%08d.png"


    


    i've varied the above by supplementing some cuda-related parameters according to posts i've read here on stackoverflow and on the nvidia transcoding guide, but haven't been able to improve performance. adding any of -hwaccel cuda, -hwaccel cuvid, -hwaccel nvenc at the beginning of line 3 results in the error :
Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'

    


    any pointers appreciated.

    


  • flutter-ffmpeg error on mixing audio and picture - Unable to find a suitable output format for 'ffmpeg

    18 juillet 2021, par tylyo

    I'm trying to mix an audio and a picture in order to have a video with the same length of the Audio and as content an image sequence of the source picture.

    


    I tried using the flutter-ffmpeg plugin with the command :

    


    ffmpeg command: ffmpeg -loop 1 -i '/data/user/0/com.attiliopatania.apshare/cache/file_picker/20210402_112326.jpg' -i '/data/user/0/com.attiliopatania.apshare/cache/file_picker/Voice001.m4a' -c:v mpeg4 -tune stillimage -c:a copy -shortest /data/user/0/com.attiliopatania.apshare/app_flutter/out.mp4


    


    some context :

    


    I did the same test with ffmpeg on my pc and it worked as expected. I liked it.

    


    I did some test and I tried to write a file on the same path where the out file should be and It worked as expected : file created

    


    Running the same command through flutter plugin I experienced an error I'm reporting below

    


    ...
I/flutter (14564): Finished splitting the commandline.
I/flutter (14564): Opening an input file: /data/user/0/com.attiliopatania.apshare/cache/file_picker/Voice001.m4a.
I/flutter (14564): [NULL @ 0x731deba400] Opening '/data/user/0/com.attiliopatania.apshare/cache/file_picker/Voice001.m4a' for reading
I/flutter (14564): [file @ 0x72f6059a40] Setting default whitelist 'file,crypto,data'
I/flutter (14564): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x731deba400] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
I/flutter (14564): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x731deba400] ISO: File Type Major Brand: 3gp4
I/flutter (14564): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x731deba400] Unknown dref type 0x206c7275 size 12
I/flutter (14564): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x731deba400] Before avformat_find_stream_info() pos: 112552 bytes read:65747 seeks:1 nb_streams:1
I/flutter (14564): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x731deba400] All info found
I/flutter (14564): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x731deba400] After avformat_find_stream_info() pos: 403 bytes read:98515 seeks:2 frames:1
I/flutter (14564): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.attiliopatania.apshare/cache/file_picker/Voice001.m4a':
I/flutter (14564):   Metadata:
I/flutter (14564):     major_brand     :
I/flutter (14564): 3gp4
I/flutter (14564):
I/flutter (14564):     minor_version   :
I/flutter (14564): 0
I/flutter (14564):
I/flutter (14564):     compatible_brands:
I/flutter (14564): isom3gp4
I/flutter (14564):
I/flutter (14564):     creation_time   :
I/flutter (14564): 2021-03-06T16:02:37.000000Z
I/flutter (14564):
I/flutter (14564):     com.android.version:
I/flutter (14564): 10
I/flutter (14564):
I/flutter (14564):   Duration:
I/flutter (14564): 00:00:04.97
I/flutter (14564): , start:
I/flutter (14564): 0.000000
I/flutter (14564): , bitrate:
I/flutter (14564): 181 kb/s
I/flutter (14564):
I/flutter (14564):     Stream #1:0
I/flutter (14564): (eng)
I/flutter (14564): , 1, 1/44100
I/flutter (14564): : Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s
I/flutter (14564):  (default)
I/flutter (14564):
I/flutter (14564): ffmpeg out 1
I/flutter (14564):     Metadata:
I/flutter (14564):       creation_time   :
I/flutter (14564): 2021-03-06T16:02:37.000000Z
I/flutter (14564):
I/flutter (14564):       handler_name    :
I/flutter (14564): SoundHandle
I/flutter (14564):
I/flutter (14564): Successfully opened the file.
I/flutter (14564): Parsing a group of options: output url ffmpeg.
I/flutter (14564): Successfully parsed a group of options.
I/flutter (14564): Opening an output file: ffmpeg.
I/flutter (14564): [NULL @ 0x7306b86c00] Unable to find a suitable output format for 'ffmpeg'
I/flutter (14564): ffmpeg: Invalid argument