
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (80)
-
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 -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (10110)
-
Revision 040eeed9d0 : Turning model based reverse update on for coefs Turns model based reverse updat
26 avril 2013, par Deb MukherjeeChanged Paths :
Modify /vp9/common/vp9_entropy.c
Modify /vp9/common/vp9_entropy.h
Turning model based reverse update on for coefsTurns model based reverse updates on for coefficients in an
effort to reduce the memory requirement for counters.With this patch the counters needed will be reduced by about
75% since only 3 counts are needed instead of 12.The impact in performance is :
derf300 : -0.252%
stdhd250 : -0.046%However retraining should alleviate some of the drop in
performance.Change-Id : I6f2b3e13f6d5520aa3400b0b228fb5e8b4a43caa
-
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> -
(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.