
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (60)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (10347)
-
Recording audio with MediaRecorder on iPhone with Safari and Chrome only 1 second long ? Mimetype and FFMPEG problem ?
9 mai 2023, par AvatarI am using MediaRecorder to record the Microphone audio on a website.


Javascript :


var blob;
var blob_url;
var stream;
var recorder;
var chunks;

var media = {
 tag: 'audio',
 type: 'audio/ogg',
 ext: '.ogg',
 gUM: {audio: true}
};

navigator.mediaDevices.getUserMedia(media.gUM).then(_stream => 
{
 stream = _stream;

 recorder = new MediaRecorder(stream);

 recorder.ondataavailable = e => 
 {
 // push data to chunks
 chunks.push(e.data);

 // recording has been stopped
 if(recorder.state == 'inactive') 
 {
 // audio data available
 blob = new Blob(chunks, {type: media.type });
 blob_url = URL.createObjectURL(blob);
 
 // send data to server
 uploadfile_audio();
 }
 };

 if(typeof(recorder)=='undefined')
 {
 alert('No microphone access');
 return;
 }

 chunks = [];
 recorder.start();
}


// when stop button is clicked
recorder.stop();
stream.getTracks().forEach( track => track.stop() );



The audio stream (ogg format) is sent to the server.


Since iPad/iPhone do not play ogg files, the recording file is converted to "mp3" using FFMPEG.


This file is stored on the server.



This works on Windows and MAC (Chrome and Safari), also on iPad (Safari) but not properly on iPhone (Chrome/Safari). Version : iPhone iOS 15.1.


On iPhone the recording file is only
0:01 min
in length. Size is always17277
Bytes.

What could be the issue ? (I cannot debug because I don't have a Mac.)


Does the stream get interrupted ? Is the recording stopped after 1 second ?


Update 1 :


I have checked the incoming filesize of the browser-recorded file serverside. It seems to be coming in properly, because there are different sizes such as 184 kB.


My guess is now that FFMPEG cannot handle the incoming file correctly. Which might have the wrong mimetype set in Javascript with
type: 'audio/ogg',
. Is another format needed ?

The conversion code serverside :


PHP


$mp3file = shell_exec("ffmpeg -i ".$file_locationtmp." -vn -ar 44100 -ac 2 -b:a 128k ".$file_locationtmp.".mp3");



I would need to find out the audio recording format used by iPhone but I couldn't.


I tried to find the supporting mimetypes using https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported - however, it shows that NO mimetypes are supported on iPhone (neither in Chrome nor Safari).


Update 2 :


I used
ffprobe
to get the recording file information. It saysStream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 2234 kb/s (default)


Update 3 :


It seems to be a problem with FFMPEG. See my new question How to convert AAC/MP4A to MP3 using FFMPEG in full length ? Audio file gets cut off after 1 second


-
Converting Quicktime (.mov ) from iPhone to mp4
24 mars 2020, par user3094755On iPhones running iOS 11, if a video is pre-recorded and uploaded I get the following errors :- ( ie, the video is recoded on the iPhone and then uploaded as an attachment ).
$ ./ffmpeg -i .mov -vcodec h264 -acodec mp4 test-output.mp4
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
Mac OSX universal build for ffmpegX
configuration: --enable-memalign-hack --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver --enable-a52 --enable-xvid --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb --enable-pthreads --enable-x264
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Apr 15 2006 04:58:19, gcc: 4.0.1 (Apple Computer, Inc. build 5250)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5597b8]mov: header not found !!! (err:0, moov:0, mdat:0) pos:3189455560
.mov: Error while opening file
$If the video is recorded and then transferred to a Desktop uploaded and then converted it works OK.
If I use a ‘live’ recording then all is OK.
I found this…
Which seems to suggest iOS 11 will use different formats, but this appears to make no difference whatever the settings are for ‘High Efficiency / Most Compatible’.
Any ideas ?
-
Creating iPhone compatible video with ffmpeg from an image and MP3 file
22 février 2020, par GracieI have the following command that I have used to create an MP4 video file from an image and an MP3 file, it plays fine in a Chrome browser on desktop and on an Android phone - but it doesn’t work on an iPhone 10. Do I need some extra codec or setting to make this compatible for iPhone ? Should I be converting this into a MPEG file instead for wider compatibility ?
ffmpeg -loop 1 -i 6f4aa5dfefc4dd32186f41315ad9d1e2-0.png -i "music.mp3" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest aa-image0.mp4
Here are the ffprobe details for the input MP3 file used to create the MP4 video and also the ffprobe for that output file :
Input #0, wav, from 'download0.mp3':
Duration: 00:00:35.94, bitrate: 384 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 24000 Hz, 1 channels, s16, 384 kb/sInput #0, mov,mp4,m4a,3gp,3g2,mj2, from 'aa-image0.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.22.100
Duration: 00:00:38.76, start: 0.000000, bitrate: 505 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2664x1498 [SAR 1:1 DAR 1332:749], 367 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 138 kb/s (default)
Metadata:
handler_name : SoundHandlerThe video seems to play on the iPhone, but the audio seems to start/stop constantly. Like it is a streaming issue (even though it is not). Maybe an MP3 encoding issue when I created the video ?
Here are the test files I have used and created (any iPhone users will likely find the MP4 will not play the audio in the video properly) :
https://ffmpeg-iphone-issue.netlify.com/tesla.jpg
https://ffmpeg-iphone-issue.netlify.com/tesla.mp3
https://ffmpeg-iphone-issue.netlify.com/tesla.mp4 (OUTPUT - Created from the 2 files above)
In summary, two FFmpeg commands are required :
1) Used to create iPhone/iOS compatible videos in FFmpeg from an image and MP3 (A slight modification to the command at the top of the page)
and
2) An FFmpeg command that could be used to fix or re-encode the video above so that it works on iPhone (A new command incorporating the parts so it works with iPhone and then to rebuild and fix the "broken" video. In a similar fashion to this video where he fixes a broken video https://www.youtube.com/watch?v=2FhmbKKh6mc [command in Youtube description])