
Recherche avancée
Autres articles (56)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Qu’est ce qu’un masque de formulaire
13 juin 2013, parUn masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
Chaque formulaire de publication d’objet peut donc être personnalisé.
Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...) -
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 (11774)
-
(Go) FFmpeg stdout produces a jumbled mess of plain text mixed with binary [closed]
30 juillet 2024, par EricFrancis12I'm trying to pipe
r.Body
into ffmpeg as it's stdin, then pipe stdout as the http response.

On the client, I am sending the data via POST from an html form, then creating a blob for the response and prompting the browser to download it :


<code class="echappe-js"><script>&#xA; document.getElementById(&#x27;uploadForm&#x27;).addEventListener(&#x27;submit&#x27;, function (event) {&#xA; event.preventDefault();&#xA;&#xA; const fileInput = document.getElementById(&#x27;file&#x27;);&#xA; const file = fileInput.files[0];&#xA;&#xA; const formData = new FormData();&#xA; formData.append(&#x27;file&#x27;, file);&#xA;&#xA; fetch(&#x27;/http&#x27;, {&#xA; method: &#x27;POST&#x27;,&#xA; body: file,&#xA; headers: {&#xA; &#x27;Content-Type&#x27;: file.type,&#xA; }&#xA; })&#xA; .then(response => {&#xA; const blob = response.blob();&#xA; const url = window.URL.createObjectURL(blob);&#xA; const a = document.createElement(&#x27;a&#x27;);&#xA; a.style.display = &#x27;none&#x27;;&#xA; a.href = url;&#xA; a.download = &#x27;output.flv&#x27;;&#xA; document.body.appendChild(a);&#xA; a.click();&#xA; window.URL.revokeObjectURL(url);&#xA; })&#xA; .catch(error => console.error(error));&#xA; });&#xA; </script>



On the server, I am creating an
*exec.Cmd
, assigningr.Body
to it's stdin, and assigningw
to both it's stdout and stderr :

func handleHTTP(w http.ResponseWriter, r *http.Request) {
 command := "ffmpeg -f mp4 -i - -vf scale=100:50 -c:a copy -c:v libx264 -f flv pipe:1"
 ffmpegCmd := PrepareCommand(command, r.Body, w, w)

 // Run FFmpeg command
 if err := ffmpegCmd.Run(); err != nil {
 http.Error(w, fmt.Sprintf("FFmpeg command failed: %v", err), http.StatusInternalServerError)
 }
}

func PrepareCommand(command string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) *exec.Cmd {
 command = strings.TrimSpace(command)
 name, args := FormatCommand(command)
 ffmpegCmd := exec.Command(name, args...)
 ffmpegCmd.Stdin = stdin
 ffmpegCmd.Stdout = stdout
 ffmpegCmd.Stderr = stderr
 return ffmpegCmd
}

func FormatCommand(str string) (name string, args []string) {
 parts := strings.Split(str, " ")
 return parts[0], parts[1:]
}



When viewed in a text editor, the output file consists of the plain text emitted from stdout when the command starts and the binary data mixed together :




Does anyone know how to get rid of the plain text output before piping the data into stdin ? Thanks.


The output file should not contain plain text from the command start-up.


-
FFMPEG script to cut audio at exact time intervals [duplicate]
15 janvier 2021, par BitBitI have an audio file which is about 1 hour 10 minutes long, and I want to cut the audio into several parts which are exactly time 15 mins apart. Can someone please help me with a ffmpeg script that cuts audio at every 15th minute(i.e. at 15:00,30:00,45:00,60:00) and hence make my 1 hour 10 minutes audio clip into 5 cut clips of 15 minutes length(the last clip being only 10 minutes due to the video length)


-
Remove Black Frames from an overlayed Circled Video
7 juillet 2017, par amanguelI have a video that I need to overlay on top of another video. The first video have parts with black frames that I don’t want to be overlayed and I also need to mask this video with a circle.
In other words, I will be overlaying a few circled videos on top of a bigger rectangular video and I also don’t want to show black frames from the circled videos.
Could you please help me.
Thanks !!!!!