
Recherche avancée
Autres articles (66)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (6989)
-
FFMPEG RTMP STREAM RECORDING TIMEOUT
11 novembre 2020, par abreski[SOLVED] — solution in FINAL EDIT
i am recording an rtmp livestream with ffmpeg, and looking to add a flag that will automatically stop processing the moment new data stops arriving.


If i start and stop the script (stop by killing the process on demand), everything is fine, recording is saved and can be played.
However, when the stream is stopped from the source without a manual call to STOP, the script will still run for a bit and the resulting file will be corrupted (tested with manual stop call - works , and with stopping the stream before the recording , simulating browser/tab close or disconnect - fails)


the command i'm running


$command = "ffmpeg -i {$rtmpUrl} -c:v copy -c:a copy -t 3600 {$path} >/dev/null 2>/dev/null &";
$res = shell_exec($command)



i tried adding -timeout 0 option before and after the input like this


$command = "ffmpeg -timeout 0 -i {$rtmpUrl} -c:v copy -c:a copy -t 3600 {$path} >/dev/null 2>/dev/null &"; 



and


$command = "ffmpeg -i {$rtmpUrl} -c:v copy -c:a copy -timeout 0 -t 3600 {$path} >/dev/null 2>/dev/null &";



but no improvement.


What am i missing here ? is there any way to automatically stop the script when new data stops ariving from the livestream (meaning that stream is stopped and recording should stop aswell).


Note $rtmpUrl and $path have been checked and everything works fine as long as the script is stopped before the livestream ends.


Any suggestions are highly appreciated


LATER EDIT : realised timeout was set in the wrong place, added it first but result was still the same, so still looking for any suggestions


$command = "timout 0 ffmpeg -i {$rtmpUrl} -c:v copy -c:a copy -t 3600 {$path} >/dev/null 2>/dev/null &";



FINAL EDIT
in case someone finds this thread looking for a solution in a similar case,
solved, timeout was not what i was looking for, instead using the
-re
flag fixed it for us.
Now script stops when no more new frames come in

$command = "ffmpeg -re -i {$rtmpUrl} -c:v copy -c:a copy -t 3600 {$path} >/dev/null 2>/dev/null &";



-
What is the optimal way to synchronize frames in ffmpeg c/c++ ?
16 septembre 2022, par TurgutI made a program that read's n number of video's as input, draws those videos to the GLFW window and finally encodes it all as a singular video output. The problem is frames of each video in question can be different, it's dependent on the user's input.


For example : the user can put two video's which has an FPS of 30 and 59, and can want an output 23,797. The problem is those video's are not in sync with each other, thus on the output we can see that the input video's are either faster or slower.


Duration of each video is also dependent on the input. For example, in accordance to the previous example, the first input might be 30 second and the second can be 13 second, while the output is 50 seconds.


I mostly read the frames similar to a moving png rather than a solid video since there are no iframe and bframes. There are just data I get from the GLFW window.


As an example, let's say we give one video as input which has an FPS of 30 and duration of 30, and our output has an FPS of 23.797 and duration of 30. I have 2 function's
skip_frame
andwait_frame
which respectively either read's a frame twice so we skip a frame or don't read the frame on that iteration. Those function's are used depending on the situation, whether it's output < input or output > input.

Here is what my code roughly looks like :


while(current_time < output_duration){
 for(auto input_video: all_inputs){
 for(int i = 0; i < amount_to_read_from_input(); i++){
 frame = input_video.read_frame();
 }
 }
 
 GLFW_window.draw_to_screen(frame);

 encoder.encode_one_video_frame(GLFW_window.read_window());
}



Basically
skip_frame
andwait_frame
are both insideamount_to_read_from_input()
and return 2 or 0 respectively.

So far I have tried multiplying duration with fps for both input and output. Then getting the result of their subtraction. Going from our previous example we get 900 - 714 = 186.
Then I divide the result to the output fps like so : 714 / 186 = 3.8. Meaning that I have to skip a frame every 3.8 iterations. (I skip a frame every 3 iterations and save the residual 0.8 for the next iter.)


But it's still a seconds or two behind. (Like it ends at 29 seconds for a 30 second output.) and the audio is out-of-sync. Ffmpeg handles my audio so there are no errors on that part.


Also seen this question but I don't think I can utilize ffmpeg's function's here since im reading from a glfw window and it comes down to my algorithm.


The problem is what is the math here ?


What can I do to make sure these frames are stabilized on almost every input/output combination ?


-
Different code(.java file) for different platform ?
2 mars 2016, par AR792I have a code where image data is passed from bitmap to FFmpeg frame recorder and converted to a video. But i need to make small changes while running it on LG G3(armv7) from Asus zenfone 5(x86).
Following are the class variables that create the issue :(declared under, class Main Activity)
inputWidth = 1024 ;
inputHeight = 650 ;
Following is the method where the issue occurs :
byte [] getNV21(int inputWidth, int inputHeight, Bitmap bitmap) {
int [] argb = new int[inputWidth * inputHeight];
bitmap.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight);
byte [] yuv = new byte[inputWidth*inputHeight*3/2];
encodeYUV420SP(yuv, argb, inputWidth, inputHeight);
return yuv;
}
void encodeYUV420SP(byte[] yuv420sp, int[] argb, int width, int height) {
final int frameSize = width * height;
int yIndex = 0;
int uvIndex = frameSize;
int a, R, G, B, Y, U, V;
int index = 0;
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
a = (argb[index] & 0xff000000) >> 24; // a is not used obviously
R = (argb[index] & 0xff0000) >> 16;
G = (argb[index] & 0xff00) >> 8;
B = (argb[index] & 0xff) >> 0;
// well known RGB to YUV algorithm
Y = ( ( 66 * R + 129 * G + 25 * B + 128) >> 8) + 16;
U = ( ( -38 * R - 74 * G + 112 * B + 128) >> 8) + 128;
V = ( ( 112 * R - 94 * G - 18 * B + 128) >> 8) + 128;
// NV21 has a plane of Y and interleaved planes of VU each sampled by a factor of 2
// meaning for every 4 Y pixels there are 1 V and 1 U. Note the sampling is every other
// pixel AND every other scanline.
yuv420sp[yIndex++] = (byte) ((Y < 0) ? 0 : ((Y > 255) ? 255 : Y));
if (j % 2 == 0 && index % 2 == 0) {
yuv420sp[uvIndex++] = (byte)((V<0) ? 0 : ((V > 255) ? 255 : V));
yuv420sp[uvIndex++] = (byte)((U<0) ? 0 : ((U > 255) ? 255 : U));
}
index ++;
}
}
}Working CODE :
LG G3 :I can use the above variables at any place in the code to get the required output.
Bitmap size returned = 2734200Asus Zenfone 5 : Except at creating the bitmap, I have to use everywhere else bitmap.getHeight() and bitmap.getWidth(), to get the required output.
Surprisingly here Bitmap size returned = 725760 (So its not setting according to set bitmap parameters ?)
INCORRECT CODE :
LG G3 : IF i use bitmap.getHeight() and bitmap.getWidth(), i get java.lang.ArrayIndexOutOfBoundsException : length = 102354 , index = 102354. @getNV21 method
Asus Zenfone 5 : If i use inputWidth , inputHeight i get
java.lang.IllegalArgumentException : x + width must be <= bitmap.width() @getNV21 methodHow can i generalize the above code for both phones ?