
Recherche avancée
Médias (1)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (106)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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. -
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...)
Sur d’autres sites (17458)
-
configure : allow mixed declarations and code for Objective-C
25 septembre 2024, par Marvin Scholzconfigure : allow mixed declarations and code for Objective-C
Mixing declarations and code is quite common in Objective-C (as can be
seen by the number of warnings we have for this in Objective-C files)
and forcing to not do it usually results in worse code, with unnecessary
widely scoped variables, which in turn makes variable shadowing and
accidentally using the wrong variable more common and harder to notice.Signed-off-by : Zhao Zhili <zhilizhao@tencent.com>
-
(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.


-
avcodec/bsf/h264_mp4toannexb : Fix mixed bitstream format
24 avril, par Zhao Zhiliavcodec/bsf/h264_mp4toannexb : Fix mixed bitstream format
This bsf converts AV_PKT_DATA_NEW_EXTRADATA side data in avcc format
to in-band annexb format. However, the side data wasn't been removed
and copied from input packet to output packet. So the output packet
has mixed bitstream format. We don't support mixed bitstream format.
For example, h264_metadata report error in the following case :ffmpeg -i foo.flv \
-bsf:v "h264_mp4toannexb,h264_metadata" \
-c copy -f nullThis patch removed NEW_EXTRADATA side data after process.
This patch also add a check so only NEW_EXTRADATA in avcc format is
processed. NEW_EXTRADATA in annexb format is copied to output as is.Reported-by : jiangjie <jiangjie618@gmail.com>
Signed-off-by : Zhao Zhili <zhilizhao@tencent.com>