Recherche avancée

Médias (91)

Autres articles (106)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (11512)

  • ftp: abort function optimalization

    3 juin 2013, par Lukasz Marek
    ftp: abort function optimalization
    

    It seems some ftp servers doesn’t respect ABOR command,
    but closing both connection is slow.

    This commit keeps control connection open when possible.

    Signed-off-by : Lukasz Marek <lukasz.m.luki@gmail.com>

    • [DH] libavformat/ftp.c
  • how to write h264 frame to rtmp server using ffmpeg ?

    31 mai 2013, par sam18

    I am looking for sample code to write packet to network stream. I want to use ffmpeg. i found samples for command line but i want to control all by my way. any sample or suggestion will be helpful. thanks.

  • opening jpg image after saving from ffmpeg not working

    30 mai 2013, par user2042152

    In my project I am saving videos, converting formats to .swf using ffmpeg. Converting and saving the videos is working fine, but I have a problem with creating the thumbnails. It saves a "picture.jpg" but there is no image. looking at the thumbnail its only got the normal photoviewer sign which is fine, but when I try to open the image it gives a message of
    Windows photo viewer : Windows photo viewer cant open this picture because the file appears to be damaged, corrupted, or is too large. (this image is 2.7MB) - Photos taken from my camera is about 5MB and that opens.

    PictureViewer : couldn't display "image.jpg" because a suitable graphics importer could not be found.

    Paint : Paint cannot read this file. This is not a valid bitmap file or its format is currently not supported.
    The images won't open in any I done to save the image :

       protected void btnUploadVideo_Click(object sender, EventArgs e)
       {
           string dtMonth = DateTime.Now.ToString("MMM");
           string dtYear = DateTime.Now.ToString("yyyy");
           lblMsg.Visible = false;

           lblMsg.Visible = true;

           // Before attempting to save the file, verify
           // that the FileUpload control contains a file.
           if (fuPath.HasFile)
           {
               // Get the size in bytes of the file to upload.
               int fileSize = fuPath.PostedFile.ContentLength;

               // Allow only files less than 2,100,000 bytes (approximately 2 MB) to be uploaded.
               if (fileSize &lt; 10497717)
               {
                   // Call a helper method routine to save the file.
                   SaveFile2();
               }
           }
           else
               // Notify the user that a file was not uploaded.
               lblMsg.Text = "You did not specify a file to upload.";
       }

       private void SaveFile2()
       {
           string dtMonth = DateTime.Now.ToString("MMM");
           string dtYear = DateTime.Now.ToString("yyyy");

           if (fuPath != null || fuPath.PostedFile != null)
           {
               postedfilename = fuPath.PostedFile.FileName;
               SavePath = Server.MapPath("~\\Video\\");
               string NewFName = postedfilename;
               NewFName = NewFName.Substring(NewFName.LastIndexOf("\\") + 1, NewFName.Length - NewFName.LastIndexOf(".")) + "." + NewFName.Substring(NewFName.LastIndexOf(".") + 1);
               Filenamewithpath = SavePath + NewFName;
               string outputPath = Server.MapPath("~\\uploads\\" + dtYear + "\\" + dtMonth + "\\SWF\\");
               CreateDirectoryIfNotExists(SavePath);
               CreateDirectoryIfNotExists(outputPath);

               //Save The file
               fuPath.PostedFile.SaveAs(Filenamewithpath);

               //Start Converting
               string inputfile, outputfile, filargs;
               string withoutext;

               //Get the file name without Extension
               withoutext = Path.GetFileNameWithoutExtension(Filenamewithpath);

               //Input file path of uploaded image
               inputfile = SavePath + NewFName;

               //output file format in swf

               outputfile = outputPath + withoutext + ".swf";
               Session["outputfile"] = withoutext + ".swf";
               //file orguments for FFMEPG

               // Create the path and file name to check for duplicates.
               string pathToCheck = outputfile;

               // Create a temporary file name to use for checking duplicates.
               string tempfileName = "";

               // Check to see if a file already exists with the
               // same name as the file to upload.        
               if (System.IO.File.Exists(pathToCheck))
               {
                   int counter = 2;
                   while (System.IO.File.Exists(pathToCheck))
                   {
                       // if a file with this name already exists,
                       // prefix the filename with a number.
                       tempfileName = outputPath + counter.ToString() + withoutext + ".swf";
                       pathToCheck = tempfileName;
                       counter++;
                   }

                   outputfile = tempfileName;
                   // Notify the user that the file name was changed.
                   lblMsg.Text = "A file with the same name already exists." +
                       "<br />Your file was saved as " + counter.ToString() + withoutext + ".swf";
               }

               filargs = "-i " + inputfile + " -ar 22050 " + outputfile;

               string spath;
               spath = Server.MapPath(".");
               Process proc;
               proc = new Process();
               proc.StartInfo.FileName = spath + "\\ffmpeg\\ffmpeg.exe";
               proc.StartInfo.Arguments = filargs;
               proc.StartInfo.UseShellExecute = false;
               proc.StartInfo.CreateNoWindow = false;
               proc.StartInfo.RedirectStandardOutput = false;
               try
               {

                   proc.Start();
                   fuPath.PostedFile.SaveAs(outputfile);
               }
               catch (Exception ex)
               {
                   Response.Write(ex.Message);
               }
               proc.WaitForExit();
               proc.Close();

               //Create Thumbs

               string thumbPath, thumbName;
               string thumbargs;

               thumbPath = Server.MapPath("~\\uploads\\" + dtYear + "\\" + dtMonth + "\\Thumb\\");
               CreateDirectoryIfNotExists(thumbPath);

               thumbName = thumbPath + withoutext + ".jpg";

               // Create the path and file name to check for duplicates.
               string thumbPathToCheck = thumbName;

               // Create a temporary file name to use for checking duplicates.
               string thumbTempfileName = "";

               // Check to see if a file already exists with the
               // same name as the file to upload.        
               if (System.IO.File.Exists(thumbPathToCheck))
               {
                   int counter = 2;
                   while (System.IO.File.Exists(thumbPathToCheck))
                   {
                       // if a file with this name already exists,
                       // prefix the filename with a number.
                       thumbTempfileName = thumbPath + counter.ToString() + withoutext + ".jpg";
                       thumbPathToCheck = thumbTempfileName;
                       counter++;
                   }

                   thumbName = thumbTempfileName;
                   // Notify the user that the file name was changed.
                   lblMsg.Text = "A file with the same name already exists." +
                       "<br />Your file was saved as " + counter.ToString() + withoutext + ".jpg";
               }

               //thumbargs = "-i " + inputfile + " -an -ss 00:00:03 -s 120×90 -vframes 1 -f mjpeg " + thumbName;
              // thumbargs = "-i " + inputfile + "-f image2 -ss 1.000 -vframes 1 " + thumbName;
               thumbargs = "-i " + inputfile + " -vframes 1 -ss 00:00:10 -s 150x150 " + thumbName;

               //  thumbargs = "ffmpeg -i" + inputfile + " -ss 0:00:01.000 -sameq -vframes 1 " + withoutext + ".jpg";
               //  thumbargs = "-i " + inputfile + " -vframes 1 -ss 00:00:07 -s 150x150 " + thumbName;
               Process thumbproc = new Process();
               thumbproc.StartInfo.FileName = spath + "\\ffmpeg\\ffmpeg.exe";
               thumbproc.StartInfo.Arguments = thumbargs;
               thumbproc.StartInfo.UseShellExecute = false;
               thumbproc.StartInfo.CreateNoWindow = true;
               thumbproc.StartInfo.RedirectStandardOutput = false;

               string data = "";                

               try
               {
                   fuPath.PostedFile.SaveAs(thumbName);
                   thumbproc.Start();
               }
               catch (Exception ex)
               {
                   Response.Write(ex.Message);
               }

               thumbproc.WaitForExit();
               thumbproc.Close();
               File.Delete(inputfile);
               lblMsg.Text = "Video Uploaded Successfully";
               hyp.Visible = true;
               hyp.NavigateUrl = "WatchVideo.aspx";

               SaveToDB(outputfile, thumbName);
           }
       }

    EDIT :
    If it is the thumbargs, I have tried a few ways, but with no success :

        //thumbargs = "-i " + inputfile + " -an -ss 00:00:03 -s 120×90 -vframes 1 -f mjpeg " + thumbName;
        // thumbargs = "-i " + inputfile + "-f image2 -ss 1.000 -vframes 1 " + thumbName;
         thumbargs = "-i " + inputfile + " -vframes 1 -ss 00:00:10 -s 150x150 " + thumbName;
        //  thumbargs = "ffmpeg -i" + inputfile + " -ss 0:00:01.000 -sameq -vframes 1 " + withoutext + ".jpg";

    This is how it looks when saved, but can't open....
    enter image description here

    EDIT :

    I tried adding the argument to the command prompt to see if it works there but it gave me a message of : [NULL @ 000000000025f7a0] Unable to find a suitable output format for 'vframes'
    vframes : invalid argument
    The line I used :

       ffmpeg -i VID2012.3GP vframes 1 VID2012.jpg

    If it is that it is not set correctly in IIS how do I set it ?

    EDIT :
    I changed a bit of my code. Debugging through my code there is no exception that is thrown, but if I point the mouse over the process (after it started) it "shows an exception of type System.InvalidOperationException"

       thumbargs = "-i " + postedfilename + " vframes 1" + thumbName;
               ProcessStartInfo thumbProcstartIfo = new ProcessStartInfo();
               thumbProcstartIfo.FileName = @"\ffmpeg\ffmpeg.exe";
               thumbProcstartIfo.Arguments = thumbargs;
               thumbProcstartIfo.UseShellExecute = false;
               thumbProcstartIfo.CreateNoWindow = true;
               thumbProcstartIfo.RedirectStandardOutput = false;

               try
               {
                   using (var process = new Process())
                   {
                       process.StartInfo = thumbProcstartIfo;
                       process.Start();
                       process.WaitForExit();
                   }
               }
               catch (InvalidOperationException ex)
               {
                   lblMsg.Text = ex.ToString();
               }