
Recherche avancée
Autres articles (69)
-
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 ;
-
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 (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (10774)
-
How to change bitrate with ffmpeg ?
26 mars 2020, par Nk nk nkHow to force to restream all channels in 720p ?
[program:chanel]
autorestart=true
command=/usr/bin/ffmpeg -hide_banner -i https://domain.com.m3u8 -c copy -f hls -hls_time 4 -hls_flags append_list+delete_segments -hls_list_size 6 -hls_segment_filename '/etc/nginx/hls/imedi1/file%%03d.ts' /etc/nginx/hls/chanel/playlist.m3u8 -
Generate individual HLS-compatible .ts segments on-demand by downloading as little bytes as possible from a remote input file
27 janvier 2017, par Romain CointepasI’m trying to generate individual HLS-compatible .ts segments on-demand by downloading/reading as little bytes as possible from a remote input file (hosted on a server supporting byte-ranges requests).
One of the application for this would be to be able to transcode and play on Apple TV (via Airplay) a remote file that is not Airplay compatible, without having to download the entire file first.
I am generating the playlist myself, and I have access to the ffprobe results for the remote file (that gives video duration, etc.).
I have something working that plays via Airplay but with small video and audio glitches between each segments when I use the following command to generate each segment :
ffmpeg -ss 60 -t 6 -i http://s3.amazonaws.com/misc-12345/avicii.vob -f mpegts -map 0:v:0 -map 0:a:0 -c:v libx264 -bsf:v h264_mp4toannexb -force_key_frames "expr:gte(t,n_forced*6)" -forced-idr 1 -pix_fmt yuv420p -colorspace bt709 -c:a aac -async 1 -preset ultrafast pipe:1
Note : above command is for segment 11.ts, and in the m3u8 playlist I advertise each segment duration as 6 seconds.
Here is a Youtube video showing the audio/video glitches between segments :
https://www.youtube.com/watch?v=0vMwgbSfsu0The segment or hls modules of ffmpeg can’t be used because they both generate all the segments at once.
I’ve been struggling on this for some days now and I would really appreciate some help !
-
hls av_read_frame delay reading between segment files
12 septembre 2016, par Debendra ModiI am trying to demux live HLS audio and find delays in the loop for reading frames whenever it starts reading the next segment file.
The HLS audio segment files are MP3, 1 second target duration. Each 1 second file has 13 frames.
The live HLS source and our code is started at the same time. avformat_open_input takes about 5 seconds to return, as it waits for 3 segment files as required by HLS standards.
The av_read_frame loop reads 13 frames from each segment file and then it takes about 1.5 to 2 seconds before it starts reading the next 13 frames from the next segment file. Our interrupt callback is called several times within this duration and we return a 0 to continue reading.
The playlist has several segment files available for it to read so it is not waiting for the segment file to be available in the playlist.
Given below is the code snippet and attached is the m3u8.
static int interrupt_cb(void *start_ticks)
{
long starttime = (long)start_ticks; //the start time ticks is in opaque
//timeout after 5 seconds of no activity
if (GetTickCount() - starttime >7000))
return 1;
log("Returning 0");
return 0;
}
static bool hls_demuxer( char* fileName )
{
AVDictionary *options = NULL;
av_dict_set(&options, "analyzeduration", "100000", 0);
AVFormatContext* formatContext = avformat_alloc_context( );
formatContext->interrupt_callback.callback = interrupt_cb;
long startticks = GetTickCount();
formatContext->interrupt_callback.opaque = (void*) startticks;
formatContext->flags|=AVFMT_FLAG_NONBLOCK;
//added the following additional parameters to see if they would help to speed up reading frames - but in vain
formatContext->probesize = 2048;
formatContext->max_delay = 100000; //0.1 secs, default 5 secs
formatContext->probe_score = 100;
formatContext->max_analyze_duration = 100000; //0.1 secs
if ( avformat_open_input( &formatContext, fileName, NULL, NULL ) !=0 )
{
return false;
}
av_dict_free(&options);
av_dump_format(formatContext,0,filename,0); //reaches here after 4 secs of start. Interrupt callback called several times. This is OK.
if (avformat_find_stream_info(formatContext,NULL) != 0)
return false;
AVPacket pkt;
while(!threadstop)
{
startticks = GetTickCount();
//**THIS IS THE ISSUE** ->reads 13 frames from first segment file.
// No interrupt callback. Then before using the next segment file, calls
//interrupt callback several times (about 1 to 2 secs) before reading next
//segment file, then reads the next 13 frames. Playlist has several files
//available. This continues between each segment file read, thereby
//delaying read for each new segment file in playlist.
if (av_read_frame(formatContext,&pkt) != 0)
return false;
log("Packet read");
//Do something with packet
av_packet_unref(&pkt);
}
return true; //When the playlist ends, it has 38 files.The demuxer Takes over 30 seconds longer.
}Any suggestions ? Thanks in advance.