
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (64)
-
Les images
15 mai 2013 -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (8388)
-
Unhandled Rejection (Error) : ffmpeg.FS('readFile', [fileName]) error. Check if the path exists
20 février 2021, par Rayhan MemonI'm learning how to use FFmpeg.wasm (the JS port of ffmpeg) following the instructions of this example, but adapting it for editing audio files.


I've created a function called 'convertToWAV' (see below) that is called when the 'convert' button is pressed after an mp3 file is uploaded. The function writes the file to FFmpeg's memory as 'test.mp3', converts the file to a wav file named 'test.wav', reads the file, and then creates a URL for the 'test.wav' that can be read by the browser.


I end up getting this error a few seconds after the convert button is pressed :



I don't quite understand the error and the ffmpeg.wasm documentation doesn't indicate that I should be doing things any differently...


Here is the function 'convertToWAV' :


const convertToWAV = async () => {
 //Write the file to FFmpeg's memory as test.mp3
 //It will only stay in memory until the browser is refreshed
 ffmpeg.FS('writeFile', 'test.mp3', await fetchFile(audioFile));

 //Run ffmpeg command
 ffmpeg.run('-i', 'test.mp3', 'test.wav');

 //Read the resulting file
 const data = ffmpeg.FS('readFile', 'test.wav');

 //Create a URL that can be used by the browser
 const url = URL.createObjectURL(new Blob([data.buffer]), { type: 'audio/wav' });

 //set the outputFile state to the url
 setOutputFile(url);
 }



Thank you in advance for the help !


-
Streaming UDP packets to two different ports (for video and audio). Video works fine, but the audio does not show
8 avril 2018, par Winston ChenI am taking a rtsp stream, split the video and audio out, and stream them to two different ports respectively using
gstreamer
so that myffserver
would be able to display the stream on my browser.My gstreamer pipeline :
gst-launch-1.0 -v rtspsrc location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov latency=300 timeout=0 drop-on-latency=true rtp-blocksize=4096 name=rtsp_source ! \
queue ! capsfilter caps="application/x-rtp,media=video" ! rtph264depay ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=9527 rtsp_source. ! \
queue ! rtpmp4apay pt=97 ! udpsink host=127.0.0.1 port=9327Here comes the sdp and my ffmpeg commnad :
m=video 9527 RTP/AVP 96
a=rtpmap:96 H264/90000
c=IN IP4 127.0.0.1
m=audio 9327 RTP/AVP 97
a=rtpmap:97 mpeg4-generic/48000/6
c=IN IP4 127.0.0.1ffmpeg -protocol_whitelist "file,tcp,rtp,udp" -i ~/test.sdp -max_muxing_queue_size 1024 http://localhost:8090/feed1.ffm
And finally, this is my ffserver config (the important part) :
<feed> # This is the input feed where FFmpeg will send
File ./feed1.ffm # video stream.
FileMaxSize 1GB # Maximum file size for buffering video
ACL allow 127.0.0.1 # Allowed IPs
</feed>
<stream> # Output stream URL definition
Feed feed1.ffm # Feed from which to receive video
Format webm
# NoDefaults
# NoAudio
# Audio settings
AudioCodec vorbis
AudioBitRate 64 # Audio bitrate
# Video settings
VideoCodec libvpx
VideoSize 240x160 # Video resolution
VideoFrameRate 10 # Video FPS
AVOptionVideo flags +global_header # Parameters passed to encoder
# (same as ffmpeg command-line parameters)
PreRoll 0
StartSendOnKey
VideoGopSize 12
VideoBitRate 256
</stream>The thing is that if I take away the audio part and apply
NoAudio
, the video streams fine. However, I could not get the audio to work. Am I doing anything wrong ? -
FFmpeg : Splitting video into segments of very small size (e.g. 5KB)
3 avril 2019, par user528827I am trying to split a video file into segments that are less than 10KB (ideally 5KB) using FFmpeg.
The video I am using is this one : https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4. It already has a low resolution.
I have tried specifying a very small -segment_time of 00:00:0.04 :
ffmpeg -i BigBuckBunny_320x180.mp4 -c copy -map 0 -f segment -segment_time 00:00:0.04 BigBuckBunny_320x180_%03d.mp4
I have tried specifying sequential -segment_frames e.g. 1,2,3,4,5,6,7... etc. :
ffmpeg -i BigBuckBunny_320x180.mp4 -c copy -map 0 -f segment -segment_frames 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 -segment_list out.csv BigBuckBunny_320x180_%03d.mp4
I have also tried to force key frames :
ffmpeg -i BigBuckBunny_320x180.mp4 -force_key_frames "expr:gte(t,n_forced*0.04)" -c copy -map 0 -f segment -segment_frames 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 BigBuckBunny_320x180_%03d.mp4
All of these result in segments 0.5s long with varying file sizes averaging about 50KB.
username@My-Air:~/dev/video$ less out.csv
BigBuckBunny_320x180_000.mp4,0.000000,0.500000
BigBuckBunny_320x180_001.mp4,0.500000,1.000000
BigBuckBunny_320x180_002.mp4,1.000000,1.500000
BigBuckBunny_320x180_003.mp4,1.500000,2.000000
BigBuckBunny_320x180_004.mp4,2.000000,2.500000
BigBuckBunny_320x180_005.mp4,2.500000,3.000000
...
username@My-Air:~/dev/video/bunny_0.5s_splits$ ls -l
total 134552
-rw-r--r-- 1 username staff 16K 25 Mar 23:40 BigBuckBunny_320x180_000.mp4
-rw-r--r-- 1 username staff 26K 25 Mar 23:40 BigBuckBunny_320x180_001.mp4
-rw-r--r-- 1 username staff 36K 25 Mar 23:40 BigBuckBunny_320x180_002.mp4
-rw-r--r-- 1 username staff 44K 25 Mar 23:40 BigBuckBunny_320x180_003.mp4
-rw-r--r-- 1 username staff 40K 25 Mar 23:40 BigBuckBunny_320x180_004.mp4
-rw-r--r-- 1 username staff 38K 25 Mar 23:40 BigBuckBunny_320x180_005.mp4
-rw-r--r-- 1 username staff 43K 25 Mar 23:40 BigBuckBunny_320x180_006.mp4
-rw-r--r-- 1 username staff 44K 25 Mar 23:40 BigBuckBunny_320x180_007.mp4
-rw-r--r-- 1 username staff 50K 25 Mar 23:40 BigBuckBunny_320x180_008.mp4
-rw-r--r-- 1 username staff 49K 25 Mar 23:40 BigBuckBunny_320x180_009.mp4
-rw-r--r-- 1 username staff 50K 25 Mar 23:40 BigBuckBunny_320x180_010.mp4
-rw-r--r-- 1 username staff 51K 25 Mar 23:40 BigBuckBunny_320x180_011.mp4
-rw-r--r-- 1 username staff 51K 25 Mar 23:40 BigBuckBunny_320x180_012.mp4
-rw-r--r-- 1 username staff 57K 25 Mar 23:40 BigBuckBunny_320x180_013.mp4
-rw-r--r-- 1 username staff 53K 25 Mar 23:40 BigBuckBunny_320x180_014.mp4
-rw-r--r-- 1 username staff 57K 25 Mar 23:40 BigBuckBunny_320x180_015.mp4
-rw-r--r-- 1 username staff 57K 25 Mar 23:40 BigBuckBunny_320x180_016.mp4
-rw-r--r-- 1 username staff 61K 25 Mar 23:40 BigBuckBunny_320x180_017.mp4
...It’s strange that the timestamps are at exactly 0s and 0.5s. Is this limitation of FFmpeg ? I couldn’t find any documentation to verify this.
Is there any way to get these file sizes down to 5KB ? Is it possible with FFmpeg ? If not, is there another tool I could use ? I looked at GStreamer but couldn’t really see if it was possible and it seems very complicated.
Any help appreciated. Thanks.