
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (112)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccé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, parLa 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, parMediaSPIP 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 dezxelaPlease help me with coversion this script from here to bash :
https://stackoverflow.com/a/38291960/11786146This 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 CyxoI 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 szymek349I'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

#include 
#include 
#include <libavutil></libavutil>avassert.h>
#include <libavutil></libavutil>channel_layout.h>
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>mathematics.h>
#include <libavutil></libavutil>timestamp.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>
#include <libswresample></libswresample>swresample.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libavdevice></libavdevice>avdevice.h>

void dumpParameters(AVCodecParameters *codecParam){
 printf("Codec type: %d\nCodec id: %d\nSample format: %d\nChannel layout: %ld\nChannels: %d\nSample rate: %d\nFrame size: %d\n",
 codecParam->codec_type,
 codecParam->codec_id,
 codecParam->format,
 codecParam->channel_layout,
 codecParam->channels,
 codecParam->sample_rate,
 codecParam->frame_size);
}

int main(){
 const char* nowy_swiat = "http://stream.rcs.revma.com/ypqt40u0x1zuv";
 int ret = -1;
 int inputStream = 0;

 AVFormatContext *iFormatContext = avformat_alloc_context();
 
 if(avformat_open_input(&iFormatContext,nowy_swiat,NULL,NULL)<0){
 printf("av_open_input\n");
 exit(1);
 }
 if(avformat_find_stream_info(iFormatContext,NULL)<0){
 printf("cannot find stream info\n");
 exit(1);
 }

 AVCodecParameters *iCodecParameters = avcodec_parameters_alloc();
 while(iFormatContext->streams[inputStream]->codecpar->codec_type!=AVMEDIA_TYPE_AUDIO)inputStream++;
 iCodecParameters = iFormatContext->streams[inputStream]->codecpar;

 AVCodec *iCodec = avcodec_find_decoder(iCodecParameters->codec_id);
 if(iCodec==NULL){
 printf("cannot find codec\n");
 exit(0);
 }

 AVCodecContext *iCodecContext = avcodec_alloc_context3(iCodec);
 ret = avcodec_parameters_to_context(iCodecContext,iCodecParameters);
 if(ret<0){
 printf("Can't copy parameters to context\n");
 exit(0);
 }

 if(avcodec_open2(iCodecContext,iCodec,NULL)<0){
 printf("cannot initialize\n");
 exit(0);
 } 

 AVPacket *packet = av_packet_alloc();

 AVFrame *frame = av_frame_alloc();

 //--------------------------------------------------------------------------------

 avdevice_register_all();

 AVOutputFormat *output = av_guess_format("alsa",NULL,NULL);
 output->flags = AVFMT_ALLOW_FLUSH;

 AVFormatContext *outputFormatContext;
 avformat_alloc_output_context2(&outputFormatContext,output,NULL,NULL);
 //outputFormatContext->oformat = output;
 outputFormatContext->flags = AVFMT_NOFILE;
 outputFormatContext->audio_codec_id = 86017;

 AVStream *stream = avformat_new_stream(outputFormatContext,NULL);

 AVCodecParameters *oCodecParameters = avcodec_parameters_alloc();
 oCodecParameters->format = AV_SAMPLE_FMT_FLTP;
 oCodecParameters->codec_type = AVMEDIA_TYPE_AUDIO;
 oCodecParameters->sample_rate = 44100;
 oCodecParameters->channels = 2;
 oCodecParameters->channel_layout = AV_CH_LAYOUT_STEREO; 
 oCodecParameters->bit_rate = 64000;

 stream->codecpar = oCodecParameters;

 if(avformat_write_header(outputFormatContext,NULL)<0){
 dumpParameters(stream->codecpar);
 printf("avformat_write_header\n");
 exit(0);
 }

 while(1){

 if(av_read_frame(iFormatContext,packet)<0){
 printf("av_read_frame\n");
 exit(1);
 }

 if(packet->stream_index==inputStream){
 printf("pts: %ld\ndts: %ld\nduration: %ld\nstream index: %d\nsize: %d\npos: %ld\n",packet->pts,
 packet->dts,
 packet->duration,
 packet->stream_index,
 packet->size,
 packet->pos);
 //printf("Name: %s\nLong name: %s\n\n",output->name,output->long_name);
 if(av_interleaved_write_frame(outputFormatContext,packet)<0){
 printf("av_write_frame()\n");
 exit(0);
 }

 }
 av_packet_unref(packet);
 }
 
}