Recherche avancée

Médias (1)

Mot : - Tags -/blender

Autres articles (112)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

Sur d’autres sites (7346)

  • Converting bat to bash script [on hold]

    15 juillet 2019, par dezxela

    Please help me with coversion this script from here to bash :
    https://stackoverflow.com/a/38291960/11786146

    This part of the code seems to be reconciled in me, but I’m not sure that it’s correct :

    #  path to ffmpeg
    export  ffmpeg='/home/user/bin'
    #  source movies from
    export  movieSource='/mnt/dev1/radio/Masha'
    #  tmp dir
    export  tmpDir='/mnt/dev1/radio/Masha'


    #  setup positon, color, background, font for the text overlays
    #  filterComplex, quotes have to be escaped! -> \"
    #  BITC - Burned In Time Code
    export  filterComplexTimecode='drawtext=fontfile='/usr/share/fonts/truetype/freefont/FreeSerif.ttf': timecode='10\:00\:00\:00': timecode_rate=24: x=(w-tw)/2: y=h-(1*lh)-3: fontsize=20: fontcolor=white@0.4: box=1: boxcolor=0x00000000@0.4: boxborderw=4'
    #  Date
    export  filterComplexDate='drawtext=fontfile='/usr/share/fonts/truetype/freefont/FreeSerif.ttf': text='%{localtime\:%X}': x=(w-tw-3): y=h-(1*lh)-3: fontsize=20: fontcolor=white@0.4: box=1: boxcolor=0x00000000@0.4: boxborderw=4'
    #  Shotname
    export  filterComplexShotname='drawtext=fontfile='/usr/share/fonts/truetype/freefont/FreeSerif.ttf': x=0: y=h-(1*lh)+1: fontsize=20: fontcolor=white@0.4: box=1: boxcolor=0x00000000@0.4: boxborderw=4:'

    #  create a list of all files
    find "$movieSource" -name "*.mp4" -type f | sort -R | while read j; do echo "file '$j'" >> $tmpDir/filelist.txt; done

    echo filename, durationInSeconds > $tmpDir/fileNameDuration.txt
    for file in $movieSource/*.mp4; do
     #  Reset current duration to 0 (zero) for each loop
     export  curDuration=0
     #  get the filename without file extenion
     export  fileName=${file##*/}
     #  get the duration of a single clip
     #  and write it to a tmp textfile
     $ffmpeg/ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$file" > $tmpDir/fileTempDuration.txt
     #  read the textfile again into a variable
    read -p  < $tmpDir/fileTempDuration.txt last curDuration

     #  write the filename and the duration to a new list of all files
    echo $fileName,$curDuration >> $tmpDir/fileNameDuration.txt ;done

    #  concate a filter complex string for ffmpeg with all clipnames as textlayer with a inpoint and outpoint
    export  filterComplexShotnameCombined=
    #  floating numbers are not supported by batch, so we need to work-around that
    source  :IntAsFP b=0.000000
    for i in $tmpDir/fileNameDuration.txt; do
     source  :IntAsFP a=$j
     source  :IntToFP inPoint=$b 6
     export  c=$(expr a + b)
     export   b=c
     source  :IntToFP outPoint=$c 6
     #  just to check whats going on...
     echo name: $i   duration: $j   inPoint: $inPoint   outPoint: $outPoint
     export  filterComplexShotnameCombined='$filterComplexShotnameCombined, $filterComplexShotname text=$i: enable=between(t\,$inPoint\,$outPoint^^^)';done
  • discord.py - FFmpegPCMAudio using a lot of CPU

    7 août 2020, par Cyxo

    I made a Discord bot using the discord.py library which aims at playing a web radio in several voice channels. Basically it's the same audio stream for every channel.

    


    What I'm doing right now is :

    


    voice_channel.play(discord.FFmpegPCMAudio(stream_url))


    


    However every FFmpegPCMAudio uses about 10% of my CPU and there's one for each vc so eventually my bot crashed a lot when playing in 10 channels (which isn't a lot).

    


    Since it's the same stream, I tried the following :

    


    player = FFmpegPCMAudio(stream_url)
for voice_channel in vcs:
    voice_channel.play(player)


    


    But the sound was stuttering a lot (maybe it was playing the sound a bit to each sequentially like the way threading works)

    


    Can you think of any other way I could reduce the load on the CPU since it is the same audio stream playing ? Either a discord.py trick or a FFmpeg trick maybe, like manually running one FFmpeg and using it for each channel ?

    


  • Can I stream live audio with libav ?

    22 juin 2021, par szymek349

    I'm trying to code simple internet radio streaming app in C using libav/ffmpeg, however the only thing I can do is open the url and download packets. When I send it to alsa soundcard I get noise and statics for a second and then alsa buffer xrun.

    


    I was trying to decode the packets into frames and they seemed ok.

    


    I had seen https://gavv.github.io/articles/decode-play/ , https://www.ffmpeg.org/doxygen/3.2/group__lavf__encoding.html#details , https://github.com/leandromoreira/ffmpeg-libav-tutorial and many pages on https://ffmpeg.org/doxygen/trunk/index.html but I can't found anything that helps or looks similar to my problem.

    


    Thanks for all comments.

    


    Here is my code :

    


    //gcc -o radio radio.c -lavformat -lavcodec -lswresample -lavutil -lavdevice -lm&#xA;&#xA;#include &#xA;#include &#xA;#include <libavutil></libavutil>avassert.h>&#xA;#include <libavutil></libavutil>channel_layout.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>mathematics.h>&#xA;#include <libavutil></libavutil>timestamp.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include <libswresample></libswresample>swresample.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavdevice></libavdevice>avdevice.h>&#xA;&#xA;void dumpParameters(AVCodecParameters *codecParam){&#xA;    printf("Codec type: %d\nCodec id: %d\nSample format: %d\nChannel layout: %ld\nChannels: %d\nSample rate: %d\nFrame size: %d\n",&#xA;    codecParam->codec_type,&#xA;    codecParam->codec_id,&#xA;    codecParam->format,&#xA;    codecParam->channel_layout,&#xA;    codecParam->channels,&#xA;    codecParam->sample_rate,&#xA;    codecParam->frame_size);&#xA;}&#xA;&#xA;int main(){&#xA;    const char* nowy_swiat = "http://stream.rcs.revma.com/ypqt40u0x1zuv";&#xA;    int ret = -1;&#xA;    int inputStream = 0;&#xA;&#xA;    AVFormatContext *iFormatContext = avformat_alloc_context();&#xA;    &#xA;    if(avformat_open_input(&amp;iFormatContext,nowy_swiat,NULL,NULL)&lt;0){&#xA;        printf("av_open_input\n");&#xA;        exit(1);&#xA;    }&#xA;    if(avformat_find_stream_info(iFormatContext,NULL)&lt;0){&#xA;        printf("cannot find stream info\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    AVCodecParameters *iCodecParameters = avcodec_parameters_alloc();&#xA;    while(iFormatContext->streams[inputStream]->codecpar->codec_type!=AVMEDIA_TYPE_AUDIO)inputStream&#x2B;&#x2B;;&#xA;    iCodecParameters = iFormatContext->streams[inputStream]->codecpar;&#xA;&#xA;    AVCodec *iCodec = avcodec_find_decoder(iCodecParameters->codec_id);&#xA;    if(iCodec==NULL){&#xA;        printf("cannot find codec\n");&#xA;        exit(0);&#xA;    }&#xA;&#xA;    AVCodecContext *iCodecContext = avcodec_alloc_context3(iCodec);&#xA;    ret = avcodec_parameters_to_context(iCodecContext,iCodecParameters);&#xA;    if(ret&lt;0){&#xA;        printf("Can&#x27;t copy parameters to context\n");&#xA;        exit(0);&#xA;    }&#xA;&#xA;    if(avcodec_open2(iCodecContext,iCodec,NULL)&lt;0){&#xA;        printf("cannot initialize\n");&#xA;        exit(0);&#xA;    }  &#xA;&#xA;    AVPacket *packet = av_packet_alloc();&#xA;&#xA;    AVFrame *frame = av_frame_alloc();&#xA;&#xA;    //--------------------------------------------------------------------------------&#xA;&#xA;    avdevice_register_all();&#xA;&#xA;    AVOutputFormat *output = av_guess_format("alsa",NULL,NULL);&#xA;    output->flags = AVFMT_ALLOW_FLUSH;&#xA;&#xA;    AVFormatContext *outputFormatContext;&#xA;    avformat_alloc_output_context2(&amp;outputFormatContext,output,NULL,NULL);&#xA;    //outputFormatContext->oformat = output;&#xA;    outputFormatContext->flags = AVFMT_NOFILE;&#xA;    outputFormatContext->audio_codec_id = 86017;&#xA;&#xA;    AVStream *stream = avformat_new_stream(outputFormatContext,NULL);&#xA;&#xA;    AVCodecParameters *oCodecParameters = avcodec_parameters_alloc();&#xA;    oCodecParameters->format = AV_SAMPLE_FMT_FLTP;&#xA;    oCodecParameters->codec_type = AVMEDIA_TYPE_AUDIO;&#xA;    oCodecParameters->sample_rate = 44100;&#xA;    oCodecParameters->channels = 2;&#xA;    oCodecParameters->channel_layout = AV_CH_LAYOUT_STEREO; &#xA;    oCodecParameters->bit_rate = 64000;&#xA;&#xA;    stream->codecpar = oCodecParameters;&#xA;&#xA;    if(avformat_write_header(outputFormatContext,NULL)&lt;0){&#xA;         dumpParameters(stream->codecpar);&#xA;         printf("avformat_write_header\n");&#xA;         exit(0);&#xA;    }&#xA;&#xA;    while(1){&#xA;&#xA;        if(av_read_frame(iFormatContext,packet)&lt;0){&#xA;            printf("av_read_frame\n");&#xA;            exit(1);&#xA;        }&#xA;&#xA;        if(packet->stream_index==inputStream){&#xA;            printf("pts: %ld\ndts: %ld\nduration: %ld\nstream index: %d\nsize: %d\npos: %ld\n",packet->pts,&#xA;                                                                                                    packet->dts,&#xA;                                                                                                    packet->duration,&#xA;                                                                                                    packet->stream_index,&#xA;                                                                                                    packet->size,&#xA;                                                                                                    packet->pos);&#xA;            //printf("Name: %s\nLong name: %s\n\n",output->name,output->long_name);&#xA;            if(av_interleaved_write_frame(outputFormatContext,packet)&lt;0){&#xA;                printf("av_write_frame()\n");&#xA;                exit(0);&#xA;            }&#xA;&#xA;        }&#xA;        av_packet_unref(packet);&#xA;    }&#xA;    &#xA;}&#xA;

    &#xA;