
Recherche avancée
Autres articles (56)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (7702)
-
Live streaming doesn't work
18 octobre 2017, par John SmithI’m using FFmpeg to capture my screen :
ffmpeg -f dshow -i video="UScreenCapture" -r 5 -s 640x480 -acodec libmp3lame -ac 1 -vcodec mpeg 4 -vtag divx -q 10 -f mpegts tcp://127.0.0.1:1234
so let it stream to somewhere. The accepter script :
error_reporting(E_ALL); /* Allow the script to hang around waiting for connections. */
set_time_limit(30); /* Turn on implicit output flushing so we see what we're getting as it comes in. */
ob_implicit_flush();
$address = '127.0.0.1';
$port = 1234;
$outfile = dirname(__FILE__)."/output.flv";
$ofp = fopen($outfile, 'wb');
if (($sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) { echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n"; sleep (5); die; }
if (socket_bind($sock, $address, $port) === false) { echo "socket_bind() failed: reason: " . socket_strerror(socket_last_error($sock)) . "\n"; sleep (5); die; }
if (socket_listen($sock, 5) === false) { echo "socket_listen() failed: reason: " . socket_strerror(socket_last_error($sock)) . "\n"; sleep (5); die; }
if (($msgsock = socket_accept($sock)) === false) { echo "socket_accept() failed: reason: " . socket_strerror(socket_last_error($sock)) . "\n"; sleep (5); break; }
do {
$a = '';
socket_recv ($msgsock, $a, 65536, MSG_WAITALL);
fwrite ($ofp, $a);
//echo strlen($a)."\r\n";
} while (true);it seems to save the stuff to the disk OK. Now here comes the html :
I dont really know how to do this, but based on an example :
<video src="/output.flv"></video>
but it doesn’t do anything. And if I want to stream the live incoming stuff, then what’s the matter ?
-
Rotate 90 and concatenate videos with ffmpeg
20 avril 2024, par leonpI have several videos made in landscape and portrait modes. I want to concatenate them into one movie.


For this I rotated portrait videos with :


ffmpeg -i in.mp4 -vf transpose=1 out.mp4 



Built the list of files to concatenate and concatenated all of them with :


ffmpeg -safe 0 -f concat -i list.txt -c copy output.mp4 



The result is unplayable. All players hang/crash at the first switch from landscape to rotated portrait fragment.


What do I do wrong ?


In reply to LordNeckbeard request :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2017-07-20T12:50:32.000000Z
 Duration: 00:00:30.36, start: 0.000000, bitrate: 20202 kb/s
 Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 20005 kb/s, SAR 1:1 DAR 16:9, 29.45 fps, 29.42 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 creation_time : 2017-07-20T12:50:32.000000Z
 handler_name : VideoHandle
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s (default)
 Metadata:
 creation_time : 2017-07-20T12:50:32.000000Z
 handler_name : SoundHandle

Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2017-07-24T13:57:42.000000Z
 Duration: 00:00:31.94, start: 0.000000, bitrate: 20171 kb/s
 Stream #1:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 19997 kb/s, SAR 1:1 DAR 16:9, 29.43 fps, 29.42 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 rotate : 90
 creation_time : 2017-07-24T13:57:42.000000Z
 handler_name : VideoHandle
 Side data:
 displaymatrix: rotation of -90.00 degrees
 Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s (default)
 Metadata:
 creation_time : 2017-07-24T13:57:42.000000Z
 handler_name : SoundHandle

At least one output file must be specified```



-
FFmpeg hangs on buffer fill c++
2 mars 2021, par Derek HaldenI'm processing a bunch of frames from an RTSP stream using ffmpeg. I end up doing a lot of processing on these frames, which means that I'm not always pulling in real-time. If the buffer gets full, the process hangs. I'm wondering if one of the following solutions is feasible/fixes the problem, and if so, how I would implement it using the ffmpeg libraries :



1) Is there a way to clear the buffer if I ever reach a point where it's hanging ? (I can determine when it's hung, I just don't know what to do about it).



2) Is there a way to make the buffer overwrite the old data, and just always read the most recent data ? It doesn't matter to me if I lose frames.



3) I've already discovered that I can make the buffer arbtrarily large with :
av_dict_set(&avd, "buffer_size", "655360", 0);
. This could be a solution, but I don't know how large/small it needs to be, because I don't know how long the stream will post video for ?


4) Is this just a bug that I need to bring up with the ffmpeg people ?



5) Something else I haven't considered ?



while(av_read_frame(context, &(packet)) >= 0 && fcount < fps*SECONDS) {
 clock_t start, end;
 int ret = avcodec_send_packet(codec_context, packet);
 if(!(packet->stream_index == video_stream_index)) {
 continue;
 }

 if (ret == AVERROR(EAGAIN) || ret == AVERROR(EINVAL)) {
 continue;
 } else if (ret < 0) {
 cerr << "Error while decoding frame " << fcount << endl;
 exit(1);
 }

 ret = avcodec_receive_frame(codec_context, frame);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR(EINVAL)) {
 continue;
 } else if (ret < 0) {
 cerr << "Error while decoding frame " << fcount << endl;
 exit(1);
 }

 sws_scale(img_convert_ctx, frame->data, frame->linesize, 0,
 codec_context->height, picture_rgb->data, picture_rgb->linesize);

 if(!frame) {
 cerr << "Could not allocate video frame" << endl;
 exit(1);
 }

 if(codec_context == NULL) {
 cerr << "Cannot initialize the conversion context!" << endl;
 exit(1);
 }

 // Do something with the frame here

 fcount++;
 av_packet_unref(&(packet));

}




I have added the code that causes the program to hang.