
Recherche avancée
Autres articles (55)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
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 -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (9104)
-
FFProbe generated data don't seem to agree with calculated data using ffmpeg libraries
18 janvier 2020, par ark1974Using ffmpeg library avformat I am trying to check if the ffprobe generated data agrees with the data generated by the library. The code objective is to try to seek to the nearest key frame. When trying to seek at 100 frame or less, the codes returns 0 all the time.
When trying to seek at 200 frame, the codes returns 4 all the time. But the result ie 4th frame don’t seem to be right. Where am I wrong ? Is my time_base conversion to actual frame faulty ?The test result using ffprobe
Filename = test.mp4
Duration = 00:00:10.56
Fps = 25
Total frames = 256
The key frames pkt_pts_time are at 2.120000 and 0.000000 (using -skip_frame nokey )
Corresponding pkt_duration_time: 0.040000 and 0.040000 ( same, why?)Abstract of the code :
// Objective: seek to the nearest key frame
frameIndex = 200;
int64_t timeBase = (int64_t(pCodecCtx->time_base.num) * AV_TIME_BASE) / int64_t(pCodecCtx->time_base.den);
int64_t seekTarget = int64_t(frameIndex) * timeBase;
if (av_seek_frame(pFormatCtx, -1, seekTarget, AVSEEK_FLAG_FRAME | AVSEEK_FLAG_BACKWARD) < 0) return -1;
//convert the time_base to actual frame
auto time2frame = [&](int64_t tb) {
return tb * int64_t(pCodecCtx->time_base.den) / (int64_t(pCodecCtx->time_base.num) * AV_TIME_BASE);
};
AVPacket avPacket;
int result = av_read_frame(pFormatCtx, &avPacket);
if (result == 0) {
auto dts = avPacket.dts;
auto pts = avPacket.pts;
auto idx = avPacket.stream_index;
auto f = time2frame(pts); // expecting the actual frame here
std::cout << dts << pts << idx << f;
} -
Merge pull request #253 from zeroclipboard/origins-array-bug
17 octobre 2013, par jonrohanMerge pull request #253 from zeroclipboard/origins-array-bug
Array.push returns a number, not an array.
-
Spawned ffmpeg process in nodejs Transform stream with flow control doesn't process input stream
30 septembre 2022, par user1832894I have implemented a node.js Transform stream class that spawns ffmpeg and streams out the transformed stream at a controlled realtime rate. Below is my _transform() method.


this.rcvd += chunk.length
console.log('received bytes %d', this.rcvd)
const ready = this.ffmpeg.stdin.write(chunk, encoding, err => err
 ? cb(err)
 : ready
 ? cb
 : this.ffmpeg.stdin.once('drain', cb))



I want to write to ffmpeg's stdin stream till it returns false, at which point I wait for the drain event to write more data.


Concurrently, I have a timer that fires every 40 milliseconds that reads ffmpeg's stdout and pushes it to the Transform stream's output (the readable side). Code not complete, but the folllowing describes it well.


const now = Date.now()
const bytesToTransmit = (now - this.lastTx) * 32

const buf = this.ffmpeg.stdout.read()

if (buf == null) return

if (buf.length <= bytesToTransmit) {
 this.push(buf)
 this.lastTx += buf.length * 32
 return
}

this.push(buf.slice(0, bytesToTransmit))
this.lastTx = now

// todo(handle pending buffer)
this.pending = buf.slice(bytesToTransmit)



The issue I am facing is that the first write (of 65k bytes) returns false, and after that I never receive the drain event. FFMpeg doesn't start processing the data until certain amount of data (256k bytes in my case) has been written, and once I start waiting for the drain event, I never recover control.


I've tried a few ffmpeg options like nobuffer but to no avail. What am I doing wrong ? Any ideas would be super helpful.


Thanks !