
Recherche avancée
Autres articles (66)
-
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 (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
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 ;
Sur d’autres sites (4331)
-
How to do precise frame cut with ffmpeg ?
25 juillet 2020, par Menglun LiI tried to cut multiple big videos into many small pieces. I know I can cut and export the small pieces one by one with "Premiere Elements", however that takes a lot time to export them manually. I couldn't find a way to do batch export in "Premiere Elements".


I wrote down the starting and ending points of the small videos from Premiere Elements' timeline viewer, then I created a batch file to use ffmpeg for batch cutting. Below is one of the cutting command in the batch file.


ffmpeg -i input.mp4 -ss 00:20:45.09 -to 00:23:01.00 -c:v libx264 -c:a aac output5.mp4 



I compared the video that was cut by ffmpeg and the video was exported by Premiere Elements. I found sometime they are not starting and ending at the same frame, and it is not consistent either. Both the starting and ending frame that was cut by ffmpeg can drift forward or backward 6-9 frames from the frame number showed in Premiere Elements.


How do I make sure ffmpeg has the precise frame cut ? Thanks in advance.


-
HLS live stream stops working with AbortError after running fine for a while
20 juillet 2020, par mandrakeyBefore I go file a bug with Video.js I wanted to see if I maybe have gotten something wrong. The situation is this :


- 

- I have a RTSP live stream, which I convert to HLS using ffmpeg (works)
- I want to play that HLS stream using Video.js in the browser






After I start ffmpeg, all works as expected and I can watch the live stream in the browser. This was, say, around 4pm. I go home for the day and when I try to access the stream again in the morning (around 8am, freshly started browser) I just get a black image (Firefox) or a still (Chrome) and a never ending loading animation.


The browser console shows the following output every 6 seconds (which is my chunk length) :


AbortError: The operation was aborted. 
XHR GET http://server/hls/live/stream1/720p6.ts [HTTP/1.1 200 71ms]
XHR GET http://server/hls/live/stream1/720p7.ts [HTTP/1.1 200 64ms]
XHR GET http://server/hls/live/stream1/720p8.ts [HTTP/1.1 200 62ms]
XHR GET http://server/hls/live/stream1/720p9.ts [HTTP/1.1 200 57ms]
XHR GET http://server/hls/live/stream1/720p0.ts [HTTP/1.1 200 63ms]



Note : The chunk numbers in the end do change correctly, so it does not look like an infinite loop where video.js tries to access the same files over and over again.


I have compared the m3u8 contents from a time when this happens to just after I restarted ffmpeg. The only difference I can spot is that the sequence number has increased :


Working version


#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:2
#EXTINF:6.000011,
720p2.ts
#EXTINF:5.999989,
720p3.ts
#EXTINF:6.000000,
720p4.ts
#EXTINF:6.000000,
720p5.ts
#EXTINF:6.000000,
720p6.ts



Not working version


#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:45255
#EXTINF:6.000011,
720p5.ts
#EXTINF:5.999989,
720p6.ts
#EXTINF:6.000000,
720p7.ts
#EXTINF:6.000011,
720p8.ts
#EXTINF:5.999989,
720p9.ts



What I have confirmed so far :


- 

- The video chunks ffmpeg creates work. I have downloaded newly generated chunks and played them using VLC : Got a 6 second video as expected.
- This also means the source stream still works as expected.
- It does not seem to be an issue with the browser as both Firefox and Chrome show the same behaviour.
- When I restart ffmpeg, which as far as I can see only resets the sequence number, everything works fine again after I reload the video.js player.
- It is no one time issue : I have tried this more than 4 days in a row now. Happens every time.












Have I stumbled upon a bug in video.js here or am I missing something ?


For reference, this is how I start ffmpeg :


ffmpeg -v info -rtsp_transport tcp -i rtsp://source/stream -c:v copy -c:a copy -hls_time 6 -hls_wrap 10 -start_number 1 /path/to/stream1/720p.m3u8



Thank you very much for reading and taking the time so far. Any help will be much appreciated :)


-
ffmpeg stops capturing whole hour of HTTP stream after some time
7 juillet 2020, par CompuChipFirst of all, sorry if I'm using the wrong terminology. I've been playing around with nginx and I'm still a bit confused about RTMP and HLS and other acronyms.


I've managed to setup OBS to stream to an nginx server, which takes the RTMP stream and chops it into pieces for HLS. Here's the relevant part of the nginx configuration file.


rtmp {
 server {
 listen 1935;
 chunk_size 4000;
 ping 30s;
 deny play all;

 application live {
 live on;
 hls on;
 hls_nested on; # Create a new folder for each stream
 hls_path /mnt/hls/live;
 hls_fragment 3s;
 hls_fragment_naming timestamp;
 hls_playlist_length 60s;
 }
 }
}

http {
 server {
 listen 81 ssl;

 #creates the http-location for our full-resolution (desktop) HLS stream - "http://localhost:8080/live/test/index.m3u8"
 location /live {
 # Elided caching and CORS for brevity

 alias /mnt/hls/live;
 add_header Cache-Control no-cache;
 index index.m3u8;
 }
 }
}



This works well, I can view the stream in VLC or on a website and it looks smooth. Now I wanted to add some logging : I'd like to write full hours (starting at xx:00:00 and ending at xx:59:59) to a file named
log_yyyymmdd_hh.mp4
, e.g.log_20200707_18.mp4
for the files of 7 July 2020, 18:00 - 19:00 hrs. So I've set up an hourly cron job with the following ffmpeg command :

ffmpeg -i https://stream.example.com:81/live/<streamkey> -preset veryfast -maxrate 2000k \
 -bufsize 2000k -g 60 -t 3600 -y /var/video/log/$(date +\%Y\%m\%d_\%H00).mp4 >/dev/null 2>&1
</streamkey>


At first this seemed to work well, so I left it running happily for about 24 hours. When I checked, most of my hourly files were small ( 100MB) files of about 10 to 15 minutes long. It seems like any small delay in the stream will cause
ffmpeg
to stop writing to the file. I suspect such hiccups may for example be caused by an OBS plugin and I'll need to look into that, but I would prefer thatffmpeg
will retry for some time before giving up. What arguments should I be passing toffmpeg
to make it not break when the stream is down for, say, up to a second every now and then ?.

When I view back the HLS files there don't seem to be any noticeable gaps, so eventually all the data arrives. I went for the
crontab
solution withffmpeg
because when recording from nginx I could not figure out how to start recording at the start of the whole hour.