
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 (38)
-
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 -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...) -
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...)
Sur d’autres sites (4313)
-
Electron and NodeJS : Execute shell command asyncronously with live stream
28 septembre 2020, par Bruno FreireElectron : get file conversion percent in real-time :


I wanna run the command
ffmpeg -i video.mp4
(example) to convert a video into another format. But I want to get the conversion percent that is streamed in the process output and get it in my Electron App or NodeJS.

I've tried all methods :
spawn
fork
exec
and all of them return me the last line of the process output. I want a LIVE Stream of each line that is been written, to show the percent progress.

I've tried :


Fork


const {fork} = require('child_process')
 const forked = fork('ffmpeg -i video.mp4');
 forked.on('message', (msg) => {
 console.log(msg);
})



Exec Alternative 1


const execFile = require('child_process').execFile;
 execFile('ffmpeg -i video.mp4', [], (e, stdout, stderr) => {
 if (e instanceof Error){
 console.error(e);
 
 }
 console.log('stdout ', stdout)
 console.log('stderr ', stderr);
})



Exec Alternative 2


const exec = require('child_process').exec;
 exec('ffmpeg -i video.mp4', (error, stdout, stderr) => { 
 console.log(stdout); 
});

/*EXEC Alternative 2*/
const exec = require('child_process').exec;
const proccessing = exec('ffmpeg -i video.mp4');
proccessing.stdout.on('data', function(data) {
 console.log(data); 
});
proccessing.stdout.pipe(process.stdout);



Spawn


const spawn = require('child_process').spawn,
const processing = spawn('ffmpeg -i video.mp4');

processing .stdout.on('data', function (data) {
 console.log('stdout: ' + data.toString());
});

processing .stderr.on('data', function (data) {
 console.log('stderr: ' + data.toString());
});

processing .on('exit', function (code) {
 console.log('code ' + code.toString());
});



SUMMARY :


럎
-
FFmpeg downloading entire live stream when making a small clip
6 février 2021, par stevendesuSetup


I'm using FFmpeg to generate video clips from M3U8 videos. The command looks like this :


ffmpeg -ss <start> -i <1080p-chunklist-url> -c:v copy -c:a copy -t <duration> -f mp4 -y out.mp4
</duration></start>


For example, to create a 30-second clip starting at the 5-minute mark for a particular video, the command would be :


ffmpeg -ss 300 -i https://example.com/path/to/1080p/index.m3u8 -c:v copy -c:a copy -t 30 -f mp4 -y out.mp4



Some caveats I'm already aware of :


- 

- If
-ss
comes after-i
then FFmpeg will attempt to download the entire M3U8 instead of just the relevant TS files, and will parse the entire video contents looking for the exact timestamp. By putting-ss
before -i FFmpeg uses "seek points", which with HLS videos means it looks at the M3U8 and only downloads relevant TS files - TS file boundaries function as "seek points" in HLS, so if a TS file starts at 4:51 and the next TS file starts at 5:01, this command will start the clip at 4:51 instead of 5:01 (it prefers the first seek point before the requested time)
- The
-t
parameter sets an exact clip duration instead of an ending position, so in the above example of a clip starting at 4:51 the same clip would end at 5:21 instead of 5:30








In theory I can utilize
-to
instead of-t
to specify an ending time of 5:30, however in practice this hasn't worked. Also in theory I can force-accurate_seeking
to discard the contents from 4:51 to 5:00 and start the clip where I wanted it, but I learned this only works for transcodes and not transmux

Now to the meat of my problem :


Problem


When the M3U8 URL provided is a live stream (no
#EXT-X-ENDLIST
tag) then FFmpeg does not behave correctly. On FFmpeg versions 4.2.1 and earlier, it starts by downloading the TS file containing my clip segment, then proceeds to download every TS file in the M3U8 then hangs while waiting for new TS files to become available, downloading them as they appear - even hours after the end of the section I wanted to clip. On FFmpeg version 4.2.2 and later, I can create clips so long as they end before the second-to-last TS file. If the live stream currently has 20 minutes of video data and I create a clip from 19:30 - 19:40 (ending right at the start of the second-to-last TS file, assuming a 10-second TS file duration) then it will behave the same as 4.2.1 : waiting infinitely to download the entire video.

The "2 TS files from the end" rule I believe is related to FFmpeg's initial probe of the video to get stream data. In the aforementioned 20-minute long video, if I make a clip from 3:00 to 3:30 (well before the end of the stream) it will first download TS files 119 and 120 (19:40-19:50 and 19:50-20:00), then it displays a list of the streams in the video (audio, video, metadata), then it downloads TS files 19 - 21 (containing the actual data I want for my clip)


Is there a way to fix it so I can properly make clips of sections near the "end" of live M3U8s ?


- If
-
FFmpeg : Cut from live stream RTSP
10 septembre 2020, par Jax2171I cannot solve my problem and I have not found any solution.


I capture an rtsp stream from an ip camera via the command :


ffmpeg -stimeout 2000000 -abort_on empty_output -rtsp_transport tcp -i rtsp://admin:admin@192.168.1.15/av0_0 -c:v copy -c:a aac -f mpegts -y rec.ts



The native video codec is h264 while the audio one is pcm. I capture the video stream without compression and compress the audio in aac to make it compatible with the ts container.


I need to extract portions of video of X duration through during the capture. The command I use is :


ffmpeg -ss X-i rec.ts -c:v copy -c:a copy -t Y -f mp4 -stimeout 60 -y cut.mp4



Everything seems to work fine with no errors. However, the cut file has a slightly longer audio length than the video length. Sometimes the difference can be up to 1 second.


My problem is that I have to chain all the cuts I make, and this difference in duration causes a very annoying lag between one video and another.


It also happens that there is asynchronousness between audio and video in the cuts. The higher the
-ss
value, the more the audio anticipates the video.

I state that I am not a professional but from what I have read it could be a problem of different PTS between audio and video, but I'm not sure. However, I am sure that the problem arises from the capture of the stream perhaps not in accordance with my needs.


How can I solve ?