
Recherche avancée
Autres articles (60)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
Les images
15 mai 2013 -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (7320)
-
Use ffmpeg to stream live content to azure media services
19 mars 2018, par DadicoolI’ve been trying to stream content to azure media services using ffmpeg as it’s one of the options described here : http://azure.microsoft.com/blog/2014/09/18/azure-media-services-rtmp-support-and-live-encoders/
My command is :
ffmpeg -v verbose -i 300.mp4 -strict -2 -c:a aac -b:a 128k -ar 44100 -r 30 -g 60 -keyint_min 60 -b:v 400000 -c:v libx264 -preset medium -bufsize 400k -maxrate 400k -f flv rtmp://nessma-****.channel.mediaservices.windows.net:1935/live/584c99f5c47f424d9e83ac95364331e7
I have made sure that the streaming endpoint has one active streaming unit, I also made sure that the channel is actually Ready and I even get it to start streaming (which makes a PublishURL available).
When I execute the ffmpeg command to start streaming, I keep getting the following error :
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 30 2014 11:31:18 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --arch=x86_64 --enable-runtime-cpudetect
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Routing option strict to both codec and muxer layer
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9a0a002c00] overread end of atom 'colr' by 1 bytes
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9a0a002c00] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9a0a002c00] max_analyze_duration 5000000 reached at 5003637 microseconds
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '300.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2014-01-11 05:39:32
genre : Trailer
artist : Warner Bros.
title : 300: Rise of an Empire - Trailer 2
encoder : HandBrake 0.9.9 2013051800
date : 2014
Duration: 00:02:33.24, start: 0.000000, bitrate: 7377 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 (1920x1088), 7219 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)
Metadata:
creation_time : 2014-01-11 05:39:32
encoder : JVT/AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 157 kb/s (default)
Metadata:
creation_time : 2014-01-11 05:39:32
Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 101x150 [SAR 72:72 DAR 101:150], 90k tbr, 90k tbn, 90k tbc
rtmp://nessma-****.channel.mediaservices.windows.net:1935/live/584c99f5c47f424d9e83ac95364331e7: Input/output errorThe Azure blog post clearly states that this should be possible but I can’t find a working example anywhere.
Environment :
- MacOS Maverick
- FFMPEG installed from official build
- 300.mp4 : 1080p trailer of the latest 300 movie
-
How can a desktop node.js app play audio that may be controlled by the user like a media player ? [closed]
19 février, par eedefeedI'm building a playlist manager that plays music. How can Node.JS play audio files quickly, reliably and with all the basic level features you would expect from a media player, namely :


- 

- play
- pause
- seek
- stop
- adjust volume












I'm targetting windows/linux, but a Windows-only solution but be okay (for now.)


I have tried a number of libraries and methods to play audio but it seems none of them are good enough :


- 

- Audic : it's reasonably good, but buggy. The play and pause functions sometimes get switched around. I also recall that there are some issues with uncaught exceptions somewhere in the dependencies that crash the entire app.
- OBS : since the app is designed with broadcasting in mind, I've tried to use OBS's API to get it to play media. Unfortunately, it sometimes stops playback during some tracks, which is surprising since its underlying library, FFmpeg, plays them without issue.
- node-groove : seems like its underlying library, libgroove, only supports linux. I can't find any builds to download, regardless.








Attempts to use Speaker (which seems pretty good) have also failed because all the decoders have big issues :


- 

- Anything using lame - I want support for all audio, not specific formats.
- fluent-FFmpeg - this is a wrapper around FFmpeg's CLI interface. It has no play/pause function, but bonus library fluent-FFmpeg-util adds this feature. Unfortunately, its pause takes about 4 seconds to work, which I'm guessing is to do with a buffer being exhausted. This is just too latent. Seek would also work by stopping the CLI process and reloading the file, which seems massively inefficient.
- Node Vlc - promising but ancient library that gives me reams of node-gyp errors on install. Poorly documented and no explanation of what the library to do
- VLC Client - this library has uncaught exceptions that crash the app. Wrapping in try/catch doesn't help.
- sound play - doesn't support play/pause












NPM's search function is filled with audio players designed to work in browsers, but I'm not building a web app. I guess it's an option but it seems inelegant to the point of rediculous.


So it seems the best option centres around FFmpeg. FFmpeg has libraries, and I'm aware that node has ways to hook into those libraries via some sort of C or C++ compatibility layer. Unfortunately, official documentation is rather dense. Different unofficial guides seem to be recommending conflicting approaches (and might be dated), and it's difficult to work out whether myriad technologies are working in tandem or are alternatives, renames or replacements : node-gyp, node-api, addons, windows-build-tools, nan, C vs C++, Visual Studio. It's difficult to make any decisions or know where to start.


Perhaps, also, another option is to use a Python library to interact with FFmpeg, since initial searches have indicated this might be possible. I wouldn't know whether this is a good option.


So my question is : what's my best option to play audio ? Is it another NPM module that I'm not aware of ? Is it a compatibility layer with FFmpeg libraries ?


-
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.