
Recherche avancée
Autres articles (6)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
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 (...) -
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
Sur d’autres sites (3561)
-
PHP passthru with proper child process closing
6 juin 2022, par Bluchip StudioI am currently using the code below to try and restream a hls live stream via php the reason for this is php is all i have access to on the system i am using i can not use or install anything else and i like to watch my home tv in my current location my hls streams come direct from my own tbs octo encoder at my home so i know thats all good.


my issue is that the stream randomly stops after around 30-50 seconds of playing it can be restarted no problem so i know the reading of the stream is not the issue.


also when i disconnect and stop watching the stream the ffmpeg / streamlink processes do not stop and stay running in the back ground this has led to me getting some rather frustrating emails from the owner of the system i am using


does anyone know if this is the best way to handel this task and how to possibly close the child processes created by passthru ?


PS : I know all caps is not the correct way to code in production but as this is my personal code and it does not effect the way in witch the code is run it makes it so much easier for me to read being dyslexic !


<?php

ini_set('output_buffering', '0');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

set_time_limit(0);
ob_implicit_flush();

include './core/functions.php';

$PROCESS_URL = 'HTTP STREM URL GOES HERE';
 
$ENCODING_TYPE = 'mpegts';
 
$ENCODING_SETTINGS = 'streamlink '. $PROCESS_URL . ' best -O | '. FFMPEG .
 ' -threads 0' .
 ' -re' .
 ' -probesize 9000000'.
 ' -analyzeduration 9000000'.
 ' -i pipe:0' .
 ' -c:v copy -c:a copy' .
 ' -tune zerolatency' .
 ' -preset ultrafast' .
 ' -fflags +genpts' .
 ' -mpegts_flags initial_discontinuity' .
 ' -f ' . $ENCODING_TYPE . 
 ' pipe:1 2>' . LOG_DIRECTORY . '/' . MD5($PROCESS_URL) . '_ffmpeg.txt';

header('Content-type: application/octet-stream');
header('X-Accel-Buffering: no');

@passthru($ENCODING_SETTINGS);

?>



-
Intercept and divert graphic output before it hits the linux framebuffer, not using X11
13 octobre 2018, par ApolloI have been researching this issue for about a week, and it may be that I don’t know the right questions to ask.
I am running a debian distro (Raspbian Stretch on the RaspberryPi). I am not using X11. Instead, I am booting straight to the command line, and will eventually probably boot straight up headless, starting a program at startup or sshing in to interact.
What I need to do is to start an application (a game engine specifically) that draws graphics to the framebuffer. Then, I need to intercept that stream before it makes it into the framebuffer, so I can work with it in real time.
Ultimately, I am using ffmpeg to compress and stream video of the output to another Pi. So, I want to be able to start an application and stream its output over a LAN, while still being able to interact with the command line in a separate thread.
I have the ffmpeg command to pull from
/dev/fb0
, and have successfully started the graphics application and streamed the content. But, is there anyway to intercept, capture, or redirect that application’s output so it never actually hits the framebuffer ? In my searching I have found many examples of writing to or reading from the framebuffer, but nothing about stopping content before it reaches the buffer.I am happy with any solution that uses an existing package or application, or for C or RUST code that accomplishes what I need.
Thank you
-
Sequencing MIDI From A Chiptune
28 avril 2013, par Multimedia Mike — Outlandish BrainstormsThe feature requests for my game music appreciation website project continue to pour in. Many of them take the form of “please add player support for system XYZ and the chiptune library to go with it.” Most of these requests are A) plausible, and B) in process. I have also received recommendations for UI improvements which I take under consideration. Then there are the numerous requests to port everything from Native Client to JavaScript so that it will work everywhere, even on mobile, a notion which might take a separate post to debunk entirely.
But here’s an interesting request about which I would like to speculate : Automatically convert a chiptune into a MIDI file. I immediately wanted to dismiss it as impossible or highly implausible. But, as is my habit, I started pondering the concept a little more carefully and decided that there’s an outside chance of getting some part of the idea to work.
Intro to MIDI
MIDI stands for Musical Instrument Digital Interface. It’s a standard musical interchange format and allows music instruments and computers to exchange musical information. The file interchange format bears the extension .mid and contains a sequence of numbers that translate into commands separated by time deltas. E.g. : turn key on (this note, this velocity) ; wait x ticks ; turn key off ; wait y ticks ; etc. I’m vastly oversimplifying, as usual.MIDI fascinated me back in the days of dialup internet and discrete sound cards (see also my write-up on the Gravis Ultrasound). Typical song-length MIDI files often ranged from a few kilobytes to a few 10s of kilobytes. They were significantly smaller than the MOD et al. family of tracker music formats mostly by virtue of the fact that MIDI files aren’t burdened by transporting digital audio samples.
I know I’m missing a lot of details. I haven’t dealt much with MIDI in the past… 15 years or so (ever since computer audio became a blur of MP3 and AAC audio). But I’m led to believe it’s still relevant. The individual who requested this feature expressed an interest in being able to import the sequenced data into any of the many music programs that can interpret .mid files.The Pitch
To limit the scope, let’s focus on music that comes from the 8-bit Nintendo Entertainment System or the original Game Boy. The former features 2 square wave channels, a triangle wave, a noise channel, and a limited digital channel. The latter creates music via 2 square waves, a wave channel, and a noise channel. The roles that these various channels usually play typically break down as : square waves represent the primary melody, triangle wave is used to simulate a bass line, noise channel approximates a variety of percussive sounds, and the DPCM/wave channels are fairly free-form. They can have random game sound effects or, if they are to assist in the music, are often used for more authentic percussive sounds.The various channels are controlled via an assortment of memory-mapped hardware registers. These registers are fed values such as frequency, volume, and duty cycle. My idea is to modify the music playback engine to track when various events occur. Whenever a channel is turned on or off, that corresponds to a MIDI key on or off event. If a channel is already playing but a new frequency is written, that would likely count as a note change, so log a key off event followed by a new key on event.
There is the major obstacle of what specific note is represented by a channel in a particular state. The MIDI standard defines 128 different notes spanning 11 octaves. Empirically, I wonder if I could create a table which maps the assorted frequencies to different MIDI notes ?
I think this strategy would only work with the square and triangle waves. Noise and digital channels ? I’m not prepared to tackle that challenge.
Prior Work ?
I have to wonder if there is any existing work in this area. I’m certain that people have wanted to do this before ; I wonder if anyone has succeeded ?Just like reverse engineering a binary program entails trying to obtain a higher level abstraction of a program from a very low level representation, this challenge feels like reverse engineering a piece of music as it is being performed and automatically expressing it in a higher level form.