
Recherche avancée
Autres articles (34)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (5278)
-
Evolution #2633 : Pouvoir modifier _DIR_RESTREINT_ABS
10 juillet 2015, par jluc -Pourrait on réouvrir ce ticket ?
Dans SPIP 3.1 du 15 juin environ voici la liste des occurences de ecrire que j’ai trouvé dans la dist :
squelettes-dist/robots.txt.html:11:Disallow : /ecrire/
spip_loader.php:44:define(’_SPIP_LOADER_PLUGIN_RETOUR’, "ecrire/ ?exec=admin_plugin&voir=tous") ;
spip_loader.php:923:if (@file_exists(’ecrire/inc_version.php’))
spip_loader.php:924 : define(’_SPIP_LOADER_URL_RETOUR’, "ecrire/ ?exec=accueil") ;
spip_loader.php:925 : include_once ’ecrire/inc_version.php’ ;
spip_loader.php:933 : else define(’_SPIP_LOADER_URL_RETOUR’, "ecrire/ ?exec=install") ;spip.php:14:if (!defined(’_DIR_RESTREINT_ABS’)) define(’_DIR_RESTREINT_ABS’, ’ecrire/’) ;
ecrire/inc/flock.php:607 : * $x = preg_files(’ecrire/data/’, ’[.]lock$’) ;
ecrire/public/debusquer.php:366 : if ($reg[1]==’ecrire/public’)
ecrire/inc_version.php:38 : define(’_DIR_RESTREINT_ABS’, ’ecrire/’) ;
ecrire/inc_version.php:42 : * vide si on est dans ecrire, ’ecrire/’ sinon */plugins-dist/compresseur/tests/compacte_css.php:10 : while (!is_dir($remonte."ecrire"))
plugins-dist/forum/prive/modeles/forum-actions-moderer.html:2 :[(#SETretour,[(#REM|test_espace_prive| ?[(#VALecrire/|concat#SELF|replace’./’,’’)],#SELF|ancre_urlforum#ID_FORUM)])]
plugins-dist/filtres_images/tests/_couleur_rgb2hsv.php:13 : while (!is_dir($remonte."ecrire"))
plugins-dist/filtres_images/tests/_couleur_hsv2rgb.php:13 : while (!is_dir($remonte."ecrire"))
plugins-dist/filtres_images/tests/_couleur_rgb2hsl.php:13 : while (!is_dir($remonte."ecrire"))
plugins-dist/filtres_images/tests/multiple_de_trois.php:13 : while (!is_dir($remonte."ecrire"))
plugins-dist/filtres_images/tests/couleur_extraire.php:13 : while (!is_dir($remonte."ecrire"))
plugins-dist/filtres_images/tests/_couleur_hsl2rgb.php:13 : while (!is_dir($remonte."ecrire"))
plugins-dist/textwheel/tests/tw_propre_modeles_block.php:9 : while (!is_dir($remonte."ecrire"))
plugins-dist/textwheel/tests/tw_propre_modeles_inline.php:9 : while (!is_dir($remonte."ecrire"))
plugins-dist/textwheel/tests/tw_propre_typo.php:9 : while (!is_dir($remonte."ecrire"))
plugins-dist/textwheel/tests/tw_propre.php:9 : while (!is_dir($remonte."ecrire"))
plugins-dist/porte_plume/tests/lanceur_spip.php:7:while (!is_dir($remonte."ecrire"))
plugins/spipr/zcore/v2.4.3/tests/zcore_echafaudable.php:12 : while (!is_dir($remonte."ecrire"))
plugins/auto/zcore/v2.4.5/tests/zcore_echafaudable.php:12 : while (!is_dir($remonte."ecrire"))
plugins/auto/gis/v4.26.12/tests/gis_connect_sql.php:10 : while (!is_dir($remonte."ecrire"))
config/ecran_securite.php:113 : OR @file_exists(’ecrire/inc_version.php’))
config/ecran_securite.php:259:if (strpos($_SERVER[’REQUEST_URI’],"ecrire/") !==false) -
My discord bot did work on local, but didn't work on heroku
26 juillet 2022, par PeePI depoly my discord bot on Heroku.
My bot sings normally when running on local,
If I run it on Heroku, the song will not play.
Full code is here


@commands.command(name ="play")
 async def play_music(self, ctx, *keywords):
 if ctx.voice_client is None: 
 if ctx.author.voice:
 await ctx.author.voice.channel.connect()
 else:
 embed = discord.Embed(title = 'erro', description = "use after enter the channel 🤔", color = discord.Color.red())
 await ctx.send(embed=embed)
 raise commands.CommandError("Author not connected to a voice channel.")
 elif ctx.voice_client.is_playing():
 ctx.voice_client.stop()
 
 keyword = ' '.join(keywords)
 url = getUrl(keyword)
 await ctx.send(url)
 embed = discord.Embed(title = 'play', description = 'getting ready to play the song! 😎' , color = discord.Color.red())
 await ctx.send(embed=embed)



It works up to the top code, but it doesn't seem to work on the bottom code.


data = self.DL.extract_info(url, download = False)
 link = data['url']
 title = data['title']

 ffmpeg_options = {
 'options': '-vn',
 "before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5"
 }
 player = discord.FFmpegPCMAudio(link, **ffmpeg_options, executable = "./ffmpeg/bin/ffmpeg.exe")
 ctx.voice_client.play(player)
 
 embed = discord.Embed(title = 'play', description = f'{title} start play! 🐥' , color = discord.Color.blue())
 await ctx.send(embed=embed)



My heroku Buildpacks


heroku/python
https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
https://github.com/xrisk/heroku-opus
https://github.com/heroku/heroku-buildpack-apt.git
https://github.com/heroku/heroku-buildpack-apt
https://github.com/kitcast/buildpack-ffmpeg.git
https://github.com/codeinteger6/heroku-buildpack-libopus.git
https://github.com/heroku/heroku-buildpack-apt.git



requirements.txt


discord.py
discord.py[voice]
asyncio
openpyxl
youtube_dl
requests
ffmpeg
PyNaCl
wheel
websockets==6.0
gtts
PyGithub
pyssml
gspread
oauth2client
PyOpenSSL
boto3



Aptfile


git
libopus0
libopus-dev
libssl-dev
libffi-dev
libsodium-dev



I really wanna know my problems.
Thank you.


-
RTSP client can not be play video
13 novembre 2018, par Harshil MakwanaI added and updated below API inside ffserver code inside ffmpeg code :
AVPacket *dataPacket;
void setAVPacket(AVPacket *packet)
{
if (packet && packet->data)
{
pthread_mutex_lock(&lock);
if (isSend == 1)
{
dataPacket = packet;
}
else
{
if (packet != NULL)
{
av_packet_unref(packet);
free(packet);
packet = NULL;
}
}
pthread_mutex_unlock(&lock);
}
static int http_prepare_data(HTTPContext *c)
{
int i, len, ret;
AVFormatContext *ctx;
av_freep(&c->pb_buffer);
switch(c->state) {
case HTTPSTATE_SEND_DATA_HEADER:
ctx = avformat_alloc_context();
if (!ctx)
return AVERROR(ENOMEM);
c->pfmt_ctx = ctx;
av_dict_copy(&(c->pfmt_ctx->metadata), c->stream->metadata, 0);
for(i=0;istream->nb_streams;i++) {
LayeredAVStream *src;
AVStream *st = avformat_new_stream(c->pfmt_ctx, NULL);
if (!st)
return AVERROR(ENOMEM);
/* if file or feed, then just take streams from FFServerStream
* struct */
if (!c->stream->feed ||
c->stream->feed == c->stream)
src = c->stream->streams[i];
else
src = c->stream->feed->streams[c->stream->feed_streams[i]];
unlayer_stream(c->pfmt_ctx->streams[i], src); //TODO we no longer copy st->internal, does this matter?
av_assert0(!c->pfmt_ctx->streams[i]->priv_data);
if (src->codec->flags & AV_CODEC_FLAG_BITEXACT)
c->pfmt_ctx->flags |= AVFMT_FLAG_BITEXACT;
}
/* set output format parameters */
c->pfmt_ctx->oformat = c->stream->fmt;
av_assert0(c->pfmt_ctx->nb_streams == c->stream->nb_streams);
c->got_key_frame = 0;
/* prepare header and save header data in a stream */
if (avio_open_dyn_buf(&c->pfmt_ctx->pb) < 0) {
/* XXX: potential leak */
return -1;
}
c->pfmt_ctx->pb->seekable = 0;
/*
* HACK to avoid MPEG-PS muxer to spit many underflow errors
* Default value from FFmpeg
* Try to set it using configuration option
*/
c->pfmt_ctx->max_delay = (int)(0.7*AV_TIME_BASE);
if ((ret = avformat_write_header(c->pfmt_ctx, NULL)) < 0) {
http_log("Error writing output header for stream '%s': %s\n",
c->stream->filename, av_err2str(ret));
return ret;
}
av_dict_free(&c->pfmt_ctx->metadata);
len = avio_close_dyn_buf(c->pfmt_ctx->pb, &c->pb_buffer);
c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len;
c->state = HTTPSTATE_SEND_DATA;
c->last_packet_sent = 0;
break;
case HTTPSTATE_SEND_DATA:
/* find a new packet */
/* read a packet from the input stream */
if (c->stream->feed)
ffm_set_write_index(c->fmt_in,
c->stream->feed->feed_write_index,
c->stream->feed->feed_size);
if (c->stream->max_time &&
c->stream->max_time + c->start_time - cur_time < 0)
/* We have timed out */
c->state = HTTPSTATE_SEND_DATA_TRAILER;
else {
AVPacket pkt;
redo:
ret = av_read_frame(c->fmt_in, &pkt);
if (ret < 0) {
if (c->stream->feed) {
/* if coming from feed, it means we reached the end of the
* ffm file, so must wait for more data */
c->state = HTTPSTATE_WAIT_FEED;
return 1; /* state changed */
}
if (ret == AVERROR(EAGAIN)) {
/* input not ready, come back later */
return 0;
}
if (c->stream->loop) {
avformat_close_input(&c->fmt_in);
if (open_input_stream(c, "") < 0)
goto no_loop;
goto redo;
} else {
no_loop:
/* must send trailer now because EOF or error */
c->state = HTTPSTATE_SEND_DATA_TRAILER;
}
} else {
int source_index = pkt.stream_index;
/* update first pts if needed */
if (c->first_pts == AV_NOPTS_VALUE && pkt.dts != AV_NOPTS_VALUE) {
c->first_pts = av_rescale_q(pkt.dts, c->fmt_in->streams[pkt.stream_index]->time_base, AV_TIME_BASE_Q);
c->start_time = cur_time;
}
/* send it to the appropriate stream */
if (c->stream->feed) {
/* if coming from a feed, select the right stream */
if (c->switch_pending) {
c->switch_pending = 0;
for(i=0;istream->nb_streams;i++) {
if (c->switch_feed_streams[i] == pkt.stream_index)
if (pkt.flags & AV_PKT_FLAG_KEY)
c->switch_feed_streams[i] = -1;
if (c->switch_feed_streams[i] >= 0)
c->switch_pending = 1;
}
}
for(i=0;istream->nb_streams;i++) {
if (c->stream->feed_streams[i] == pkt.stream_index) {
AVStream *st = c->fmt_in->streams[source_index];
pkt.stream_index = i;
if (pkt.flags & AV_PKT_FLAG_KEY &&
(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
c->stream->nb_streams == 1))
c->got_key_frame = 1;
if (!c->stream->send_on_key || c->got_key_frame)
goto send_it;
}
}
} else {
AVStream *ist, *ost;
send_it:
ist = c->fmt_in->streams[source_index];
/* specific handling for RTP: we use several
* output streams (one for each RTP connection).
* XXX: need more abstract handling */
if (c->is_packetized) {
/* compute send time and duration */
if (pkt.dts != AV_NOPTS_VALUE) {
c->cur_pts = av_rescale_q(pkt.dts, ist->time_base, AV_TIME_BASE_Q);
c->cur_pts -= c->first_pts;
}
c->cur_frame_duration = av_rescale_q(pkt.duration, ist->time_base, AV_TIME_BASE_Q);
/* find RTP context */
c->packet_stream_index = pkt.stream_index;
ctx = c->rtp_ctx[c->packet_stream_index];
if(!ctx) {
av_packet_unref(&pkt);
break;
}
/* only one stream per RTP connection */
pkt.stream_index = 0;
} else {
ctx = c->pfmt_ctx;
/* Fudge here */
}
if (c->is_packetized) {
int max_packet_size;
if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)
max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
else
max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size;
ret = ffio_open_dyn_packet_buf(&ctx->pb,
max_packet_size);
} else
ret = avio_open_dyn_buf(&ctx->pb);
if (ret < 0) {
/* XXX: potential leak */
return -1;
}
ost = ctx->streams[pkt.stream_index];
ctx->pb->seekable = 0;
if (pkt.dts != AV_NOPTS_VALUE)
pkt.dts = av_rescale_q(pkt.dts, ist->time_base,
ost->time_base);
if (pkt.pts != AV_NOPTS_VALUE)
pkt.pts = av_rescale_q(pkt.pts, ist->time_base,
ost->time_base);
pkt.duration = av_rescale_q(pkt.duration, ist->time_base,
ost->time_base);
if ((ret = av_write_frame(ctx, &pkt)) < 0) {
http_log("Error writing frame to output for stream '%s': %s\n",
c->stream->filename, av_err2str(ret));
c->state = HTTPSTATE_SEND_DATA_TRAILER;
}
av_freep(&c->pb_buffer);
len = avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
ctx->pb = NULL;
c->cur_frame_bytes = len;
c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len;
if (len == 0) {
av_packet_unref(&pkt);
goto redo;
}
}
av_packet_unref(&pkt);
}
}
break;
default:
case HTTPSTATE_SEND_DATA_TRAILER:
/* last packet test ? */
if (c->last_packet_sent || c->is_packetized)
return -1;
ctx = c->pfmt_ctx;
/* prepare header */
if (avio_open_dyn_buf(&ctx->pb) < 0) {
/* XXX: potential leak */
return -1;
}
c->pfmt_ctx->pb->seekable = 0;
av_write_trailer(ctx);
len = avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len;
c->last_packet_sent = 1;
break;
}
return 0;
}if you see here there is API named setAVPacket(), through which I am passing my H264 based encoded packet to RTSPServer. And same AVPacket used by Other function named http_prepare_data(), which will be called when PLAY request is coming.
After implementing above code I can do handshake of RTSP and server can send RTP packet to client, but no player(tried VLC, ffplayer) can play video.
Can you help me on this ?
Very much thanks you in advance.