Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • How stop ffmpeg write to log command line strings

    18 février 2016, par Alexufo

    I save mp3 to mp3 via shell_exec();and use logs for error control

    FFREPORT=file=ffreport%p%t.log:level=16
    

    But if I change level=16 to level=0

    every convertion I still get ffreport%p%t.log files with text:

    Command line:
    ffmpeg -y -i /tmp/php2hmlyt  -acodec copy /home/uploads/5607.mp3
    

    How stop write to logs useless Command line data?

  • NReco.VideoConverter GetVideoThumbnail memory leak

    18 février 2016, par Julien

    I am using the following code to process videos and grab a screenshot from them using http://www.nrecosite.com/video_converter_net.aspx.

    It leaks memory.

    Add a few hundred videos and you can see memory increase.

    Am I doing something wrong? Or is this a bug with FFMpeg?

    I have tried using a static instance of FFMpegConverter but it doesn't seem to make a difference.

          public byte[] GetImage(string path)
          {
                using (var outputJpegStream = new MemoryStream())
                {
                    var nreco = new FFMpegConverter();
    
                    nreco.GetVideoThumbnail(path, outputJpegStream, 10);
    
                    outputJpegStream.Seek(0, SeekOrigin.Begin);
    
                    var thumbnailBytes = new byte[outputJpegStream.Length];
                    outputJpegStream.Read(thumbnailBytes, 0, Convert.ToInt32(outputJpegStream.Length));
    
                    using (var myMemStream = new MemoryStream(thumbnailBytes))
                    {
                        using (var fullsizeImage = Image.FromStream(myMemStream))
                        {
                            using (var newImage = fullsizeImage.GetThumbnailImage(480, 320, null, IntPtr.Zero))
                            {
                                using (var myResult = new MemoryStream())
                                {
                                    newImage.Save(myResult, ImageFormat.Png); 
                                    return myResult.ToArray();
                                }
                            }
                        }
                    }
                }
          }
    
  • How to edit video (cut some scenes) without increasing the video's size

    18 février 2016, par 123iamking

    [Introduction]

    I have a video: Input.mp4 - length: 29 min 6 sec - size: 120 MB

    I use Microsoft Movie Maker 2012 (Movie Maker is included in the Windows Essentials 2012 program suite), to cut some boring scenes and keep the cool scenes and I get the video: Output.mp4 - length: 15 min 22 sec - size: 155 MB.

    And it's take a long time to create the Output.mp4 and the size is ridiculously increased. I can't use this kind of software anymore, I need to create a new software to serve my purpose.

    [Question]

    Is there anyway with C# .Net to simply cut and merge video without increasing the video's size and have to be fast?

    [What I have tried]

    I intend to use ffmpeg to cut the clip and merge the clip and I found something about cut video here , but the console said something about "Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future." - should I still use this?

    Should I use ffmpeg or there's better way to do this.

  • video created by moviepy doesn't play on web

    18 février 2016, par R. Glenn

    I'm playing around with moviepy, with the intent of creating videos to imbed in webpages. However, I'm having trouble getting the videos that I create to actually play in chrome and firefox (it does play in safari :/ ). Firefox claims the "file is corrupt".

    I find it extremely likely I haven't installed something properly. I followed (among other things, since I'm not yet authorized to post enough links so as to fully describe my situation, #thanksStackOverflow ;P) http://wiki.webmproject.org/ffmpeg/building-with-libvpx, but according to [link I would have shared if allowed :P] that stuff is all "automatically installed during MoviePy’s installation", so I'm not sure how I could have messed it up.

    see example code (I've tried it with 'python', 'python3' and 'python3.5'):

    from moviepy.editor import *
    
    filepath = "../read_videos/MOVI0011.avi"
    file = VideoFileClip(filepath)
    
    clips = []
    clips.append(file.subclip(10, 12))
    clips.append(file.subclip(20, 22))
    clips.append(file.subclip(30, 32))
    clips.append(file.subclip(40, 42))
    
    concatenated_clip = concatenate_videoclips(clips)
    
    concatenated_clip.write_videofile("../write_videos/clip.mp4", fps=24, codec='mpeg4')
    

    firefox error

    OSX El Capitan (10.11.3)

  • FFmpeg chokes on filenames inside of quotes w/ whitespaces [duplicate]

    18 février 2016, par user3578907

    This question already has an answer here:

    I'm trying to convert all of my FLACs in to MP3s. Each artist has a folder, and each album has a subfolder. I used the find command to compile a clean list of all of the FLACs in to a file called songlist, and tried dumping it in to FFmpeg with

    (for SONG in `cat songlist` ; do ffmpeg -i "$SONG" -f mp3 -ab 256000 "`basename "$SONG" .flac`.mp3" || break; done)
    

    Any time ffmpeg reaches a file with a space or special character it interprets it directly. I don't understand why, as I thought the quotes around $SONG would sanitize it enough. Any thoughts on how to accomplish this task more efficiently or how to fix my code are welcomed.

    songlist is just filled with full paths to the files. No quotes around the paths.