
Recherche avancée
Autres articles (51)
-
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 -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (8294)
-
Is there a way to pipe the stdio stream with the output segment ts files during m3u8 from mp4 conversion in ffmpeg with nodes spawn function ?
21 février, par Jacob LI am writing an automated pipeline in Node-JS that takes an MP4 file, compresses it, then returns the buffer of the compressed file, feeds it into another FFmpeg command, which then converts the mp4 to
.m3u8
for HLS.

The problem I’m having is that I am not able to pipe the segment file data stream to automatically upload each
.ts file
to the cloud versus having them stored to the disk (which is not an option because this is a cloud function).

I either have to opt in to them being created in memory in the directory, which then my manifest file is based off of, or I create one large buffer with the binary data and then the manifest data intertwined. I am able to perform all of this if I can write these files to the disk and store them locally, but, as I said, this is for a cloud function.


The command I’m using for conversion is


const ffmpeg = spawn(
 "ffmpeg",
 [
 "-i",
 `pipe:0`,
 "-codec",
 "copy",
 "-start_number",
 "0",
 "-hls_time",
 "10",
 "-hls_list_size",
 "0",
 "-f",
 "hls",
 "-hls_flags",
 "delete_segments",
 "pipe:1",
 ],
 { stdio: ["pipe", "pipe", "pipe", "pipe"] }
 );



I am writing to the stdin with an input buffer.
The only way around not generating physical TS files and not getting an EPIPE error (by trying to pipe the segment outputs to stdout) is by passing the delete segments flag. At least that’s what I have found. Then I am intercepting the stream on stdout, which then I get the large buffer array of all of the binary and manifest file data (the latter is in utf-8 encoding so I can parse it out).

Even if I physically parse it and then upload the buffer as a blob, and then insert that downloadURL from the cloud in the areas of the manifest file where the different
.ts
files are called sequentially, I am not able to make it work.

Please ask any clarifying questions.


Update I think I found a good solution that also aligns with one of the comments under this post. Here it is :


Instead of spawning multiple child processes in node, I spawned just one that contains all of the compression information and hls conversion flags. This solves the issue of storing the buffer in memory manually and writing it to stdin for the next ffmpeg function. Additionally, I manually set the video bitrate and the maxbuffer size for the video and encoded the audio. I played around with adaptive bitrate streaming, but found it was not necessary for my use case and I could always simply opt in to it later. Additionally, while the ffmpeg function is running, I am employing a file watcher with chokidar and fetching, uploading, and deleting each .ts file to minimize memory usage in a cloud environment. I then store all of the download urls in a map with the key set to the segment, then parse the manifest file, replacing each segment name with its respective download url. If anyone wants to see my solution or the specific ffmpeg command, please let me know.


-
YouTube Live Broadcast silence detect
12 mai 2020, par MarkusI'm trying to monitor a YouTube live broadcast for silence to be able to restart ffmpeg broadcast. How would you achieve that without breaking the YouTube ToS ?



I tried with the YouTube API, but health.status is only supported for Live streams but not for broadcast.



I came up with the idea of youtube-dl, grabing the m3u8 and the run ffmpeg with silencedetect but now I'm somehow stuck.



Get the formats



youtube-dl --list-formats https://www.youtube.com/watch?v=BiHequcIiNw




Get the m3u8 manifest



youtube-dl -f 91 -g https://www.youtube.com/watch?v=BiHequcIiNw




Run ffprobe



ffprobe -v quiet -print_format json -show_streams https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1588936061/ei/Hem0Xp35EZLl1wLLhYaYCA/ip/2a02:1205:c6bb:4590:301f:6186:c624:f2ba/id/BiHequcIiNw.0/itag/91/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D139/sgovp/gir%3Dyes%3Bitag%3D160/hls_chunk_host/r3---sn-nfpnnjvh-9and.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/initcwndbps/13630/mh/GY/mm/44/mn/sn-nfpnnjvh-9and/ms/lva/mv/m/mvi/2/pl/48/dover/11/keepalive/yes/fexp/23882513/mt/1588914375/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhALApv3H2YEE2GLTXIyRxw8Fu8espLgRThUfhi97DIS6-AiEAsT_4bwAfsihK6zsrKgaxMYTemlAr8BXnBTwuhwe3aAE%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIgRG3c1ww23Jokzk6vfAfeZlhwEanWG_9GmwRip81v65cCIQDg1Y9pXWS4bUjpKpZ90c3icp4slmAzhQJPn2gqW0UOeQ%3D%3D/playlist/index.m3u8




But I haven't found a difference in the json if the stream is up or down. Any hint how I could monitor the m3u8 if it's up or down ?


-
EM : ajouter la prise en charge de l’extension epub dans SPIP
19 octobre 2011Ajouter le format epub afin de pouvoir le mettre en ligne même si dans l’immédiat on ne sait pas encore le traiter (plugin annexe à faire) ...
CF pour le format : http://fr.wikipedia.org/wiki/EPUB_%...