
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (29)
-
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 -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (5445)
-
ffmpeg wasm - how to take client-side created mp4 and upload it to the same server hosting the index/js files being used
29 juillet 2022, par John FarrellOk, so Im an IT guy and kind of a noob on the dev side of the fence. But I've been able to create this ffmpeg wasm page that takes a canvas and converts it to webm / and .mp4 — what i WANT to do is take the resulting .mp4 file and upload it to the server where the page/js are being served from. is this possible ? I will include my source code which is fairly simple and straight forward, I just don't know how to manipulate the resulting mp4 file that ffmpeg spits out (i realize it is happening client side) to be able to push it up to the server (maybe with aupload.php type situation ?) the solution can be html/java/php whatever, so long as it takes the mp4 output and gets it onto the server. I'd VERY MUCH appreciate a hand here.


Going to try my best to properly insert the html and js. please bear with me if i've done something wrong, i've never had to -ask- a question on here, usually just look up existing answers.




const { createFFmpeg } = FFmpeg;
const ffmpeg = createFFmpeg({
 log: true
});

const transcode = async (webcamData) => {
 const message = document.getElementById('message');
 const name = 'record.webm';
 await ffmpeg.load();
 message.innerHTML = 'Start transcoding';
 await ffmpeg.write(name, webcamData);
 await ffmpeg.transcode(name, 'output.mp4');
 message.innerHTML = 'Complete transcoding';
 const data = ffmpeg.read('output.mp4');

 const video = document.getElementById('output-video');
 video.src = URL.createObjectURL(new Blob([data.buffer], { type: 'video/mp4' }));
 dl.href = video.src;
 dl.innerHTML = "download mp4"
}

fn().then(async ({url, blob})=>{
 transcode(new Uint8Array(await (blob).arrayBuffer()));
})

function fn() {
var recordedChunks = [];

var time = 0;
var canvas = document.getElementById("canvas");

return new Promise(function (res, rej) {
 var stream = canvas.captureStream(60);

 mediaRecorder = new MediaRecorder(stream, {
 mimeType: "video/webm; codecs=vp9"
 });

 mediaRecorder.start(time);

 mediaRecorder.ondataavailable = function (e) {
 recordedChunks.push(event.data);
 // for demo, removed stop() call to capture more than one frame
 }

 mediaRecorder.onstop = function (event) {
 var blob = new Blob(recordedChunks, {
 "type": "video/webm"
 });
 var url = URL.createObjectURL(blob);
 res({url, blob}); // resolve both blob and url in an object

 myVideo.src = url;
 // removed data url conversion for brevity
 }

// for demo, draw random lines and then stop recording
var i = 0,
tid = setInterval(()=>{
 if(i++ > 20) { // draw 20 lines
 clearInterval(tid);
 mediaRecorder.stop();
 }
 let canvas = document.querySelector("canvas");
 let cx = canvas.getContext("2d");
 cx.beginPath();
 cx.strokeStyle = 'green';
 cx.moveTo(Math.random()*100, Math.random()*100);
 cx.lineTo(Math.random()*100, Math.random()*100);
 cx.stroke();
},200)

});
}





<code class="echappe-js"><script src="https://unpkg.com/@ffmpeg/ffmpeg@0.8.1/dist/ffmpeg.min.js" defer></script>

<script src='http://stackoverflow.com/feeds/tag/canvas2mp4.js' defer></script>




here is a canvas




here is a recorded video of the canvas in webM format





here is a transcoded mp4 from the webm above CLIENT SIDE using ffmpeg














-
FFMPEG decoding artifacts between keyframes
13 avril 2015, par OddlyOrdinaryI’m currently experiencing artifacts when decoding video using ffmpegs api. On what I would assume to be intermediate frames, artifacts build slowly only from active movement in the frame. These artifacts build for 50-100 frames until I assume a keyframe resets them. Frames are then decoded correctly and the artifacts proceed to build again.
One thing that is bothering me is I have a few video samples that are 30fps(h264) that work correctly, but all of my 60fps videos(h264) experience the problem.
I don’t currently have enough reputation to post an image, so hopefully this link will work.
http://i.imgur.com/PPXXkJc.jpgint numBytes;
int frameFinished;
AVFrame* decodedRawFrame;
AVFrame* rgbFrame;
//Enum class for decoding results, used to break decode loop when a frame is gathered
DecodeResult retResult = DecodeResult::Fail;
decodedRawFrame = av_frame_alloc();
rgbFrame = av_frame_alloc();
if (!decodedRawFrame) {
fprintf(stderr, "Could not allocate video frame\n");
return DecodeResult::Fail;
}
numBytes = avpicture_get_size(PIX_FMT_RGBA, mCodecCtx->width,mCodecCtx->height);
uint8_t* buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
avpicture_fill((AVPicture *) rgbFrame, buffer, PIX_FMT_RGBA, mCodecCtx->width, mCodecCtx->height);
AVPacket packet;
while(av_read_frame(mFormatCtx, &packet) >= 0 && retResult != DecodeResult::Success)
{
// Is this a packet from the video stream?
if (packet.stream_index == mVideoStreamIndex)
{
// Decode video frame
int decodeValue = avcodec_decode_video2(mCodecCtx, decodedRawFrame, &frameFinished, &packet);
// Did we get a video frame?
if (frameFinished)// && rgbFrame->pict_type != AV_PICTURE_TYPE_NONE )
{
// Convert the image from its native format to RGB
int SwsFlags = SWS_BILINEAR;
// Accurate round clears up a problem where the start
// of videos have green bars on them
SwsFlags |= SWS_ACCURATE_RND;
struct SwsContext *ctx = sws_getCachedContext(NULL, mCodecCtx->width, mCodecCtx->height, mCodecCtx->pix_fmt, mCodecCtx->width, mCodecCtx->height,
PIX_FMT_RGBA, SwsFlags, NULL, NULL, NULL);
sws_scale(ctx, decodedRawFrame->data, decodedRawFrame->linesize, 0, mCodecCtx->height, rgbFrame->data, rgbFrame->linesize);
//if(count%5 == 0 && count < 105)
// DebugSavePPMImage(rgbFrame, mCodecCtx->width, mCodecCtx->height, count);
++count;
// Viewable frame is a struct to hold buffer and frame together in a queue
ViewableFrame frame;
frame.buffer = buffer;
frame.frame = rgbFrame;
mFrameQueue.push(frame);
retResult = DecodeResult::Success;
sws_freeContext(ctx);
}
}
// Free the packet that was allocated by av_read_frame
av_free_packet(&packet);
}
// Check for end of file leftover frames
if(retResult != DecodeResult::Success)
{
int result = av_read_frame(mFormatCtx, &packet);
if(result < 0)
isEoF = true;
av_free_packet(&packet);
}
// Free the YUV frame
av_frame_free(&decodedRawFrame);I’m attempting to build a queue of the decoded frames that I then use and free as needed. Is my seperation of the frames causing the intermediate frames to be decoded incorrectly ? I also break the decoding loop once I’ve successfully gathered a frame(Decode::Success, most examples I’ve seen tend to loop through the whole video.
All codec contect, video stream information, and format contexts are setup up exactly as shown in the main function of https://github.com/chelyaev/ffmpeg-tutorial/blob/master/tutorial01.c
Any suggestions would be greatly appreciated.
-
Attempting to concat with FFMpeg but failing
11 mars 2020, par GloriousRezI’ve been trying to create a php app that more or less acts as a video editor. I’d like my users to insert both images and videos and then concat these in a certain order and add music. I’ve decided to utilize ffmpeg for this purpose.
I’ve succeeded in making mp4s of these images and add music to the mp4s with the following commands
$ ffmpeg -r 0.1 -i %05d.morph.jpg output.mp4
$ ffmpeg -i output.mp4 -i audio.mp3 -c:v copy -c:a aac -b:a 128k final.mp4This produces decent results. But this is where the issues start.
I’ve been attempting to concat these created mp4s (WITHOUT music) but cannot seem to do so. Nor can I even concat them with a duplicate of themselves.
(I’ve been using the concat demuxer as indicated in this link : How to concatenate two MP4 files using FFmpeg ?)$ cat mylist.txt
file 'output.mp4'
file 'vid1.mp4'
file 'output2.mp4'
$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy outputSemi.mp4The result is a video (of the appropriate length), however only the first video is played, and repeated over and over, often with green screens mixing between the frames.
Any help would be helpful.
Figure I should include the result of the concat command
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc70f00bc00] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'mylist.txt':
Duration: N/A, start: 0.000000, bitrate: 1507 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 4864x3648 [SAR 1:1 DAR 4:3], 1507 kb/s, 0.10 fps, 0.10 tbr, 16384 tbn, 0.20 tbc
Metadata:
handler_name : VideoHandler
File 'outputFFMPEG.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'outputFFMPEG.mp4':
Metadata:
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 4864x3648 [SAR 1:1 DAR 4:3], q=2-31, 1507 kb/s, 0.10 fps, 0.10 tbr, 16384 tbn, 16384 tbc
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc70e80b600] Auto-inserting h264_mp4toannexb bitstream filter
frame= 5 fps=0.0 q=-1.0 Lsize= 9543kB time=00:00:40.00 bitrate=1954.4kbits/s speed= 169x
video:9542kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.009467%