Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Streaming without Content-Length in response

    29 août 2011, par kain

    I'm using Node.js, Express (and connect), and fluent-ffmpeg.

    We want to stream audio files that are stored on Amazon S3 through http.

    We have all working, except that we would like to add a feature, the on-the-fly conversion of the stream through ffmpeg.

    This is working well, the problem is that some browsers checks in advance before actually getting the file.

    Incoming requests containing the Range header, for which we reply with a 206 with all the info from S3, have a fundamental problem: we need to know in advance the content-length of the file.

    We don't know that since it is going through ffmpeg.

    One solution might be to write out the resulting content-length directly on S3 when storing the file (in a special header), but this means we have to go through the pain of having queues to encode after upload just to know the size for future requests. It also means that if we change compressor or preset we have to go through all this over again, so it is not a viable solution.

    We also noticed big differencies in the way Chrome and Safari request the audio tag src, but this may be discussion for another topic.

    Fact is that without a proper content-length header in response everything seems to break or browsers goes in an infinite loop or restart the stream at pleasure.

    Ideas?

  • Decode h264 video

    29 août 2011, par john bowring

    I am looking for a way to decode h264 (or indeed any video format) using c#. The ultimate goal is to be able to decode the images and very strictly control the playback in real time. The project I am working on is a non-linear video art piece where the HD footage is required to loop and edit itself on the fly, playing back certain frame ranges and then jumping to the next randomly selected frame range seamlessly.

    I have created an app which reads image files (jpegs) in from the disk and plays them on screen in order, I have total control over which frame is loaded and when it is displayed but at full HD res it takes slightly longer than I want to load the images from hard drive (which are about 500k each), I am thinking that using a compressed video format would be smaller and therefore faster to read and decode into a particular frame however I cannot find any readily available way to do this.

    Are there any libraries which can do this? i.e. extract an arbitrary frame from a video file and serve it to my app in less time than it takes to show the frame (running at 25fps), I have looked into the vlc libraries and wrappers for ffmpeg but I don't know which would be better or if there would be another even better option. Also I don't know which codec would be the best choice as some are key frame based making arbitrary frame extraction probably very difficult.

    Any advice welcome, thanks

  • Working way to make video from images in C#

    29 août 2011, par Jim Mischel

    Does anybody have a known reliable way to create a video from a series of image files? Before you mod me down for not searching for the answer before posting the question, and before you fire off a simple message like "use FFMPEG," read the rest of this message.

    I'm trying to create a video, it doesn't matter too much what format as long as it's widely supported, from a series of images (.jpg, .bmp, etc.). My platform is Windows Server 2008, 64-bit. If I can make the video from within my C# program, that's great, but I'm not averse to writing a series of image files to a directory and then firing off an external program to make a video from those images.

    The only constraints are: it must work on my Windows Server 2008 system, and be scriptable. That is, no GUI programs that require operator intervention.

    I found a number of similar questions on StackOverflow, and have tried several of the solutions, all with varying degrees of frustration and none with anything like success.

    FFMPEG looks like a great program. Maybe it is, on Linux. The two Windows builds I downloaded are broken. Given this command line:

      ffmpeg -r 1 -f image2 -i jpeg\*.jpg video.avi
    

    One of the builds reads the images and then crashes due to data execution prevention. The other reads the first file and then spits out an error message that says "cannot find suitable codec for file jpeg/image2.jpg". Helpful, that. In any case, FFMPEG looks like a non-starter under Windows.

    One answer to a previous posting recommended Splicer . It looks like pretty good code. I compiled the samples and tried to run, but got some cryptic error message about a file not found. It looks like a COM class isn't registered. I suppose I need to install something (DirectShow, maybe, although I thought that was already installed?). Depending on what's required, I might have a difficult time justifying its installation on a server. ("What? Why do you need that on a server?")

    Another answer suggested the AviFile library from Code Project. That looks simple enough: a wrapper around the Windows AviFile subsystem. Except that the AVI files the package creates appear to have all of the frames, but only the first frame shows when I play the AVI in Windows Media Player. Well, that and if you try to create a compressed video, the program throws an exception.

    So, I'm left wondering if there is a good, reliable way to do what I want: on a Windows system, create an AVI or other common video file format from a series of images, either through a .NET API or using an external program. Any help?

  • how do I convert .iso to .mp4 without mounting with ffmpeg [migrated]

    29 août 2011, par teferi

    The problem is - I want to convert .iso with dvd to .mp4 (h264/ac3), but I cannot mount it via mount -o loop, because I'm on a virtual machine that doesn't allow to do that.

    Googling doesn't help.

    For now I'm trying to use mencoder for the task, but it's hard for me to convert all the parameters from ffmpeg-style to mencoder style.

  • converting .mov file to .h264 file

    29 août 2011, par Robin Rye

    ok, this is the case, i actually want to parse frames from a mov file. get the encoded h264 frames. and i've managed to do so by using ffmpeg but when i try to make a movie again by using ffmpeg -i test* test.mov i get test00: Invalid data found when processing input so there is something not correct with the structure of the frames. as i understand it a frame should have the following appearance:

    00 00 00 01 XX data -------------

    where XX is say whether it is a I-,P- or B-frame. or more specifically type(XX) = 0x0F && XX says if it is I(type(XX) = 5?),P(type(XX) = 7?) or B(type(XX) = 8?) frame. I'm not sure about these number, i've been looking for it but not found good sources. so that's question number one, what number should the NALU be for the different frames?

    anyway, when i use av_read_frame on the mov file, i get frame that look like this:

    4B = size, 1B = XX and then data. (at least this is what i think i get)

    the files where i store the frames are always size long when i look at them in a hexeditor(otherwise as well of course). and XX is always 65(ie. type(XX) = 5) in the first and then 61(ie. type(XX) = 1) for a couple of frames and then back to being 65 for one frame and so on.

    i guess that these are frames like: I P P P P P P I P P P P P P P I P P P P P P P .... however then my assumption about the type numbers for the different frame types are false, which is highly likely. (any suggestion on reading about this? except the ISO/IEC 14496-10, i don't understand it really).

    I've tried to remove the size and append 00 00 00 01 before the XX byte and the data but without success. any tips on how i could modify the frames to be valid H264 encoded frames?