
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (111)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
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 (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (13343)
-
How to get rtmpte video streaming url / how to download rtmpe video streaming [on hold]
22 décembre 2015, par JeanlucaI would like to download a video stream
I try to retrieve the url of this video stream (from jwplayer)
I use Media sniffer to get the url of this video, I get this :
after every 40 seconds I get url : -
Revision 30295 : Amélioration de l’encodage multiple
28 juillet 2009, par kent1@… — LogAmélioration de l’encodage multiple
-
Playing sound from a video using FFmpeg and SDL_QueueAudio results in high pitched audio
26 septembre 2021, par plieblangI'm trying to play audio from an mp4 file using SDL2 and FFmpeg, and using
SDL_QueueAudio
seems much easier than setting up a callback.


All solutions I've found, whether here or in the dranger tutorials, are deprecated or use callbacks. I tried browsing all questions with both the ffmpeg and sdl tags (there aren't many), to no avail. I tried converting the dranger tutorial to use non-deprecated calls but ran into the same problem. I'm using C, FFmpeg 4.1 and SDL 2.0.9.



This is the setup for AVCodecContext and AVCodec :



int audioStream = -1;
 for (i = 0; i < formatContext->nb_streams; i++) {
 if (audioStream < 0 && formatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
 audioStream = i;
 }
 }

 AVCodecParameters *audioParams = formatContext->streams[audioStream]->codecpar;

 AVCodec *audioCodec = avcodec_find_decoder(audioParams->codec_id);

 AVCodecContext *audioCodecCtx = avcodec_alloc_context3(NULL);
 avcodec_open2(audioCodecCtx, audioCodec, NULL);

 SDL_Init(SDL_INIT_AUDIO)

 SDL_AudioSpec desired, obtained;
 SDL_zero(desired);
 SDL_zero(obtained);
 desired.freq = audioCodecCtx->sample_rate;
 desired.format = AUDIO_F32SYS;
 desired.channels = audioCodecCtx->channels;
 desired.silence = 0;
 desired.samples = AUDIO_BUFFER_SIZE;

 SDL_AudioDeviceID audioDevice = SDL_OpenAudioDevice(NULL, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);




This is the main packet decoding loop :



while (av_read_frame(formatContext, &packet) >= 0) {
 if (packet.stream_index == audioStream) {
 if (!avcodec_send_packet(audioCodecCtx, &packet)) {
 avcodec_receive_frame(audioCodecCtx, audioFrame);
 SDL_QueueAudio(audioDevice, audioFrame->data[0], audioFrame->linesize[0]);
 }
 }
 }




The audio plays at the correct speed but at a much higher pitch than what it actually is. I would like it to sound the same as in any media player.

Edit : I just realized the test video has stereo audio but I'm only queueingaudioFrame.data[0]
, which I assume means I'm only playing one channel. I tried queueingaudioFrame.data[1]
which has data as well but it did not solve the problem. Am I correct and if so, how do I play both channels ?