
Recherche avancée
Autres articles (67)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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 (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (5222)
-
Failing to upload an mp4 to youtube
28 juillet 2018, par Joseph BerryI’m trying to convert an WMA file into mp4 in order to upload the file to youtube.
VN550672.wma.zip
Although the conversion is successful (see below) i’m not able to upload the file to youtube. I’m getting the following errorThe video has failed to process. Please make sure you are uploading a supported file type.
Any suggestions ?
System configuration :
Python version : 3.6.3
Pydub version : 0.22.1
ffmpeg or avlib ? : ffmpeg
ffmpeg/avlib version : 2.8.4 -
avcodec/ttmlenc : Deduplicate ttml_default_namespacing string
29 juillet 2022, par Andreas Rheinhardtavcodec/ttmlenc : Deduplicate ttml_default_namespacing string
String literals are allowed to be deduplicated (and toolchains
are already capable of doing so), yet the same is not allowed
for named arrays (even when they contain strings). Therefore
use a const char *const pointing to an unnamed string literal
for ttml_default_namespacing.Reviewed-by : Jan Ekström <jeebjp@gmail.com>
Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com> -
Python complex string interpolation on shell command
2 mai 2018, par Rex LowI have a shell command that I would like to execute, with a python script. It’s a combination of
ffmpeg
,grep
,gawk
and several otherffmpeg
options.The command
ffmpeg -i http://0.0.0.0:8080/stream/video.mjpeg -vcodec copy -map 0 -f segment -segment_time 2 -loglevel 40 -segment_format mp4 capture-%05d.mp4 2>&1 | grep --line-buffered -Eo "segment:.+ended" | gawk -F "'" '{print $2; system("")}'
If you run this command on terminal, it should return a string
capture-00001.mp4
Now, my objective is to run this with
subprocess
on Python3. Since the command is rather complex with mixed single and double quotes, it needs to be treated correctly otherwise it will complainEOL while scanning string literal
,invalid syntax
, etc, etc.I have tried several string formating methods but none work. Below is one of the ways I’ve tried.
Script
import os
import datetime
import subprocess
first = "segment:.+ended"
second = "'"
third = '{print $2; system("")}'
if __name__ == "__main__":
fScript = "ffmpeg -i http://0.0.0.0:8080/stream/video.mjpeg -vcodec copy -map 0 -f segment -segment_time 2 -loglevel 40 -segment_format mp4 capture-%05d.mp4 2>&1 | grep --line-buffered -Eo {} | gawk -F {} {}".format(first, second, third)
try:
result = subprocess.check_output(fScript, shell=True).decode('utf-8')
print(result)
except subprocess.CalledProcessError as e:
print(e.output)