
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (66)
-
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 ;
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)
Sur d’autres sites (5701)
-
What should I do to handle audio&video in a radio automation software ?
24 avril 2023, par TheDaChickenI am currently working on a program that can be deemed as a "radio automation software."
Radio automation software focuses on audio. It may split audio frames and crossfade between different audio sources.


I want to continue by adding video support for music videos. This makes it not completely about audio.


There is a problem with this. Having audio porition do it's thing while video can be added along side it is difficult. For example, having access to the previous track to be able to crossfade & preloading the song.


This is what I currently have which is being run in a thread.


int ret;
int tryCounter{0};
int64_t end_pts{AV_NOPTS_VALUE};
int64_t end_duration{AV_NOPTS_VALUE};
while(true) {
 std::shared_ptr<cmessage> message;

 ret = queue.Get(message, MessageQueue::MessageQueueFlags::MSQ_NON_BLOCK);
 if (ret < 0) {
 if(ret == MessageQueue::MessageQueueRET::MSQ_STOPPED)
 break;
 Logger::Log(LOGWARNING, "Playback thread received: {}", ret);
 break;
 }

 if (ret == MessageQueue::MessageQueueRET::MSQ_OK && message) {
 if (message->IsType(CMessage::PLAY_SONG)) {
 /* It was requested for the Player to play a new song */
 std::shared_ptr<cmessageplaysong> songMsg = std::static_pointer_cast<cmessageplaysong>(message);
 // steal session :D
 std::unique_ptr<playersession> playerSession = std::move(songMsg->GetSession());
 if (!playerSession->GetTrack()) {
 Logger::Log(LOGWARNING, "PlaybackThread: Ignoring playback song event due to null track");
 goto SEND_NEXT_SONG;
 }
 if(!playerSession->GetPlaylist())
 playerSession->SetPlaylist(m_player->GetPlaylist());
 if (playerSession->IsPreloaded())
 Logger::Log(LOGDEBUG, "PlaybackThread: Received preloaded track.");

 // load track if not loaded already
 if (!playerSession->Open(playerSession->GetTrack(),
 m_info)) {
 Logger::Log(LOGERROR, "Failed to open input");
 goto SEND_NEXT_SONG;
 }

 preloadRequestSent = false;
 m_nextSession = nullptr;

 std::shared_ptr<track> track = playerSession->GetTrack();
 track->start_sample = m_player->GetMainOutput()->GetWrittenSamples();
 track->played = true;
 // Send current song position to callback thread for the callback function to be run when song starts playing
 m_player->SendSongPosition(playerSession->GetTrack(), playerSession->GetPlaylist(),
 playerSession->GetTrackPosition());

 // Grab the old one
 std::unique_ptr<playersession> oldSession = std::move(m_currentSession);
 // Set current audio instance to this input
 m_currentSession.swap(playerSession);

 // Crossfade :D
 ret = CrossFade(oldSession, m_currentSession);
 if (ret == STREAM_MAX) {
 // when the new song goes brrrrr.
 // this rarely happens anyway SOO
 m_currentSession.swap(oldSession);
 goto SEND_NEXT_SONG;
 }

 end_pts = AV_NOPTS_VALUE;
 end_duration = m_currentSession->GetDuration();
 if(m_currentSession->GetTrack()->info.segue_time != AV_NOPTS_VALUE)
 {
 end_duration = m_currentSession->GetTrack()->info.segue_time;
 // this is end duration for max samples :D
 // this variable is dependent on timebase
 end_pts = av_rescale_q(end_duration, CPPAV_TIME_BASE_Q, m_currentSession->GetTimeBase());
 }
 }
 if (message->IsType(CMessage::NEXT_SONG)) {
 /* request for the thread to play song next */
 std::shared_ptr<cmessagenextsong> messageNextSong = std::static_pointer_cast<cmessagenextsong>(message);
 // steal session :D
 m_nextSession = std::move(messageNextSong->GetSession());
 }
 }

 if (!m_currentSession) {
 /* wait until there is a track that can be played */
 /* during this, portaudio should not be opened */
 m_player->GetMainOutput()->OpenPlayback(false);
 std::this_thread::sleep_for(std::chrono::milliseconds(50));
 continue;
 }
 /* there is input so output should be active */
 if (!m_player->GetMainOutput()->IsActive()) {
 m_player->GetMainOutput()->OpenPlayback(true);
 }

 ret = m_currentSession->Decode(m_frame, end_pts);
 if (ret == STREAM_WAIT) {
 continue;
 } else if (ret == STREAM_EOF || ret == STREAM_MAX) {
 SEND_NEXT_SONG:
 if(m_player->GetCurrentTrack())
 m_player->GetCurrentTrack()->end_sample = m_player->GetMainOutput()->GetWrittenSamples();
 // Wait until the next song is in the queue for playback
 QueueNextSong(false);
 continue;
 }
 else if (ret == STREAM_ERROR) { // check & handle errors
 tryCounter++;
 Logger::Log(LOGERROR, "Decoder replied: Error try counter: {}/{}",
 tryCounter, MAX_ERROR_COUNTER);
 if (tryCounter >= MAX_ERROR_COUNTER) {
 goto SEND_NEXT_SONG;
 }
 continue;
 }
 tryCounter = 0;

 int64_t timestamp = 0;
 if (m_frame->GetPTS() != AV_NOPTS_VALUE) // must convert timestamp to static time base :D makes things easier
 timestamp = av_rescale_q(m_frame->GetPTS(), m_frame->GetTimeBase(), CPPAV_TIME_BASE_Q);

 // Check if track is about to end to preload next track
 // TODO make 3 changeable for preloading :)))
 if (!preloadRequestSent && timestamp >= end_duration - (3 * AV_TIME_BASE)) {
 Logger::Log(LOGDEBUG, "Sending next track to preload thread");
 if (QueueNextSong(true))
 preloadRequestSent = true;
 }

 // Write frame into ringbuffer
 ret = m_player->WriteFrame(m_frame);
 assert(ret != STREAM_EOF);
 // Clean out frame :)
 m_frame->Reset();
 }
</cmessagenextsong></cmessagenextsong></playersession></track></playersession></cmessageplaysong></cmessageplaysong></cmessage>


It seems awkward already. I have a huge amount of code for preparing the song. I have to keep track of the end duration and the next song. I have to keep track of the playlist. I am using PlayerSession to grab audio frames, handle all audio packet decoding, resampling to a constant sample rate. I don't think that is going to be viable to keep.


-
lavu/opencl : replace va_ext.h with standard name
23 novembre 2018, par Ruiling Songlavu/opencl : replace va_ext.h with standard name
Khronos OpenCL header (https://github.com/KhronosGroup/OpenCL-Headers)
uses cl_va_api_media_sharing_intel.h. And Intel's official OpenCL driver
for Intel GPU (https://github.com/intel/compute-runtime) was compiled
against Khronos OpenCL header. So it's better to align with Khronos.Signed-off-by : Ruiling Song <ruiling.song@intel.com>
-
TypeError : 'FFmpegOpusAudio' object is not subscriptable
12 octobre 2022, par Virat ChauhanI am getting this error whenever I try to get the bot to play a song in vc :


await ctx.send('Now playing ' + '**' + str(queues[ctx.message.guild.id]['title'][0]) + '**')
TypeError: 'FFmpegOpusAudio' object is not subscriptable



Here is the relevant code :


async def playSong(self, ctx, url):
 queues[ctx.message.guild.id]['title'] = []
 with youtube_dl.YoutubeDL(self.YDL_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 if 'entries' in info: # if no url is input
 url2 = info['entries'][0]['formats'][0]['url']
 queues[ctx.message.guild.id]['title'].append(info['entries'][0]['title'])
 elif 'formats' in info: # if url is passed
 url2 = info['formats'][0]['url']
 queues[ctx.message.guild.id]['title'].append(info['title'])
 #print(queues[ctx.message.guild.id]['title'][0])
 stream = await discord.FFmpegOpusAudio.from_probe(url2, **self.FFMPEG_OPTIONS)
 return stream
 
 @commands.command(name='play', help="Plays any song", aliases=['p'])
 async def play(self, ctx, *, url):
 vc = ctx.guild.voice_client
 if not vc.is_playing():
 guild = ctx.message.guild
 
 queues[guild.id] = {}
 stream = await self.playSong(ctx, url)
 queues[guild.id] = stream
 vc.play(stream, after=lambda e: self.queueCheck(guild.id, vc))
 await ctx.send('Now playing ' + '**' + str(queues[ctx.message.guild.id]['title'][0]) + '**')



I am aware that this can be solved with having two dictionaries but I wish to contain all data inside a single structure.