
Recherche avancée
Autres articles (68)
-
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 (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...)
Sur d’autres sites (12465)
-
How to upload 7MB GIF to Twitter's API
22 février 2021, par randombitsI have a bunch of JPEG frames that I use ImageMagick to stitch together into a GIF. The final product has the following type :


GIF image data, version 89a, 1280 x 720


This gives the effect of an animated GIF. My file sizes range anywhere between 6-8MB.


If I upload this media manually to Twitter, it works great. Using
TwitterOAuth
PHP library found here when I attempt the following :

$media = $twitterConnection->upload('media/upload', ['media' => 'my_file.gif');


I get the following error :


Image file size must be <= 5242880 bytes


I have also tried uploading the file using Twitter's recommended Python large video library and that failed with the following :


INIT
Media ID: 1362940800456351744
APPEND
4194304 of 7685061 bytes uploaded
APPEND
7685061 of 7685061 bytes uploaded
Upload chunks complete.
FINALIZE
{'media_id': 1362940800456351744, 'media_id_string': '1362940800456351744', 'media_key': '7_1362940800456351744', 'size': 7685061, 'expires_after_secs': 86400, 'processing_info': {'state': 'pending', 'check_after_secs': 1}}
Media processing status is pending
Checking after 1 seconds
STATUS
Media processing status is failed



I am willing to use any platform/utility to get my video files uploaded to Twitter. What is my best bet to either :


1 : Fix my file type to adhere to Twitter's requirements. Should it not be a GIF ? Should I be converting my still shot JPEG files to another format ?


2 : Is there an API that Twitter has available that will allow the GIFs of these sizes to be uploaded ? Again, I can upload these files via the regular Twitter web UI client, but I cannot automate it via their API.


How do I upload my GIF to Twitter using their API ?


-
When I run code in Docker I get a Django error [Errno 2]. When running locally everything works. Why ?
8 février 2021, par Bartłomiej KokoszkaI don't know what's going on. A script run by Django works fine, but not through Docker and Django. An error is returned :


Pic Errno 2 No such file or directory


Below is the code of the function with the error and the code of the Dockerfile.


'''


def mediainfo(filepath):
 



Original code :




prober = get_prober_name()
 command_args = [
 "-v", "quiet",
 "-show_format",
 "-show_streams",
 filepath
 ]

 command = [prober, '-of', 'old'] + command_args





Modified code :




command = f"ffprobe -v error -show_format -show_streams -select_streams v:0 {filepath}"





The rest of the functions :


res = Popen(command, stdout=PIPE)
 output = res.communicate()[0].decode("utf-8")

 if res.returncode != 0:
 output = Popen(command, stdout=PIPE).communicate()[0].decode("utf-8")

 rgx = re.compile(r"(?:(?P.*?):)?(?P<key>.*?)\=(?P<value>.*?)$")
 info = {}

 if sys.platform == 'win32':
 output = output.replace("\r", "")

 for line in output.split("\n"):
 # print(line)
 mobj = rgx.match(line)

 if mobj:
 # print(mobj.groups())
 inner_dict, key, value = mobj.groups()

 if inner_dict:
 try:
 info[inner_dict]
 except KeyError:
 info[inner_dict] = {}
 info[inner_dict][key] = value
 else:
 info[key] = value

 return info
</value></key>


'''


Code of the Dockerfile


'''


FROM python:3.7 as base

EXPOSE 80

WORKDIR /app
COPY . /app


ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

RUN pip install --upgrade pip
RUN echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' >> /etc/apt/sources.list
RUN apt-get update

RUN apt-get -y install ffmpeg
RUN apt-get update

COPY requirements.txt .
RUN python -m pip install -r requirements.txt

FROM base as prod

ENTRYPOINT ["python","manage.py","runserver","0.0.0.0:80"]



'''


-
FFMPEG add text frames to the start of video
22 janvier 2021, par RyanI have some videos either in mp4 or webm format, and I'd like to use ffmpeg to add 4 seconds to the start of each video to display some text in the center with no sound.



Some other requirements :



- 

- try to avoid re-encoding the video
- need to maintain the quality (resolution, bitrate, etc)
- (optional) to make the text fade in/out









I am new to ffmpeg and any help will be appreciated.



thanks in advance



Example ffprobe information for mp4 below :



Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf55.33.100
 Duration: 00:00:03.84, start: 0.042667, bitrate: 1117 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1021 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
 handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 140 kb/s (default)
Metadata:
 handler_name : SoundHandler




Example webm



Input #0, matroska,webm, from 'input.webm':
 Metadata:
 encoder : Lavf55.33.100
 Duration: 00:00:03.80, start: 0.000000, bitrate: 1060 kb/s
 Stream #0:0(eng): Video: vp8, yuv420p, 1280x720, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
 Stream #0:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp (default)