
Recherche avancée
Autres articles (98)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (9488)
-
I'm having problem encoding video using Laravel FFMPEG to save it to Minio storage
8 juillet 2022, par Ibrahim AhmadI am trying to convert video from .mp4 extension into HLS format (.m3u8) using Laravel FFMPEG.


FFMpeg::fromDisk('minio')
 ->open($videoFile)
 ->exportForHLS()
 ->onProgress(function ($percentage) use ($movie) {
 Cache::put('progress-' . $movie->id, $percentage);

 if($percentage >= 100) {
 Cache::forget('progress-' . $movie->id);
 }
 })
 ->toDisk('minio')
 ->addFormat($lowBitrate, function (HLSVideoFilters $filter) {
 $filter->resize(480, 360);
 })
 ->addFormat($midBitrate, function (HLSVideoFilters $filter) {
 $filter->resize(852, 480);
 })
 ->addFormat($highBitrate, function (HLSVideoFilters $filter) {
 $filter->resize(1920, 1080);
 })
 ->save($newFile);



I have a .mp4 video stored in Minio S3 storage, want to export to Minio S3 storage again. And I came up with this error


RecursiveDirectoryIterator::__construct(C:\Windows\Temp/52325dd01cfde90a\): Access is deni (code: 5)



What does the error message say ? But when I export the video file to local, it works totally fine. How do I solve this problem. Thanks.


Update :
The export process requires windows temporary folder, and I cleared the temporary folder, the problem is solved for now. This probably the temporary folder can't hold many files.


-
What do I need in order to save animation videos from matplotlib in mp3 format ?
27 juin 2022, par DarthMallocI am using python3.8 on Linux Mint 19.3, and I am trying to save an animation created by a cellular automata model in matplotlib. My actual code for the model is private, but it uses the same code for saving the animation as the code shown below, which is a slight modification of one of the examples shown in the official matplotlib documentation :


import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation

fig, ax = plt.subplots()


def f(x, y):
 return np.sin(x) + np.cos(y)

x = np.linspace(0, 2 * np.pi, 120)
y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1)

fig, ax = plt.subplots()


 
ims = []
for i in range(60):
 x += np.pi / 15.
 y += np.pi / 20.
 im = ax.imshow(f(x, y), animated=True)
 if i == 0:
 ax.imshow(f(x, y)) # show an initial one first
 ims.append([im])

ani = animation.ArtistAnimation(fig, ims, interval=50, blit=True,
 repeat_delay=1000)

 # To save the animation, use e.g.
 #
 # ani.save("movie.mp4")
 #
 # or
 #
writer = animation.FFMpegWriter(fps=15, metadata=dict(artist='Me'), bitrate=1800)
ani.save("movie.mp3", writer=writer)



When executed, the code produces this error :


MovieWriter stderr:
 Output file #0 does not contain any stream

 Traceback (most recent call last):
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 234, in saving
 yield self
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 1093, in save
 writer.grab_frame(**savefig_kwargs)
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 351, in grab_frame
 self.fig.savefig(self._proc.stdin, format=self.frame_format,
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/figure.py", line 3046, in savefig
 self.canvas.print_figure(fname, **kwargs)
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/backend_bases.py", line 2319, in print_figure
 result = print_method(
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/backend_bases.py", line 1648, in wrapper
 return func(*args, **kwargs)
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/_api/deprecation.py", line 415, in wrapper
 return func(*inner_args, **inner_kwargs)
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/backends/backend_agg.py", line 486, in print_raw
 fh.write(renderer.buffer_rgba())
 BrokenPipeError: [Errno 32] Broken pipe

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
 File "/home/justin/animation_test.py", line 36, in <module>
 ani.save("movie.mp3", writer=writer)
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 1093, in save
 writer.grab_frame(**savefig_kwargs)
 File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
 self.gen.throw(type, value, traceback)
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 236, in saving
 self.finish()
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 342, in finish
 self._cleanup() # Inline _cleanup() once cleanup() is removed.
 File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 373, in _cleanup
 raise subprocess.CalledProcessError(
 subprocess.CalledProcessError: Command '['ffmpeg', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-s', '640x480', '-pix_fmt', 'rgba', '-r', '15', '-loglevel', 'error', '-i', 'pipe:', '-vcodec', 'h264', '-pix_fmt', 'yuv420p', '-b', '1800k', '-metadata', 'artist=Me', '-y', 'movie.mp3']' returned non-zero exit status 1.
</module>


I have looked at posts on similar queries concerning matplotlib animations, but none have specifically included the error
Output file #0 does not contain any stream
. I have little experience with ffmpeg, so I am wondering what might be missing.

-
Cannot remove the video file created through ffmpeg save
29 juin 2022, par lightIt gives this error :
os.remove("output.mp4")
PermissionError : [WinError 32] The process cannot access the file because it is being used by another process : 'output.mp4


I am first downloading a reddit video (with separate audio and video file) by joining audio and video files together using ffmpeg


with open("video.mp4", "wb") as f:
 g = requests.get(video_url, stream=True)
 f.write(g.content)

 with open("audio.mp3", "wb") as f:
 g = requests.get(audio_url, stream=True)
 f.write(g.content)

 os.system("ffmpeg -i video.mp4 -i audio.mp3 -c copy output.mp4")
 os.remove("audio.mp3")
 os.remove("video.mp4")



After this I am uploading it to YouTube Using YouTube Api and then finally deleting it from the system. I tried everything I thought would solve this error.


os.system("exit")
 os.system("echo 'q' >stop") 
 os.system("exit()")
 os.remove("output.mp4")



But it gives me Permission Error. Please help me with this problem I have no idea what could be wrong.


This is the method I am using to upload the file to YouTube.


request_body = {
 'snippet': {
 'categoryI': 19,
 'title': f'{item.title}',
 'description': description,
 'tags': Tags
 },
 'status': {
 'privacyStatus': 'public',
 'publishAt': upload_date_time,
 'selfDeclaredMadeForKids': False, 
 },
 'notifySubscribers': False
 }


 mediaFile = MediaFileUpload(r"output.mp4")

 response_upload = service.videos().insert(
 part='snippet,status',
 body=request_body,
 media_body=mediaFile
 ).execute