
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (67)
-
Use, discuss, criticize
13 avril 2011, parTalk 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. -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (10597)
-
Reading a File while it is being written by FFMPEG
29 mai 2014, par Haris TasawarAs the title suggests, i am in the process of creating a client/server application where the server(PHP) reads a file which is being written on by ffmpeg and then outputs it to the client(JAVA). I have succeeded in writing the server script in php which initiates the ffmpeg and then after a while starts to read the file and concurrently sends it to the JAVA client, the problem is that after a while the client stops to receive any sort of data and then just quits, For example if i have a 5MB file, it would read only 12KB and then it quits. Could someone tell what can be the issue here ? Is it on the server side or on the client side.
For References i am attaching both the reading of file code in php and the client side code.Code For Reading the file while FFMPEG converts the file(PHP) :
$file = 'D:\\'.$destination;
$fp = @fopen($file, 'r');
//ob_end_clean();
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header("Cache-control: private");
header('Pragma: private');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header('Content-Length: ' . filesize($file));
$buffer = 4096;
while(!feof($fp)) {
usleep(300000);
echo fread($fp, $buffer);
ob_flush();
flush();
}
fclose($fp);
exit();Code For reading the File transferred by PHP (JAVA) :
URL u = new URL(streamURL);
clientSocket = (HttpURLConnection) u.openConnection();
if( clientSocket.getResponseCode() == HttpURLConnection.HTTP_OK ){
//clientSocket.setReadTimeout(0);
inRemoteStream = clientSocket.getInputStream();
while (((count = inRemoteStream.read(buf)) != -1)) {
offset += count;
System.out.println(offset);
fileOutputStream.write(buf, 0, count);
setVideoOffset(offset, contentLength);
}I`ll be very happy if someone can solve this problem for me :) .
-
What is the best jpeg encoder/decoder ? [on hold]
27 mai 2014, par user3678446So I made a server and I was playing with data transfer. And i wanted to make a program like TeamViewer(just for fun not planning to achieve teamViewer performance). And I was sending png screenshots. After a few tests I realized that png encoding takes way too long.
So i decided to change all that part to jpeg. And I would want to know what is the best library to use. I heard in some other question that libavcodec in the ffmpeg project is really good. It seems pretty complicated especially cause I don’t have a source of learning it and I will try to learn it no my own. And I don’t want to put that much effort(if it’s that much effort) to learn it when i could learn the best one.So the question is what is the best library for jpeg encoding and decoding. Or maybe if it’s there something better for something like teamviewer let me know.
-
why the output of mp3 decode sounds so delayed ?(with ffmpeg mp3lame lib)
11 mars 2014, par user3401739i'm recording sound and encoding to mp3 with ffmpeg lib. then decode the mp3 data right away, play the decode data, but it's sounds so delayed.
here are the codes :
the function encode first parameter accepts the raw pcm data, len = 44100.encode parameters :
cntx_->channels = 1;
cntx_->sample_rate = 44100;
cntx_->sample_fmt = 6;
cntx_->channel_layout = AV_CH_LAYOUT_MONO;
cntx_->bit_rate = 8000;
err_ = avcodec_open2(cntx_, codec_, NULL);
vector<unsigned char="char"> encode(unsigned char* encode_data, unsigned int len)
{
vector<unsigned char="char"> ret;
AVPacket avpkt;
av_init_packet(&avpkt);
unsigned int len_encoded = 0;
int data_left = len / 2;
int miss_c = 0, i = 0;
while (data_left > 0)
{
int sz = data_left > cntx_->frame_size ? cntx_->frame_size : data_left;
mp3_frame_->nb_samples = sz;
mp3_frame_->format = cntx_->sample_fmt;
mp3_frame_->channel_layout = cntx_->channel_layout;
int needed_size = av_samples_get_buffer_size(NULL, 1,
mp3_frame_->nb_samples, cntx_->sample_fmt, 1);
int r = avcodec_fill_audio_frame(mp3_frame_, 1, cntx_->sample_fmt, encode_data + len_encoded, needed_size, 0);
int gotted = -1;
r = avcodec_encode_audio2(cntx_, &avpkt, mp3_frame_, &gotted);
if (gotted){
i++;
ret.insert(ret.end(), avpkt.data, avpkt.data + avpkt.size);
}
else if (gotted == 0){
miss_c++;
}
len_encoded += needed_size;
data_left -= sz;
av_free_packet(&avpkt);
}
return ret;
}
std::vector<unsigned char="char"> decode(unsigned char* data, unsigned int len)
{
std::vector<unsigned char="char"> ret;
AVPacket avpkt;
av_init_packet(&avpkt);
avpkt.data = data;
avpkt.size = len;
AVFrame* pframe = av_frame_alloc();
while (avpkt.size > 0){
int goted = -1;av_frame_unref(pframe);
int used = avcodec_decode_audio4(cntx_, pframe, &goted, &avpkt);
if (goted){
ret.insert(ret.end(), pframe->data[0], pframe->data[0] + pframe->linesize[0]);
avpkt.data += used;
avpkt.size -= used;
avpkt.dts = avpkt.pts = AV_NOPTS_VALUE;
}
else if (goted == 0){
avpkt.data += used;
avpkt.size -= used;
avpkt.dts = avpkt.pts = AV_NOPTS_VALUE;
}
else if(goted < 0){
break;
}
}
av_frame_free(&pframe);
return ret;
}
</unsigned></unsigned></unsigned></unsigned>Suppose it's the 100th call to encode(data, len), this "frame" would appear in 150th or later in the decode call, the latency is not acceptable. It seems the mp3lame encoder would keep the sample data for later use, but not my desire.
I don't know what is going wrong. Thank you for any information.today i debug the code again and post some detail :
encode : each pcm sample frame len = 23040 ,which is 10 times of mp3 frame size, each time call encode only output 9 frames, this output cause decode output 20736 samples, 1 frame(2304 bytes) is lost, and the sound is noisy.
if the mp3 or mp2 encode is not suitable for real time voice transfer, which encoder should i choose ?