
Recherche avancée
Autres articles (38)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (5773)
-
How to 'convert' MP3 file to numpy array or list
30 mai 2021, par Ajayi OlamideI'm working on an audio-related project that connects with Django backend via rest api. Part of the front-end requires to display waveforms of associated mp3 files and for this, it in turn requires optimized data of each mp3 file in form of an array, which the front-end (javascript) then processes and converts to a waveform. I can pick the associated mp3 file from backend storage, the problem is converting it into an array which I can serve to the front-end api. I have tried several methods but none seem to be working. I tried this How to read a MP3 audio file into a numpy array / save a numpy array to MP3 ? which leaves my computer hanging until I forced it to restart by holding the power button down. I have a working ffmpeg and so, I have also tried this Trying to convert an mp3 file to a Numpy Array, and ffmpeg just hangs which continues to raise TypeError on
np.fromstring(data[data.find("data")+4:], np.int16)
. I can't actually say what the problem is and I really hope someone can help. Thank you in advance !

EDIT
This is the django view for retrieving the waveform data :


NB : I've only included useful codes as I'm typing with my mobile phone.


def waveform(self, request, ptype, id):
 project = Project.objects.get(pk=id)
 audio = project.audio

 mp3_path = os.path.join(cdn_dir, audio) 
 cmd = ['ffmpeg', '-i', mp3_path, '-f', 'wav', '-']
 p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, creationflags=0x8000000)
 data = p.communicate()[0]
 array = np.fromstring(data[data.find("data")+4:], np.int16)

 return Response(array)



The TypeError I get is this :

TypeError: argument should be integer or bytes-like object, not "str"


-
Curator of the Samples Archive
13 mai 2011, par Multimedia Mike — GeneralRemember how I mirrored the world-famous MPlayerHQ samples archive a few months ago ? Due to a series of events, the original archive is no longer online. However, me and the people who control the mplayerhq.hu domain figured out how to make samples.mplayerhq.hu point to samples.multimedia.cx.
That means... I’m the current owner and curator of our central multimedia samples repository. Such power ! This should probably be the fulfillment of a decade-long dream for me, having managed swaths of the archive, most notably the game formats section.
How This Came To Be
If you pay any attention to the open source multimedia scene, you might have noticed that there has been a smidge of turmoil. Heated words were exchanged, authority was questioned, some people probably said some things they didn’t mean, and the upshot is that, where once there was one project (FFmpeg), there are now 2 projects (also Libav). And to everyone who has wanted me to mention it on my blog— there, I finally broke my silence and formally acknowledged the schism.
For my part, I was just determined to ensure that the samples archive remained online, preferably at the original samples.mplayerhq.hu address. There are 10 years worth of web links out there pointing into the original repository.
Better Solution
I concede that it’s not entirely optimal to host the repository here at multimedia.cx. While I can offer a crazy amount of monthly bandwidth, I can’t offer rsync (invaluable for keeping mirrors in sync), nor can the server provide anonymous FTP or allow me to offer accounts to other admins who can manage the repository.
The samples archive is also mirrored at samples.libav.org/samples. I understand that service is provided by VideoLAN. Right now, both repositories are known to be static. I’m open to brainstorms about how to improve the situation.
-
cutting mp4 with codec copy results no audio in browser
16 novembre 2020, par LukaI'm editing a video clip with ffmpeg. The original does not play in Firefox browser by itself. It does normally in Chromium. I do something like :


ffmpeg -ss 00:05:10 -i INPUT.mp4 -c copy OUTPUT.mp4



the resulting clip plays in Firefox but there's no audio. This happens in Firefox (82.0.3), but not in Chromium (86.0.4240.75). In chromium the sound is ok.


If audio is reencoded with


ffmpeg -ss 00:05:10 -i INPUT.mp4 -c:v copy -ab 360kb OUTPUT.mp4



resulting clip is playing ok in Firefox.


Could anyone explain what is happening here and is it possible to cut the mp4 without reencoding audio resulting in a clip that plays in Firefox too ?


Some data :


ffmpeg version 3.4.8-0ubuntu0.2


ffprobe INPUT.mp4 :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'INPUT.mp4':
 Metadata:
 major_brand : isom
 minor_version : 1
 compatible_brands: iso4avc1isom
 creation_time : 2020-11-13T18:45:37.000000Z
 com.apple.proapps.clipID: INPUT
 com.blackmagic-design.camera.dateRecorded: 2020:11:13
 com.apple.proapps.cameraName: 0
 com.blackmagic-design.camera.uuid: BDB766E79E646CBB82E3EB986EA1EA-0
 Duration: 02:01:38.00, start: 0.000000, bitrate: 6047 kb/s
 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, 5909 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
 Metadata:
 creation_time : 2020-11-13T18:45:37.000000Z
 handler_name : ?Apple Alias Data Handler
 encoder : H264/AVC
 timecode : 19:45:35:04
 Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
 Metadata:
 creation_time : 2020-11-13T18:45:37.000000Z
 handler_name : ?Apple Alias Data Handler
 timecode : 19:45:35:04
 Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2020-11-13T18:45:37.000000Z
 handler_name : ?Apple Alias Data Handler
 timecode : 19:45:35:04



ffprobe OUTPUT.mp4





Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'OUTPUT.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf57.83.100
 Duration: 01:34:48.02, start: -0.016000, bitrate: 6022 kb/s
 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 5889 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
 Metadata:
 handler_name : VideoHandler
 timecode : 19:45:35:04
 Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
 Metadata:
 handler_name : TimeCodeHandler
 timecode : 19:45:35:04



ffprobe the OUTPUT.mp4 that has audio re-encoded and works in Firefox :


Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf57.83.100
 Duration: 01:34:48.04, start: 0.000000, bitrate: 6160 kb/s
 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 5889 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
 Metadata:
 handler_name : VideoHandler
 timecode : 19:45:35:04
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 265 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
 Metadata:
 handler_name : TimeCodeHandler
 timecode : 19:45:35:04



EDIT :


I'm providing links to original files, but a bit of warning, they are 4-5GB big each :


- 

- original recording from blackmagic switcher/capture/recorder (this does not play in firefox at all, but does in Chromium)
- cut version made with
-codec copy
(plays in firefox but no audio. plays in chromium ok) - cut version with re-encoded audio (plays ok in both firefox and chromium)