Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG Covert HTML 5 Video NOT Working

    27 octobre 2012, par Brad

    I am using FFMPEG to convert a video to .mp4, ,ogg, .webm so that it may be viewed in all HTML5 capable browsers using the video tag. The problem is that I manage to convert the video to the 3 required formats but it does not display the video in the video tag, all I get is IE9: red cross, Firefox: Grey cross, could it be a problem with the conversion or is it something to do with the way I am adding them to the source of the video tag. Here is what I have done:

    1. FFmpeg command line(s):

      ffmpeg -i test.mp4 test.mp4
      ffmpeg -i test.mp4 test.ogg
      ffmpeg -i test.mp4 test.webm
      
    2. Here is the video tag:

      
      
    3. Webconfig lines for the video support:

      
          
          
          
          
          
      
      

    It would be great if someone could send me the required parameters for ffmpeg to convert the video to the 3 required formats and an example of how they setting the source in the video tag to display them again. And any other advise would be great like how to set the quality up etc when doing the conversion.

    Thanks in advance.

  • ffmpeg with AudioUnit

    27 octobre 2012, par deimus

    What I have

    My aim is to parse some media file using ffmpeg and provide video and audio playback. Which I do successfully using the OpenGL for video and AudioQueue for audio.

    What I need to do I need to change AudioQueue to Audio Unit service, because it does provide several nasty features for Audio manipulations.

    Basically I'm confused on integration of Audio Units into ffmpeg run loop. So would like to have some references/samples from you guys where Audio Unit is intergrated with ffmpeg media playback loop i.e. media packet extraction and its pushing into some buffer which Audio Unit can play.

  • YUV to RGB by Shader on iPhone

    27 octobre 2012, par user1333656

    Currently I am developing a video player using FFMPEG. I'm trying to convert YUV420P to RGB by Shader to reduce performance hit and I could see it works fine. The problem is caused when I try to change image size.

    Case 1. YUV to RGB is perfect. but the image is not exactly fit to Texture Bounds. For example, if i play 640x360 video, right (640-512) part is cropped and bottom (512-360) is filled with green colored rectangle.

    FRAME_X=512; //This is texture size
    FRAME_Y=512;
    
        avpicture_fill((AVPicture *) f, [currentVideoBuffer.data mutableBytes],
                   enc->pix_fmt,
                   FRAME_X, FRAME_Y);
    
        av_picture_copy((AVPicture *) f, (AVPicture *) avFrame,
                    enc->pix_fmt,
                    enc->width, enc->height);
    

    ....

    int yuvWidth= FRAME_X ;
    int  yuvHeight= FRAME_Y;
    glBindTexture ( GL_TEXTURE_2D, textureIdY );
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 
    yuvWidth, yuvHeight, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, y_channel);
    
    
    glBindTexture ( GL_TEXTURE_2D, textureIdU );
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
    yuvWidth/2, yuvHeight/2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, u_channel);
    
    glBindTexture ( GL_TEXTURE_2D, textureIdV );
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 
    yuvWidth/2, yuvHeight/2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, v_channel);
    

    Case 2. If i set actual image size to texture size, then image is exactly fit to texture but the color of image is a little bit strange. It has too much green color.

    Does anybody give me some clues for this?? Thanks in advance.

  • Node.js Live Streaming : Avoid buffering

    27 octobre 2012, par Shirish Kamath

    I've written a small nodeJS server that outputs system audio captured by ffmpeg on Windows (using DirectShow) to the browser as a streaming MP3 file. The audio needs to be as live as possible, with minimum/no buffering, and a "skipping" effect in the audio is perfectly acceptable.

    When I play the audio in Chrome using the HTML5 audio tag, there's a delay of about 8-10 secs over a low-latency LAN connection. I suspected this to be a client-side buffer, and used a Flash MP3 player on the client-side, which brought down the delay to 2-3 secs.

    Now, the buffering seems to taking place on the server-side. The documentation for NodeJS's response.write mentions that the data is written kernel buffers. How do I go about avoiding any buffering altogether or at least getting around it, so that the client always gets the latest audio data? Strategies for handling 'drain' events to always push live data?

    On the request object, I've used setNoDelay(true) to avoid the use of Nagle's algorithm. Following is a snippet of how data is written when the spawned ffmpeg process emits data.

    var clients = []; //List of client connections currently being served
    ffmpeg.stdout.on('data', function(data) {
        for(var i = 0; i < clients.length; i++){
            clients[i].res.write(data);
        }
    });
    
  • Uploading content from a URL

    26 octobre 2012, par Jordan

    I'm building a video converter for someone. All I need to know is, When someone pastes in a URL to a video, how can I download that video to the server? Anything here would be helpful.