Recherche avancée

Médias (91)

Autres articles (48)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8032)

  • FFmpeg what is the correct way to manually write silence through pipe:0 ?

    19 juillet 2023, par Bohdan Petrenko

    I have an ffmpeg process running with this parameters :

    


    ffmpeg -y -f s16le -ac {Channels} -ar 48000 -re -use_wallclock_as_timestamps true -i pipe:0 -f segment -segment_time {_segmentSize} -segment_list \"{_segmentListPath}\" -segment_format mp3 -segment_wrap 2 -reset_timestamps 0 -af aresample=async=1 \"{_filePath}\"


    


    I also have a DateTimeOffsetwhich represents the time when the recording was started. When an FFMpeg process is created, I need to add some some amount of silence that equals to the delay between current time and when the recording was started. This delay may be bigger than ffmpeg segments, so I calculate it relatively to the time when last ffmpeg segment should begin.
I store silence in a static byte array with length of two ffmpeg segments :

    


    _silenceBuffer ??= new byte[_segmentSize * 2 * Channels * SampleRate * 2];


    


    I tried two ways of writing silence :

    


    First code I tried is this :

    


    var delay = DateTimeOffset.UtcNow - RecordingStartDateTime;

var time = CalculateRelativeMilliseconds(delay.TotalMilliseconds); // this returns time based on current segment. It works fine.

var amount = (int)(time * 2 * Channels * SampleRate / 1000);

WriterStream.Write(_silenceBuffer, 0, amount);


    


    As the result, I have a very loud noise everywhere in output from ffmpeg. It brokes audio, so this way doesn't work for me.

    


    Second code I tried is this :

    


    var delay = DateTimeOffset.UtcNow - RecordingStartDateTime;

var time = CalculateRelativeMilliseconds(delay.TotalMilliseconds); // this returns time based on current segment. It works fine.

var amount = (int)time * 2 * Channels * SampleRate / 1000;

WriterStream.Write(_silenceBuffer, 0, amount);


    


    Difference between first and second code is that now I cast only time to int type, not the result of the whole expression. But it also doesn't work. This time at the beginning I have no silence I wrote, the recording begins with voice data I piped after writing silence. But if I use this ffmpeg command :

    


    ffmpeg -y -f s16le -ac {Channels} -ar 48000 -i pipe:0 -f segment -segment_time {_segmentSize} -segment_list \"{_segmentListPath}\" -segment_format mp3 -segment_wrap 2 -reset_timestamps 0 \"{_filePath}\"


    


    Then it works as expected. Recording begins with silence what I need, and then goes voice data I piped.

    


    So, how can I manually calculate and write silence to my ffmpeg instance ? Is there some universal way of writing and calculating silence that will work with any ffmpeg command ? I don`t want to use filters and other ffmpeg instances for offsetting piped voice data, because I do it only once per session. I think that I can write silence with byte arrays. I look forward to any suggestions.

    


  • Conditional expressions not working in ffmpeg ?

    22 novembre 2019, par Don Clifton

    I’m having trouble with conditional expressions generating errors in ffmpeg. Here is an example of the problem, which is taken from the ffmpeg documentation for the blend filter :

    ffmpeg -i lyt1s.mp4 -i lyt1r.mp4 -filter_complex \
       'blend=all_expr=if(eq(mod(X,2),mod(Y,2)),A,B)' lytx.mp

    The following output is generated :

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
    built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
    configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads         --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect``
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'lyt1s.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.56.101
     Duration: 00:00:40.04, start: 0.000000, bitrate: 4337 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 4202 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'lyt1r.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.56.101
     Duration: 00:00:40.04, start: 0.000000, bitrate: 2410 kb/s
       Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2275 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
     handler_name    : SoundHandler
    [AVFilterGraph @ 0x7fc7f1d0a6a0] No such filter: '2)'
    Error initializing complex filters.
    Invalid argument

    If I replace the all_expr argument to something that doesn’t include a conditional expression (such as A*0.5+B*0.5) the blend filter does what it’s supposed to, without any errors.

    Can anyone tell me what’s going on here ?

  • Conditional expressions not working in ffmpeg ?

    8 avril 2017, par Don Clifton

    I’m having trouble with conditional expressions generating errors in ffmpeg. Here is an example of the problem, which is taken from the ffmpeg documentation for the blend filter :

    ffmpeg -i lyt1s.mp4 -i lyt1r.mp4 -filter_complex \
       'blend=all_expr=if(eq(mod(X,2),mod(Y,2)),A,B)' lytx.mp

    The following output is generated :

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
    built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
    configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads         --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect``
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'lyt1s.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.56.101
     Duration: 00:00:40.04, start: 0.000000, bitrate: 4337 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 4202 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'lyt1r.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.56.101
     Duration: 00:00:40.04, start: 0.000000, bitrate: 2410 kb/s
       Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2275 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
     handler_name    : SoundHandler
    [AVFilterGraph @ 0x7fc7f1d0a6a0] No such filter: '2)'
    Error initializing complex filters.
    Invalid argument

    If I replace the all_expr argument to something that doesn’t include a conditional expression (such as A*0.5+B*0.5) the blend filter does what it’s supposed to, without any errors.

    Can anyone tell me what’s going on here ?