
Recherche avancée
Autres articles (48)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Initialisation de MediaSPIP (préconfiguration)
20 février 2010, parLors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
Dans un premier temps il active ou désactive des options de SPIP qui ne le (...) -
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.
Sur d’autres sites (8069)
-
Using FFmpeg to detect alpha channel in PR4444 file [closed]
8 décembre 2023, par Justin MyersI wanted to comment on a thread that already exists on this topic in general, but I just signed up to SO and have not earned my contribution credits yet ! If anyone has advice on how to better handle that in the future, I am all ears !!


None-the-less, here is that thread :


A good way to detect alpha channel in a video using ffmpeg/ffprobe


I tried both the answers listed in that post to detect the presence of an alpha channel in a PR4444 video file.


For Gyan's answer, I get the following pixel format from any PR4444 file (regardless if encoded with alpha or no alpha), when running part 1 :


yuva444p12le


As you will see in Gyan's notes, even if a FFprobe returns an "a" in the return string (for the call for pixel format), that does not equate to the presence of an alpha channel. Hence their note for the subsequent (part 2) call...


I then plugged that into the part 2 of Gyan's answer, but that produced an empty from FFmpeg, and a message providing valid arguments to pair with grep. It seems as though -oP is not a valid arg for grep ? Because it wasn't listed in the returned list of options. This is the template I used (pulled verbatim from Gyan's posted solution) :


ffprobe -v 0 -show_entries pixel_format=name:flags=alpha -of compact=p=0 | grep "$PIX_FMT|" | grep -oP "(?<=alpha=)\d"


Where $PIX_FMT is to be replaced with yuva444p121e (per Gyan's instructions).


I then tried Benji's solution for part 2, but that just returns the following :


pix_fmt=yuva444p12le


Of course, this isn't any more useful than part 1...


I suspect Gyan is on the right track as he mentions part 2 should produce a boolean result for the presence of an alpha channel. However, either I am misunderstanding the syntax of his template, or something has changed in FFprobe since. There is so limited information out there for this specific task. Hoping someone with more experience and knowledge can help shed some light for me ??


-
Matplotlib animation error : Requested MovieWriter (ffmpeg) not available, while ffmpeg is installed
3 juillet 2020, par Vivien BonnotI'm trying to animate colormapping representations of parametric complex fonctions using Python.
I gradually put some things together, and checked that they worked properly. But I can't get the animation to be saved.


I encountered this error :


Requested MovieWriter (ffmpeg) not available


However, ffmpeg is indeed installed on my system,
on Windows console
ffmpeg -version
returns all sorts of informations about ffmpeg. Additionnaly, I also installed ffmpeg in Python scripts directory using pippip install ffmpeg
, which was successfull. I also set up ffmepg path in my code :plt.rcParams['animation.ffmpeg_path'] = "C:\FFmpeg\bin\ffmpeg.exe"


I'm runing out of ideas.


Here is my code.
Thank you for reading.


import numpy as np
import math
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation
pi=math.pi
plt.rcParams['animation.ffmpeg_path'] = "C:\FFmpeg\bin\ffmpeg.exe"
fig = plt.figure()

def complex_array_to_rgb(X, theme='dark', rmax=None):
 absmax = rmax or np.abs(X).max()
 Y = np.zeros(X.shape + (3,), dtype='float')
 Y[..., 0] = np.angle(X) / (2 * pi) % 1
 if theme == 'light':
 Y[..., 1] = np.clip(np.abs(X) / absmax, 0, 1)
 Y[..., 2] = 1
 elif theme == 'dark':
 Y[..., 1] = 1
 Y[..., 2] = np.clip(np.abs(X) / absmax, 0, 1)
 Y = matplotlib.colors.hsv_to_rgb(Y)
 return Y

# Set up formatting for the movie files
Writer = animation.writers['ffmpeg']
writer = Writer(fps=15, metadata=dict(artist='Me'), bitrate=1800)

fps = 10
nSeconds = 1
snapshots = [ complex_array_to_rgb(np.array([[3*(x + 1j*y)**(2.9+p/300) + 1/(x + 1j*y)**2 for x in np.arange(-1,1,0.05)] for y in np.arange(-1,1,0.05)])) for p in range( nSeconds * fps ) ]

fig = plt.figure( figsize=(3,3) )

Z2=snapshots[0]
im=plt.imshow(Z2, extent=(-1,1,-1,1))

def animate_func(i):
 if i % fps == 0:
 print( '.')

 im.set_array(snapshots[i])
 return [im]
 
anim = animation.FuncAnimation(
 fig, 
 animate_func, 
 frames = nSeconds * fps,
 interval = 1000 / fps, # in ms
 )

anim.save('test_anim.mp4', writer=writer)



-
Problem updating drawtext with file using ffmpeg [duplicate]
17 novembre 2020, par drmobbinsI have a shell script that runs to combine a 24/7 AAC audio stream with a 720p HD picture/background and streams that output live to YouTube. This is for an internet radio station. The script works perfectly except for the
drawtext
option. Thedrawtext
option references a file that is updated every 15 seconds (using Python and Cron) with the correct song metadata (from the radio automation suite) and is supposed to print the contents of the metadata file to the screen. This happens one time when theffmpeg
command is run in the script, but doesn't update after a song change.

I would assume that since the metadata file is changing every 15 seconds on the server that it would update the song details in the output video that could be seen on YouTube...but it doesn't.


#!/bin/bash

#Quality settings
VBR="1500k"
FPS="30"
QUAL="ultrafast"
AUDIO_ENCODER="aac"

#Youtube settings
YOUTUBE_URL=" rtmp://a.rtmp.youtube.com/live2"
YOUTUBE_KEY="xxxx-xxxx-xxxx-xxxx-xxxx"

#Sources
VIDEO_SOURCE="bg720p.jpg"
AUDIO_SOURCE="http://stream.url"

#Metadata settings
TRACK_METADATA=$(cat metadata.txt)

ffmpeg \
 -loop 1 \
 -re \
 -framerate $FPS \
 -i "$VIDEO_SOURCE" \
 -thread_queue_size 512 \
 -i "$AUDIO_SOURCE" \
 -vf "drawtext=fontfile=OpenSans-Light.ttf:text=$TRACK_METADATA:x=10:y=680:fontsize=20:fontcolor=white" \
 -c:v libx264 -tune stillimage -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS *2)) -b:v $VBR \
 -c:a $AUDIO_ENCODER -threads 6 -ar 44100 -b:a 64k -bufsize 512k -pix_fmt yuv420p \
 -f flv $YOUTUBE_URL/$YOUTUBE_KEY



What am I missing that will make the output continually check for file changes and use
drawtext
to display the contents. Thanks in advance !