
Recherche avancée
Autres articles (49)
-
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 (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (6152)
-
FFmpeg somehow set the udp speed ?
19 juin 2018, par potu1304I wanted to nearly live stream my Unit game with FFmpeg to a simple client. I have one Unity game in which each frame is saved as an jpg image. These images are wrapped in ffmpeg and send over udp to a simple c# client where I use ffplay to play the stream. The problem is, that FFmpeg is wrapping the images way faster than the unity app can write them. So ffmpeg quits but Unity is still writing frames. Is there a way to set ffmpeg in a loop to wait for the next image or can I somehow make a for loop without call every time ffmpeg ?
Here is my function from my capturing script in Unity :
Process process;
//BinaryWriter _stdin;
public void encodeFrame()
{
ProcessStartInfo startInfo = new ProcessStartInfo();
var basePath = Application.streamingAssetsPath + "/FFmpegOut/Windows/ffmpeg.exe";
info.Arguments = "-re -i screen_%d.jpg -vcodec libx264 -r 24 -f mpegts udp://127.0.0.1:1100";
info.RedirectStandardOutput = true;
info.RedirectStandardInput = true;
info.RedirectStandardError = true;
info.CreateNoWindow = true;
info.UseShellExecute = false;
info.RedirectStandardError = true;
UnityEngine.Debug.Log(string.Format(
"Executing \"{0}\" with arguments \"{1}\".\r\n",
info.FileName,
info.Arguments));
process = Process.Start(info);
//_stdin = new BinaryWriter(process.StandardInput.BaseStream);
process.WaitForExit();
var outputReader = process.StandardError;
string Error = outputReader.ReadToEnd();
UnityEngine.Debug.Log(Error);
}And here the function from my cs file from my simple windowsform application :
private void xxxFFplay()
{
text = "start";
byte[] send_buffer = Encoding.ASCII.GetBytes(text);
sock.SendTo(send_buffer, endPoint);
ffplay.StartInfo.FileName = "ffplay.exe";
ffplay.StartInfo.Arguments = "udp://127.0.0.1:1100";
ffplay.StartInfo.CreateNoWindow = true;
ffplay.StartInfo.RedirectStandardOutput = true;
ffplay.StartInfo.UseShellExecute = false;
ffplay.EnableRaisingEvents = true;
ffplay.OutputDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
ffplay.ErrorDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
ffplay.Exited += (o, e) => Debug.WriteLine("Exited", "ffplay");
ffplay.Start();
Thread.Sleep(500); // you need to wait/check the process started, then...
// child, new parent
// make 'this' the parent of ffmpeg (presuming you are in scope of a Form or Control)
//SetParent(ffplay.MainWindowHandle, this.panel1.Handle);
// window, x, y, width, height, repaint
// move the ffplayer window to the top-left corner and set the size to 320x280
//MoveWindow(ffplay.MainWindowHandle, -5, -300, 320, 280, true);
}Does have somebody some ideas ? I am really stuck at this to create a somehow "live" stream.
Best regards
-
Gstreamer channel reordering failed
31 octobre 2017, par user972851I installed the library essentia which causes my previously working pipeline to crash :
** (gst-launch-1.0:22515): CRITICAL **: gst_audio_reorder_channels: assertion 'size % ((info->width * channels) / 8) == 0' failed
ERROR: from element /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0: Channel reordering failed.
Additional debug info:
gstrtpL16depay.c(276): gst_rtp_L16_depay_process (): /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0The pipeline looks like this :
udpsrc port=5000 ! application/x-rtp,media=(string)audio,channels=1, clock-rate=(int)44100,encoding-name=(string)L16,payload=10 ! rtpL16depay ! audioconvert ! tee name=t ! queue ! autoaudiosink sync=false t. ! queue ! appsink name=codesink
I am using gstreamer 1.0 on Ubuntu 16.04 and (re-)installed the libraries mentioned in the essentia doc :
build-essential libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev libtag1-dev
python-numpy-dev python-numpy python-yaml
ffmpegThe essentia install script finished ’successfully’ even though I cannot find MonoLoader or any other Audioloader.... (so still something wrong with essentia as well, but thats not the main problem !)
Cleaned out parts of the gstreamer debug log look like this :
0:00:00.149495849 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin106>[00m g_dir_open(/dev/v4l2) failed: Error opening directory '/dev/v4l2': No such file or directory
0:00:00.149807870 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/home/xxx/.frei0r-1/lib) failed: Error opening directory '/home/xxx/.frei0r-1/lib': No such file or directory
0:00:00.149823765 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib/x86_64-linux-gnu/frei0r-1) failed: Error opening directory '/usr/lib/x86_64-linux-gnu/frei0r-1': No such file or directory
0:00:00.149836069 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib/frei0r-1) failed: Error opening directory '/usr/lib/frei0r-1': No such file or directory
0:00:00.149847527 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/local/lib/frei0r-1) failed: Error opening directory '/usr/local/lib/frei0r-1': No such file or directory
0:00:00.149859202 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib32/frei0r-1) failed: Error opening directory '/usr/lib32/frei0r-1': No such file or directory
0:00:00.149870221 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/local/lib32/frei0r-1) failed: Error opening directory '/usr/local/lib32/frei0r-1': No such file or directory
0:00:00.149881462 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib64/frei0r-1) failed: Error opening directory '/usr/lib64/frei0r-1': No such file or directory
0:00:00.149893070 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/local/lib64/frei0r-1) failed: Error opening directory '/usr/local/lib64/frei0r-1': No such file or directory
0:00:00.186559327 [334m22515[00m 0xf93a80 [33;01mWARN [00m [00m rtpL16depay gstrtpL16depay.c:276:gst_rtp_L16_depay_process:<rtpl16depay0>[00m error: Channel reordering failed.
0:00:00.186574584 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01;37;41m GST_MESSAGE gstelement.c:1848:gst_element_message_full:<rtpl16depay0>[00m start
0:00:00.186589070 [334m22515[00m 0xf93a80 [36mINFO [00m [00;01;31;47m GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<rtpl16depay0>[00m posting message: Channel reordering failed.
0:00:00.186619665 [334m22515[00m 0xf93a80 [33;01mWARN [00m [00m structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
0:00:00.186613247 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:311:gst_bus_post:<bus1>[00m [msg 0xfc44c0] posting on bus error message: 0xfc44c0, time 99:99:99.999999999, seq-num 59, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
0:00:00.186641091 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01m bin gstbin.c:3533:gst_bin_handle_message_func:<pipeline0>[00m [msg 0xfc44c0] handling child rtpl16depay0 message of type error
0:00:00.186649484 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01m bin gstbin.c:3540:gst_bin_handle_message_func:<pipeline0>[00m got ERROR message, unlocking state change
0:00:00.186656312 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01m bin gstbin.c:3870:gst_bin_handle_message_func:<pipeline0>[00m posting message upward
0:00:00.186665962 [334m22515[00m 0xf93a80 [33;01mWARN [00m [00m structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
0:00:00.186662657 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:311:gst_bus_post:<bus2>[00m [msg 0xfc44c0] posting on bus error message: 0xfc44c0, time 99:99:99.999999999, seq-num 59, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
0:00:00.186688725 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:350:gst_bus_post:<bus2>[00m [msg 0xfc44c0] pushing on async queue
0:00:00.186706354 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:353:gst_bus_post:<bus2>[00m [msg 0xfc44c0] pushed on async queue
0:00:00.186713847 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:346:gst_bus_post:<bus1>[00m [msg 0xfc44c0] dropped
0:00:00.186720541 [334m22515[00m 0xf93a80 [36mINFO [00m [00;01;31;47m GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<rtpl16depay0>[00m posted error message: Channel reordering failed.
0:00:00.186729277 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01;34m GST_MEMORY gstmemory.c:87:_gst_memory_free:[00m free memory 0x7f7780004b80
0:00:00.186737518 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01;35m GST_SCHEDULING gstpad.c:4192:gst_pad_chain_data_unchecked:[00m called chainfunction &0x7f77a1a9ae00 with buffer 0x7f7780016060, returned ok
0:00:00.186746868 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01;35m GST_SCHEDULING gstpad.c:4192:gst_pad_chain_data_unchecked:[00m called chainfunction &gst_base_transform_chain with buffer 0x7f7780016060, returned ok
0:00:00.186734973 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:523:gst_bus_timed_pop_filtered:<bus2>[00m got message 0xfc44c0, error from rtpl16depay0, type mask is 4294967295
0:00:00.186759208 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00m basesrc gstbasesrc.c:2456:gst_base_src_get_range:<udpsrc0>[00m calling create offset 18446744073709551615 length 4096, time 0
0:00:00.186808915 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01;34m GST_MEMORY gstmemory.c:138:gst_memory_init:[00m new memory 0x7f7780017ae0, maxsize:901 offset:0 size:894
0:00:00.186812210 [334m22515[00m 0xd96a00 [33;01mWARN [00m [00m structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
0:00:00.186798035 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:791:gst_bus_source_dispatch:<bus2>[00m source 0xfc0b60 calling dispatch with error message: 0xfc44c0, time 99:99:99.999999999, seq-num 59, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
0:00:00.187438285 [334m22515[00m 0xf93a80 [33;01mWARN [00m [00m rtpL16depay gstrtpL16depay.c:276:gst_rtp_L16_depay_process:<rtpl16depay0>[00m error: Channel reordering failed.
0:00:00.187861496 [334m22515[00m 0xf93a80 [36mINFO [00m [00;01;31;47m GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<rtpl16depay0>[00m posting message: Channel reordering failed.
0:00:00.187870817 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;31m GST_STATES gstelement.c:2523:gst_element_set_state_func:<autoaudiosink0>[00m set_state to PAUSED
0:00:00.187917831 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;31m GST_STATES gstelement.c:2561:gst_element_set_state_func:<autoaudiosink0>[00m current READY, old_pending PAUSED, next PAUSED, old return ASYNC
0:00:00.187926145 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;31m GST_STATES gstelement.c:2615:gst_element_set_state_func:<autoaudiosink0>[00m element was busy with async state change
0:00:00.187931662 [334m22515[00m 0xf93a80 [33;01mWARN [00m [00m structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
0:00:00.187932562 [334m22515[00m 0xd96a00 [36mINFO [00m [00;01;31m GST_STATES gstbin.c:2770:gst_bin_change_state_func:<pipeline0>[00m child 'autoaudiosink0' is changing state asynchronously to PAUSED
0:00:00.187919799 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:311:gst_bus_post:<bus1>[00m [msg 0xfc4540] posting on bus error message: 0xfc4540, time 99:99:99.999999999, seq-num 60, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
0:00:00.187957346 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01m bin gstbin.c:2182:gst_bin_sort_iterator_next:<pipeline0>[00m queue head gives queue0
0:00:00.187965818 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01m bin gstbin.c:3533:gst_bin_handle_message_func:<pipeline0>[00m [msg 0xfc4540] handling child rtpl16depay0 message of type error
0:00:00.187975510 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01m bin gstbin.c:882:find_message:<pipeline0>[00m no message found matching types 00001000
0:00:00.187996861 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01m bin gstbin.c:889:find_message:<pipeline0>[00m structure-change
0:00:00.188003444 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01m bin gstbin.c:2098:update_degree:<pipeline0>[00m change element audioconvert0, degree 1->0, linked to queue0
0:00:00.188010702 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01m bin gstbin.c:1981:add_to_queue:<pipeline0>[00m adding 'audioconvert0' to queue
0:00:00.188019716 [334m22515[00m 0xd96a00 [36mINFO [00m [00;01;31m GST_STATES gstbin.c:2316:gst_bin_element_set_state:<queue0>[00m current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:00.188021589 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;01m bin gstbin.c:3540:gst_bin_handle_message_func:<pipeline0>[00m got ERROR message, unlocking state change
0:00:00.188204142 [334m22515[00m 0xf93a80 [33;01mWARN [00m [00m structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
0:00:00.188196343 [334m22515[00m 0xf93a80 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:311:gst_bus_post:<bus2>[00m [msg 0xfc4540] posting on bus error message: 0xfc4540, time 99:99:99.999999999, seq-num 60, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
0:00:00.188532703 [334m22515[00m 0xf93a80 [36mINFO [00m [00;01;31;47m GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<rtpl16depay0>[00m posted error message: Channel reordering failed.
0:00:00.199466751 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;43m GST_BUS gstbus.c:523:gst_bus_timed_pop_filtered:<bus2>[00m got message 0xfc4540, error from rtpl16depay0, type mask is 4294967295
0:00:00.203389413 [334m22515[00m 0xd96a00 [37mDEBUG [00m [00;01;36m GST_PLUGIN_LOADING gstpluginfeature.c:66:gst_plugin_feature_finalize:[00m finalizing feature 0xf69ea0: 'errorignore'
</bus2></rtpl16depay0></bus2></pipeline0></queue0></pipeline0></pipeline0></pipeline0></pipeline0></pipeline0></pipeline0></bus1></pipeline0></autoaudiosink0></autoaudiosink0></autoaudiosink0></rtpl16depay0></rtpl16depay0></bus2></udpsrc0></bus2></rtpl16depay0></bus1></bus2></bus2></bus2></pipeline0></pipeline0></pipeline0></bus1></rtpl16depay0></rtpl16depay0></rtpl16depay0></plugin223></plugin223></plugin223></plugin223></plugin223></plugin223></plugin223></plugin223></plugin106> -
Can't upload folder with large amount of files to google storage. I using "@ffmpeg-installer/ffmpeg" and @google-cloud/storage
20 juillet 2022, par DmytroI upload file to google storage using "@ffmpeg-installer/ffmpeg" and @google-cloud/storage in my node.js App.
Step 1. file uploading to fs is in child processes - one process for each type of resolution (totaly six).
step 2. encription (converting to stream)
step 3. upload to google storage


I use "Upload a directory to a bucket" in order to send the video from the client to the Google Cloud Storage bucket.


This way is working fine only with small video.


for example when I upload video with duration one hour it split on chunk and totally I get more three thousands files. But the problem occurs when there are more than 1500 files


So actually i upload folder with large amount of files, but not all of this files are uploaded to cloud.


maybe someone had the similar problem and helps fix it.




const uploadFolder = async (bucketName, directoryPath, socketInstance) => {
 try {
 let dirCtr = 1;
 let itemCtr = 0;
 const fileList = [];

 const onComplete = async () => {
 const folderName = nanoid(46);

 await Promise.all(
 fileList.map(filePath => {
 const fileName = path.relative(directoryPath, filePath);
 const destination = `${ folderName }/${ fileName }`;

 return storage
 .bucket(bucketName)
 .upload(filePath, { destination })
 .then(
 uploadResp => ({ fileName: destination, status: uploadResp[0] }),
 err => ({ fileName: destination, response: err })
 );
 })
 );

 if (socketInstance) socketInstance.emit('uploadProgress', {
 message: `Added files to Google bucket`,
 last: false,
 part: false
 });

 return folderName;
 };

 const getFiles = async directory => {
 const items = await fs.readdir(directory);
 dirCtr--;
 itemCtr += items.length;
 for(const item of items) {
 const fullPath = path.join(directory, item);
 const stat = await fs.stat(fullPath);
 itemCtr--;
 if (stat.isFile()) {
 fileList.push(fullPath);
 } else if (stat.isDirectory()) {
 dirCtr++;
 await getFiles(fullPath);
 }
 }
 }

 await getFiles(directoryPath);

 return onComplete();
 } catch (e) {
 log.error(e.message);
 throw new Error('Can\'t store folder.');
 }
 };