
Recherche avancée
Autres articles (15)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (6449)
-
avfilter/vf_floodfill : finish early if source and destination fill matches
10 octobre 2019, par Paul B Mahol -
doc/APIchanges : fill in missing version for "2013-11-14 - 31c09b7 / 728c465 - lavc...
5 mars 2014, par Michael Niedermayer -
Alsa audio playback program occurs underrun errors frequency
15 juillet 2021, par Tank2006My environment is Raspberry Pi 3B/Raspberry Pi OS, and I'm building remotely from Visual Studio 2019 on Windows 10.


I want to play PCM audio decoded by FFmpeg in ALSA(C language API).
But this code returns Underrun error(EPIPE) at "snd_pcm_writei" and plays a cracky sound.


Probably the way the resources are managed is wrong, but I don't know how to optimize it.


avres AlsaPlayer::OpenOutputDevice(AlsaDeviceType ao_type, OutputMode omode)
{
 memset(&output_format, 0, sizeof(InterfaceFormat));

 avres res;

 string dname = GetAlsaDeviceName(false, (ao_type == AD_DIGITAL));
 res = snd_pcm_open(&play_handle, dname.c_str(), SND_PCM_STREAM_PLAYBACK, 0);

 if (AV_FAILED(res)) return res;

 unsigned int sample_rate = DEFAULT_OUTPUT_RATE;
 uint64_t ch_layout = (ao_type == AD_ANALOG_6CH) ? AV_CH_LAYOUT_5POINT1 : AV_CH_LAYOUT_STEREO;
 int channels = av_get_channel_layout_nb_channels(ch_layout);

 snd_pcm_hw_params_t *hw_params;
 res = snd_pcm_hw_params_malloc(&hw_params);

 snd_pcm_hw_params_any(play_handle, hw_params);

 res = snd_pcm_hw_params_set_access(play_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
 res = snd_pcm_hw_params_set_format(play_handle, hw_params, SND_PCM_FORMAT_S16_LE);
 res = snd_pcm_hw_params_set_channels(play_handle, hw_params, channels);
 res = snd_pcm_hw_params_set_rate_near(play_handle, hw_params, &sample_rate, 0);
 res = snd_pcm_hw_params(play_handle, hw_params);

 snd_pcm_uframes_t frames; 
 snd_pcm_hw_params_get_period_size(hw_params, &frames, 0);
 snd_pcm_hw_params_get_period_time(hw_params, &out_period_time, 0);

 snd_pcm_hw_params_free(hw_params);

 if (AV_FAILED(res)) return res;

 output_format.channels = channels;
 output_format.ch_layout = ch_layout;
 output_format.format = AV_SAMPLE_FMT_S16;
 output_format.frame_size = channels * 16 / 8;
 output_format.mode.output = omode;
 output_format.sample_rate = sample_rate;

 out_period_size = (int)frames * output_format.frame_size;
 out_buf_size = 10 * out_period_size;
 output_fifo = av_fifo_alloc(out_buf_size);

 return res;
}

void AlsaPlayer::RenderThread()
{
 while (av_fifo_size(output_fifo) == 0) usleep(1000);

 avres res;
 int frame_size = (output_format.mode.output == OutputMode::Analog) ? output_format.frame_size : 4;
 uint8_t *dst = new uint8_t[out_buf_size];
 while (need_exit == false) {
 int sz = FFMIN(out_buf_size, av_fifo_size(output_fifo));
 int frames = sz / frame_size;
 if (sz > frame_size) {
 res = av_fifo_generic_read(output_fifo, dst, sz, nullptr);
 res = (int)snd_pcm_writei(play_handle, dst, frames);

 if (AV_FAILED(res)) {
 if (AV_FAILED(snd_pcm_recover(play_handle, res, 0))) {
 need_exit = true;
 SendComErrorMessage(false, res, "dest_device_error");
 break;
 }
 }
 }
 }
 delete[]dst;
}



Can I pick your brains ?