
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (47)
-
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 (...) -
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 (7652)
-
avcodec.h and avfiltergraph.h files are not found
12 avril 2019, par Dries JansI’m testing out a RTSP encoded stream transmitter using mpeg4. I found the code from this topic : FFMPEG to send RTSP encoded stream C++
I think there is a problem with different build versions. I’m using the
4.1.1 build.I’ve already tried to use the avcodec header in the libavcodec directory, but I have no idea if this is correct because I can’t find a replacement for the avfiltergraph header. I tried replacing it with avfilter header, but this gave an error on the CODEC_ID_H264.
#include <libavfilter></libavfilter>avfiltergraph.h>
#include <libavfilter></libavfilter>avcodec.h>You also need to execute next command to provide an listening service.
ffplay -rtsp_flags listen -i rtsp://127.0.0.1:8554/live.sdp
-
How to get the correct result file data if I use Web Worker on ffmpeg.js ?
23 avril 2019, par SuperBerryI have tried to use FFMPEG.js (https://github.com/Kagami/ffmpeg.js) to convert mp3 files on the browser/client side, and I followed the usage of the page of Web Worker. However, the worker works well on the converting and it seems the file has been converted, but I cannot get the correct result file data back.
Here my code is :
<code class="echappe-js"><script><br />
<br />
var stdout = "";<br />
var outputhtml="";<br />
var stderr = "";<br />
var outputfile;<br />
<br />
var sampleVideoData;<br />
<br />
function retrieveSampleVideo() {<br />
var oReq = new XMLHttpRequest();<br />
oReq.open("GET", "short.mp3", true);<br />
oReq.responseType = "arraybuffer";<br />
<br />
oReq.onload = function (oEvent) {<br />
var arrayBuffer = oReq.response;<br />
if (arrayBuffer) {<br />
sampleVideoData = new Uint8Array(arrayBuffer);<br />
}<br />
};<br />
<br />
oReq.send(null);<br />
}<br />
<br />
function getDownloadLink(fileData, fileName) {<br />
var a = document.createElement('a');<br />
a.download = fileName;<br />
var blob = new Blob([fileData]);<br />
var src = window.URL.createObjectURL(blob);<br />
a.href = src;<br />
a.textContent = 'Click here to download ' + fileName + "!";<br />
document.body.appendChild(a);<br />
}<br />
<br />
var worker = new Worker("ffmpeg-worker-mp4.js");<br />
<br />
retrieveSampleVideo();<br />
<br />
var memfs =[]; <br />
<br />
//[, {name: "input.mp3", data: output}];<br />
<br />
worker.onmessage = function(e) {<br />
var msg = e.data;<br />
<br />
switch (msg.type) {<br />
case "ready":<br />
console.log("ready: " + msg.data);<br />
alert(sampleVideoData.length);<br />
memfs.push({name: "input.mp3", data: sampleVideoData});<br />
memfs.push({name: "output.mp3", data: outputfile});<br />
<br />
worker.postMessage({type: "run", MEMFS: memfs, arguments: ["-i", "input.mp3", "-y", "output.mp3"]});<br />
<br />
<br />
break;<br />
case "stdout":<br />
console.log("stdout: " + msg.data);<br />
stdout += msg.data + "\n";<br />
outputhtml+=msg.data + "<br>";<br />
<br />
break;<br />
case "stderr":<br />
console.log("stderr: " + msg.data);<br />
stderr += msg.data + "\n";<br />
outputhtml+=msg.data + "<br>";<br />
<br />
break;<br />
<br />
case "exit":<br />
<br />
console.log("Process exited with code " + msg.data);<br />
console.log(stdout);<br />
document.write(outputhtml);<br />
<br />
getDownloadLink(outputfile, "output.mp3");<br />
worker.terminate();<br />
<br />
<br />
break;<br />
}<br />
};<br />
<br />
</script>And the console output looks good :
stderr: ffmpeg version n3.1.2 Copyright (c) 2000-2016 the FFmpeg developers index.html:66:4
stderr: built with emcc (Emscripten gcc/clang-like replacement) 1.36.7 () index.html:66:4
stderr: configuration: --cc=emcc --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-avfilter --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vp8 --enable-decoder=vp9 --enable-decoder=theora --enable-decoder=mpeg2video --enable-decoder=mpeg4 --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=png --enable-decoder=mjpeg --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=ac3 --enable-decoder=aac --enable-decoder=ass --enable-decoder=ssa --enable-decoder=srt --enable-decoder=webvtt --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=avi --enable-demuxer=mov --enable-demuxer=flv --enable-demuxer=mpegps --enable-demuxer=image2 --enable-demuxer=mp3 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl --disable-securetransport --disable-xlib --disable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags=-I../lame/dist/include --extra-ldflags=-L../lame/dist/lib index.html:66:4
stderr: libavutil 55. 28.100 / 55. 28.100 index.html:66:4
stderr: libavcodec 57. 48.101 / 57. 48.101 index.html:66:4
stderr: libavformat 57. 41.100 / 57. 41.100 index.html:66:4
stderr: libavfilter 6. 47.100 / 6. 47.100 index.html:66:4
stderr: libswscale 4. 1.100 / 4. 1.100 index.html:66:4
stderr: libswresample 2. 1.100 / 2. 1.100 index.html:66:4
stderr: [mp3 @ 0x812380] Warning: not compiled with thread support, using thread emulation index.html:66:4
stderr: Input #0, mp3, from 'input.mp3': index.html:66:4
stderr: Metadata: index.html:66:4
stderr: encoder : Lavf57.66.101 index.html:66:4
stderr: Duration: 00:00:03.02, start: 0.023021, bitrate: 128 kb/s index.html:66:4
stderr: Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s index.html:66:4
stderr: Metadata: index.html:66:4
stderr: encoder : Lavc57.75 index.html:66:4
stderr: [mp3 @ 0x8240f0] Warning: not compiled with thread support, using thread emulation index.html:66:4
stderr: [libmp3lame @ 0x81b8a0] Warning: not compiled with thread support, using thread emulation index.html:66:4
stderr: [mp3 @ 0x80b0f0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. index.html:66:4
stderr: Output #0, mp3, to 'output.mp3': index.html:66:4
stderr: Metadata: index.html:66:4
stderr: TSSE : Lavf57.41.100 index.html:66:4
stderr: Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p index.html:66:4
stderr: Metadata: index.html:66:4
stderr: encoder : Lavc57.48.101 libmp3lame index.html:66:4
stderr: Stream mapping: index.html:66:4
stderr: Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame)) index.html:66:4
stderr: Press [q] to stop, [?] for help index.html:66:4
stderr: size= 47kB time=00:00:03.00 bitrate= 129.6kbits/s speed=10.9x index.html:66:4
stderr: video:0kB audio:47kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.489831% index.html:66:4
Process exited with code 0I have set the output into the memfs in the code :
memfs.push(name : "output.mp3", data : outputfile) ;
But I cannot get the result file data in outputfile to create the blob downloadd link.
-
Stream h264 to javafx possibly using javacv/ffmpeg
4 octobre 2018, par cagneyI’m really stuck on getting a video stream to play on a java fx project.
— Short version :
I’m streaming h264/avcc flavor video from an android phone to a desktop computer. However javafx doesn’t have an easy solution for displaying stream. I’m attempting to use javacv / ffmpeg in an attempt to make this work. However I am getting errors from ffmpeg.
1) Is there a better way to display streaming video on javafx ?
2) Do you have a sample project or good tutorial for javacv ffmpegframegrabber ?
3) I think I may be missing some small detail in mycode but Im not sure what i would be.
— Longer Version :
1) On the android end Im getting video using mediarecorder. In order to get the sps/pps info I record and save a small movie to the device and then parse the sps and pps data.
2) Next, on the android, I split up the nalus to meet MTU req and send them over a udp connection to my desktop
3)On my desktop I reassmble the nalus( or trash them if they loose data) and feed those to an input stream that I gave to the framegreabber constructor.
— The Code and Logs :
The errors are long and numerous depending on the flavor I feed it. Here are two separate examples which are usually repeated at great length
[h264 @ 0000020225907a40] non-existing PPS 0 referenced
[h264 @ 0000020225907a40] decode_slice_header error
[h264 @ 0000020225907a40] no frame!
[h264 @ 00000163d8637a40] illegal aspect ratio
[h264 @ 00000163d8637a40] pps_id 3412 out of range
[AVBSFContext @ 00000163e28a0e00] Invalid NAL unit 0, skipping.!! One big caveat that I am aware off is that I have not implemented timestamps
which I created on the android device when feeding ffmpeg. I think it should still show distorted images without this thoughBecause I have spent all day guessing and trying I have several "flavors" of data I have shoved through. I am only showing the first section of each nal which I believe if correct would at least show a garbage image as long as my sps and pps are right
sps: 67 80 80 1E E9 01 68 22 FD C0 36 85 09 A8
pps: 68 06 06 E2Below is annex B style.
These were each prefixed with either 00 00 01 and 00 00 00 01Debug transfer 65 B8 40 0B E5 B8 7B 80 5B 85
Debug transfer 41 E2 20 7A 74 34 3B D6 BE FA
Debug transfer 41 E4 40 2F 01 E0 0C 06 EE 91
Debug transfer 41 E6 60 3E A1 20 5A 02 3C 6D
Debug transfer 41 E8 80 13 B0 B9 82 C3 03 F4
Debug transfer 41 EC C0 1B A3 0C 28 F1 B0 C8
Debug transfer 41 EE E0 1F CE 07 30 EE 05 06
Debug transfer 41 F1 00 08 ED 80 9C 20 09 73
Debug transfer 41 F3 20 09 E9 00 86 60 21 C3
VideoDecoderaddPacket type: 24
Debug transfer 67 80 80 1E E9 01 68 22 FD C0
Debug transfer 68 06 06 E2
Debug transfer 65 B8 20 00 9F 80 78 00 12 8A
Debug transfer 41 E2 20 09 F0 1E 40 7B 0C E0
Debug transfer 41 E4 40 09 F0 29 30 D6 00 AE
Debug transfer 41 E6 60 09 F1 48 31 80 99 40
[h264 @ 000001c771617a40] non-existing PPS 0 referencedHere I tried Avcc style. You can see the first line is the combination of the sps pps followed by idr and then repeated non idr
Debug transfer 18 00 0E 67 80 80 1E E9 01 68
Debug transfer 00 02 4A 8F 65 B8 20 00 9F C5
Debug transfer 00 02 2F DA 41 E2 20 09 E8 0F
Debug transfer 00 02 2C 34 41 E4 40 09 F4 20
Debug transfer 00 02 4D 92 41 E6 60 09 FC 2B
Debug transfer 00 02 47 02 41 E8 80 09 F0 72
Debug transfer 00 02 52 50 41 EA A0 09 EC 0F
Debug transfer 00 02 58 8A 41 EC C0 09 FC 6F
Debug transfer 00 02 55 F9 41 EE E0 09 FC 6E
Debug transfer 00 02 4D 79 41 F1 00 09 F0 3E
Debug transfer 00 02 4D B6 41 F3 20 09 E8 64The following class is where I try to get javacv/ffmpeg to show the video. I dont think its an ideal solution and am researching canvasfram as a replacement to the image view.
public class ImageDecoder {
private final static String TAG = "ImageDecoder ";
private ImageDecoder(){
}
public static void streamImageToImageView(
final ImageView view,
final InputStream inputStream,
final String format,
final int frameRate,
final int bitrate,
final String preset,
final int numBuffers
)
{
System.out.println("Image Decoder Starting...");
try( final FrameGrabber grabber = new
FFmpegFrameGrabber(inputStream))
{
final Java2DFrameConverter converter = new Java2DFrameConverter();
grabber.setFrameNumber(frameRate);
grabber.setFormat(format);
grabber.setVideoBitrate(bitrate);
grabber.setVideoOption("preset", preset);
grabber.setNumBuffers(numBuffers);
System.out.println("Image Decoder waiting on grabber.start...");
grabber.start(); //---- this call is blocking the loop
System.out.println("Image Decoder Looping---------------------------
-------- hit stop");
while(!Thread.interrupted()){
//System.out.println("Image Decoder Looping");
final Frame frame = grabber.grab();
if (frame != null){
final BufferedImage bufferedImage =
converter.convert(frame);
if (bufferedImage != null){
Platform.runLater(() ->
view.setImage(SwingFXUtils.toFXImage(bufferedImage, null)));
}else{
System.out.println("no buf im");
}
}else{
System.out.println("no fr");
Thread.currentThread().interrupt();
}
}
}catch (Exception e){
System.out.print(TAG + e);
}
}
}Any help is greatly appreciated.