
Recherche avancée
Autres articles (52)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
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. -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (3583)
-
how to pass ffmpeg output to other sub-class in C# ?
11 septembre 2012, par Lynxi want to pass the thumbnail generated by ffmpeg to save_FTPUpload where the save_FTPUpload function is to upload the image file to ftp server. how can i do that ?
here is my example code for thumbnail generation using ffmpeg and "fileupload" function for uploading files to ftp server :public partial class testtttt : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
generateThumbnail();
string fi_attachment = @"C:\2.jpg";//source image file
save_FTPUpload(fi_attachment);
}
private void generateThumbnail()
{
string thumbpath, thumbname, videofile;
videofile = "http://www.xxxx.com/video.Avi";
thumbpath = @"C:\";
thumbname = thumbpath + Path.GetFileNameWithoutExtension(videofile) + ".jpg";
string thumbargs = "-i \"" + videofile + "\" -vframes 1 -s 60*30 -ss 00:00:00 -f image2 \"" + thumbname + "\"";
Process process = new Process();
process.StartInfo.FileName = Server.MapPath("~\\ffmpeg\\bin\\ffmpeg.exe");
process.StartInfo.Arguments = thumbargs;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
try
{
process.Start();
string output2 = process.StandardError.ReadToEnd();
string output3 = process.StandardOutput.ReadToEnd();
if (process != null)
{
process.Close();
}
}
catch (Exception)
{
this.lblMessage.Text = "Thumbnail created successfuly";//ex.Message.ToString();
}
}
public bool save_FTPUpload(string fi_attachment)
{
bool fileSaved = false;
//string fi_attachment = @"C:\1.jpg";
string filename = "3.jpg";//image name to be saved in ftp
string ftp_user = "*****"; //username
string ftp_pass = "*****"; //password
string ftpURI = "ftp://www.xxxx.com/thumb/"; //ftp path where the image will be saved
while (!fileSaved)
{
string file_ftpURI = string.Format("{0}/{1}", ftpURI, filename);
FtpWebRequest file_exist_request = (FtpWebRequest)FtpWebRequest.Create(file_ftpURI);
file_exist_request.Credentials = new NetworkCredential(ftp_user, ftp_pass);
file_exist_request.Method = WebRequestMethods.Ftp.GetFileSize;
try
{
FtpWebResponse response = (FtpWebResponse)file_exist_request.GetResponse();
}
catch (WebException ex)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode ==
FtpStatusCode.ActionNotTakenFileUnavailable)
{
FtpWebRequest upload_request = (FtpWebRequest)FtpWebRequest.Create(file_ftpURI);
upload_request.Credentials = new NetworkCredential(ftp_user, ftp_pass);
upload_request.Method = WebRequestMethods.Ftp.UploadFile;
upload_request.UsePassive = true;
upload_request.UseBinary = true;
upload_request.KeepAlive = false;
using (var fs = File.OpenRead(fi_attachment))
using (Stream upload_request_stream = upload_request.GetRequestStream())
{
fs.CopyTo(upload_request_stream);
}
FtpWebResponse upload_response = (FtpWebResponse)upload_request.GetResponse();
fileSaved = true;
this.Label1.Text = "Upload Successful";
}
}
}
return fileSaved;
} -
electron fluent-ffmpeg mergeToFile() command promise not triggering
12 septembre 2020, par MartinI am trying to use fluent-ffmpeg with my electron app to concatenate multiple audio files together with an image in a video. So if i have three files :


song1.mp3 1:00
song2.mp3 0:30
song3.mp3 2:00
front.jpg


I could create
output.mp4
which would be 3:30 seconds long, and play each file one after the other in order. With front.jpg set as the background image.

I am trying to create the concatenated audio file first for this video, then I can just render a vid with two inputs ; image and the 3:30second long concatenated audio file. But I'm having difficulty getting my electron app to wait for the ffmpeg job to run and complete.


I know how to do all of these ffmpeg jobs on the command-line, but I've been following this guide for how to package ffmpeg into an electron app that can run on mac/win10/linux environments. I'm developing it on win10 right now.
gur.com/LtykP.png


I have a button :

<button>FULLALBUM</button>


that when I click runs the
fullAlbum()
function that callscombineMp3FilesOrig
to run the actual ffmpeg job :

async function fullAlbum(uploadName) {
 //document.getElementById("buttonId").disabled = true;

 //get table
 var table = $(`#upload_${uploadNumber}_table`).DataTable()
 //get all selected rows
 var selectedRows = table.rows( '.selected' ).data()
 //get outputFile location
 var path = require('path');
 var outputDir = path.dirname(selectedRows[0].audioFilepath)
 //create outputfile
 var timestamp = new Date().getUTCMilliseconds();
 let outputFilepath = `${outputDir}/output-${timestamp}.mp3` 

 
 console.log('fullAlbum() button pressed: ', timestamp)

 await combineMp3FilesOrig(selectedRows, outputFilepath, '320k', timestamp);
 //document.getElementById("buttonId").disabled = false;

 console.log(`fullAlbum() /output-${timestamp}.mp3 should be created now`)
}

function combineMp3FilesOrig(selectedRows, outputFilepath, bitrate, timestamp) {
 console.log(`combineMp3FilesOrig(): ${outputFilepath}`)
 
 //begin get ffmpeg info
 const ffmpeg = require('fluent-ffmpeg');
 //Get the paths to the packaged versions of the binaries we want to use
 const ffmpegPath = require('ffmpeg-static').replace('app.asar','app.asar.unpacked');
 const ffprobePath = require('ffprobe-static').path.replace('app.asar','app.asar.unpacked');
 //tell the ffmpeg package where it can find the needed binaries.
 ffmpeg.setFfmpegPath(ffmpegPath);
 ffmpeg.setFfprobePath(ffprobePath);
 //end set ffmpeg info

 //create ffmpeg command
 console.log(`combineMp3FilesOrig(): create command`)
 const command = ffmpeg();
 //set command inputs
 command.input('C:\\Users\\marti\\Documents\\martinradio\\uploads\\CharlyBoyUTurn\\5. Akula (Club Mix).flac')
 command.input('C:\\Users\\marti\\Documents\\martinradio\\uploads\\CharlyBoyUTurn\\4. Civilian Barracks.flac')

 return new Promise((resolve, reject) => {
 console.log(`combineMp3FilesOrig(): command status logging`)
 command.on('progress', function(progress) {
 console.info(`Processing : ${progress.percent} % done`);
 })
 .on('codecData', function(data) {
 console.log('codecData=',data);
 })
 .on('end', function() {
 console.log('file has been converted succesfully; resolve() promise');
 resolve();
 })
 .on('error', function(err) {
 console.log('an error happened: ' + err.message, ', reject()');
 reject(err);
 })
 console.log(`combineMp3FilesOrig(): add audio bitrate to command`)
 command.audioBitrate(bitrate)
 console.log(`combineMp3FilesOrig(): tell command to merge inputs to single file`)
 command.mergeToFile(outputFilepath);
 console.log(`combineMp3FilesOrig(): end of promise`)
 });
 console.log(`combineMp3FilesOrig(): end of function`)
}



When I click my button once, my console.logs show the promise is entered, the command is created, but the function just ends without waiting for a resolve() ;
Waiting a couple minutes doesnt change anything.




If I press the button again :




A new command gets created, reaches the end of the promise, but this time actually starts, and triggers the previous command to start. Both jobs then run and their files are rendered at the correct length (12:08) and the correct quality (320k)


Is there something with my promise I need to fix involving async functions and promises in an electron app ? I tried editing my ffmpeg command to include


command.run()


At the end of my promise to ensure it gets triggered ; but that leads to an err in console saying
Uncaught (in promise) Error: No output specified
because apparently in fluent-ffmpegcommand.mergeToFile(outputFilepath);
isnt good enough and I need to include.output(outputFilepath)
as well. If I changecommand.run()
tocommand.output(outputFilepath).run()
, when i click my button, the ffmpeg job gets triggered and rendered perfectly fine. EXCEPT THAT THE FILE IS ALWAYS 128kbps

So I'm trying to figure out why my included code block, my ffmpeg command doesn't run the first time when its created.


-
Error installing Opencv (any version) : relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object
11 juin 2015, par AnshulI’m running Ubuntu 14.04 and want to install a library iai_kinect2 and it requires OpenCV to be installed. I’ve been trying to install Opencv for a day and a half now but no matter what version I try to install (after installing ffmeg correctly, after adding the —enable-pic option to the ./configure), it still gives me the same error as given above. Although I’m fairly new to Linux, I understood from what I read that this is a 32 vs 64 bit issue (i.e. some dependencies are not working correctly for the 64 bit Ubuntu that I have.
Most forums I saw said the problem was with ffmpeg not installing correctly. I followed the instructions here and although I did not find gstreamer1.0-ffmpeg, I read that gstreamer-1.0-libav works and I installed that successfully. Also, after running cmake for opencv, it says it found ffmeg. So I don’t know how to go further to solve this issue. Any suggestions would be welcome. Thanks.
The error I receive while running make for opencv is :
.
.
[ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o
Linking CXX shared library ../../lib/libopencv_videoio.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_videoio.so.3.0.0] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 38%] Building CXX object modules/shape/CMakeFiles/opencv_shape.dir/src/haus_dis.cpp.o
[ 38%] Building CXX object modules/shape/CMakeFiles/opencv_shape.dir/src/aff_trans.cpp.o
Linking CXX shared library ../../lib/libopencv_shape.so
[ 38%] Built target opencv_shape
make: *** [all] Error 2