
Recherche avancée
Autres articles (80)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (5402)
-
How to compress base64 decoded video data using ffmpeg in django
23 mai 2021, par Sudipto SarkerI want to upload the video/audio file in my django-channels project. So I uploaded video(base64 encoded url) from websocket connection. It is working fine. But now after decoding base64 video data I want to compress that video using ffmpeg.But it showing error like this.
''Raw : No such file or directory''
I used 'AsyncJsonWebsocketConsumer' in consumers.py file.Here is my code :
consumers.py :


async def send_file_to_room(self, room_id, dataUrl, filename):
 # decoding base64 data
 format, datastr = dataUrl.split(';base64,')
 ext = format.split('/')[-1]
 file = ContentFile(base64.b64decode(datastr), name=filename)
 print(f'file: {file}')
 # It prints 'Raw content'
 output_file_name = filename + '_temp.' + ext
 ff = f'ffmpeg -i {file} -vf "scale=iw/5:ih/5" {output_file_name}'
 subprocess.run(ff,shell=True) 



May be here ffmpeg can not recognize the file to be compressed. I also tried to solve this using post_save signal.


signals.py :


@receiver(post_save, sender=ChatRoomMessage)
def compress_video_or_audio(sender, instance, created, **kwargs):
 print("Inside signal")
 if created:
 if instance.id is None:
 print("Instance is not present")
 else:
 video_full_path = f'{instance.document.path}'
 print(video_full_path)
 // E:\..\..\..\Personal Chat Room\media\PersonalChatRoom\file\VID_20181219_134306_w5ow8F7.mp4
 output_file_name = filename + '_temp.' + extension
 ff = f'ffmpeg -i {filename} -vf "scale=iw/5:ih/5" {output_file_name}'
 subprocess.run(ff,shell=True)
 instance.document = output_file_name
 instance.save()



It is also causing "E :..\Django\New_Projects\Personal : No such file or directory".
How can I solve this issue ? Any suggetions.It will be more helpful if it can be compressed before saving the object in database. Thanks in advance.


-
Encountered an exception of ffmpeg.wasm can only run one command at a time
2 mars 2023, par Itay113I want to make a video chat using ffmepg wasm (I know the standard is WebRTC but my assignment is to do this with ffmpeg wasm and a server connecting the 2 clients) and when doing the follow code I am getting ffmpeg.wasm can only run one command at a time exception on the ffmpegWorker.run line


function App() {
 const ffmpegWorker = createFFmpeg({
 log: true
 })

 async function initFFmpeg() {
 await ffmpegWorker.load();
 }

 async function transcode(webcamData) {
 const name = 'record.webm';
 await ffmpegWorker.FS('writeFile', name, await fetchFile(webcamData));
 ffmpegWorker.run('-i', name, '-preset', 'ultrafast', '-c:v', 'h264', '-crf', '28', '-b:v', '0', '-row-mt', '1', '-f', 'mp4', 'output.mp4')
 .then(()=> {

 const data = ffmpegWorker.FS('readFile', 'output.mp4');
 
 const video = document.getElementById('output-video');
 video.src = URL.createObjectURL(new Blob([data.buffer], { type: 'video/mp4' }));
 ffmpegWorker.FS('unlink', 'output.mp4');
 })
 }

 function requestMedia() {
 const webcam = document.getElementById('webcam');
 const chunks = []
 navigator.mediaDevices.getUserMedia({ video: true, audio: true })
 .then(async (stream) => {
 webcam.srcObject = stream;
 await webcam.play();
 const mediaRecorder = new MediaRecorder(stream);
 mediaRecorder.start(0);
 mediaRecorder.onstop = function(e) {
 stream.stop(); 
 }
 mediaRecorder.ondataavailable = async function(e) {
 chunks.push(e.data);
 await transcode(new Uint8Array(await (new Blob(chunks)).arrayBuffer()));
 
 }
 })
 }

 useEffect(() => {
 requestMedia();
 }, [])

 return (
 <div classname="App">
 <div>
 <video width="320px" height="180px"></video>
 <video width="320px" height="180px"></video>
 </div>
 </div>
 );
}



I have tried messing around with the time slice on the media recorder start method argument but it didn't helped


-
ffmpeg rtmp streaming process exit
12 août 2013, par SamsonI'm using ffmpeg to capture jpeg images from an rtmp stream. Here is the command I use :
/usr/local/bin/ffmpeg -threads 4 -i rtmp://..../chat/mp4:<variable>.mp4
-q:v 0.6 -r 15 -s 320x240 /frames/10021237_data/frame-%0999d.jpg
ffmpeg version N-55388-g9386f33 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 8 2013 14:07:38 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
configuration:
libavutil 52. 41.100 / 52. 41.100
libavcodec 55. 24.100 / 55. 24.100
libavformat 55. 13.102 / 55. 13.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 82.100 / 3. 82.100
libswscale 2. 4.100 / 2. 4.100
libswresample 0. 17.103 / 0. 17.103
Input #0, flv, from 'rtmp://......./mp4:10021237.mp4':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1.92 tbr, 1k tbn, 40 tbc
Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
[swscaler @ 0x1910000] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/frames/10021237_data/frame-%0999d.jpg':
Metadata:
encoder : Lavf55.13.102
Stream #0:0: Video: mjpeg, yuvj420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 15 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
</variable>However after a few minutes I get this line (before the process exits) :
video:5264kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.000408%
What exactly is the "muxing overhead" and why is it causing a crash ? Can I solve this or get it some other way (by restarting the process when it exits) ?
EDIT :
Actually it's not a crash. I'm running this command from a PHP CLI when a stream starts :
$command = "/usr/local/bin/ffmpeg -i ".$rtmp." -q:v 0.6 -r 12 -s 320x240 ".__DIR__."/".$dir."/".$naming." >/dev/null 2>/dev/null &";
shell_exec($command);but when one stops streaming all the ffmpeg processes end. Is there a way to make them independent ?
Even opening 2 terminals and running the command (with different rtmp s)in each (for different streams), killing one of them closes the other one also.
Bottom line is : How can I make 2 ffmpeg instances independent so as killing one does not kill the other. Is this behaviour expected ?