Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG convert FLV to MP4 and reduce filesize

    18 septembre 2014, par Chris

    i have a system that is recording live stream via Wowza. I get from Wowza a .flv file with the record. The problem is, 5 minutes file is near to 50mb big. But when i look at some TV-Series that you can download from the net, they are 20 minutes, in mp4 and just like 150mb big. Whatever... Look, the stream input is like:

    Input #0, flv, from 'rtmp://127.0.0.1/stream/test.stream':
    Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264 (Constrained Baseline), yuv420p, 720x404 [PAR 1:1 DAR 180:101], 25 tbr, 1k tbn, 50 tbc
    Stream #0.1: Audio: aac, 48000 Hz, stereo, s16
    

    FFmpeg shows me something like this at the "session":

    frame= 2721 fps= 27 q=-1.0 Lsize=   17188kB time=111.21 bitrate=1266.1kbits/s
    

    Have you any idea how to use FFmpeg to convert the .FLV file in MP4 in same near to Quality but smaller filesize?

    btw. i'm operating in linux ^^

    Thanks

  • Second instance of ffmpeg for experimenting

    18 septembre 2014, par Brian Bennett

    I'm experimenting with databending/glitching images and videos as part of a master's class. I've used Audacity to do most of it thus far, but it isn't as successful with video.

    I want to try to edit video by changing the source codecs in ffmpeg, but I don't want to inadvertently destroy my current install.

    Is it possible to install a second instance of ffmpeg to run independently for experimentation purposes?

    If so, what Terminal command would I use to create a second, executable directory?

  • Get CC(Closed Caption) data from video file using ffmpeg

    18 septembre 2014, par mail2vguna

    I am using the following ffmpeg command to extract the CC(Closed Caption) data from .ts file.

    ffmpeg -i input.ts -an -vn -bsf:s mov2textsub -scodec copy -f rawvideo sub.txt 
    
    FFMPEG -i input.ts -vn -an -codec:s:0.1 srt sub.srt
    
    ffmpeg -threads 4 -i input.ts -vn -an -codec:s:0.2 srt englishSubtitle.srt
    

    But i did not get the cc data, its says "invalid frame dimensions 0x0" error.

    Help me to extract the cc data from .ts file using ffmpeg.

  • OpenCV : in search for less CPU intensive frame capture+resize and into buffer way : how to optimize my code ?

    18 septembre 2014, par Rella

    So I created a function (C++)

    void CaptureFrame(char* buffer, int w, int h, int bytespan)
    {
     /* get a frame */
     if(!cvGrabFrame(capture)){              // capture a frame 
      printf("Could not grab a frame\n\7");
      //exit(0);
     }
     CVframe =cvRetrieveFrame(capture);           // retrieve the captured frame
    
     /* always check */
     if (!CVframe)
     {
      printf("No CV frame captured!\n");
      cin.get();
     }
    
     /* resize buffer for current frame */
     IplImage* destination = cvCreateImage(cvSize(w, h), CVframe->depth, CVframe->nChannels);
    
     //use cvResize to resize source to a destination image
     cvResize(CVframe, destination);
    
     IplImage* redchannel = cvCreateImage(cvGetSize(destination), 8, 1);
     IplImage* greenchannel = cvCreateImage(cvGetSize(destination), 8, 1);
     IplImage* bluechannel = cvCreateImage(cvGetSize(destination), 8, 1);
    
     cvSplit(destination, bluechannel, greenchannel, redchannel, NULL);
     for(int y = 0; y < destination->height; y++)
     {
      char* line = buffer + y * bytespan;
      for(int x = 0; x < destination->width; x++)
      {
       line[0] = cvGetReal2D(redchannel, y, x);
       line[1] = cvGetReal2D(greenchannel, y, x);
       line[2] = cvGetReal2D(bluechannel, y, x);
       line += 3;
      }
     }
     cvReleaseImage(&redchannel);
     cvReleaseImage(&greenchannel);
     cvReleaseImage(&bluechannel);
     cvReleaseImage(&destination);
    }
    

    So generally it captures a frame from device, creates a frame to resize into and copies it into buffer (RGB or YUV420P is requirement for me).

    So I wonder what I do wrong, because my function is way 2 cpu intensive, and what can be done to fix it?

    Update:

    My function is runed in thread:

         void ThreadCaptureFrame()
        {
            while(1){
            t.restart();
            CaptureFrame((char *)frame->data[0], videoWidth, videoHeight, frame->linesize[0]);
            AVFrame* swap = frame;
            frame = readyFrame;
            readyFrame = swap;
            spendedTime = t.elapsed();
            if(spendedTime < desiredTime){
                Sleep(desiredTime - spendedTime);
            }
        }
     }
    

    which is started at the beginning of int main ( after some initialization):

    boost::thread workerThread(ThreadCaptureFrame);
    

    So if it can it runs 24 times per second, it eats 28% of core quad. cam resolution I capture is like 320x240. So: how to optimize it?

  • How to convert video files using settings from ffmprobe ?

    18 septembre 2014, par tsega

    I want to convert a video file .mp4 to .avi using the setting of an .avi file that works for me on my DVD player. I used ffmprobe to see the settings of the working .avi file and here it is:

    Duration: 01:38:21.00, start: 0.000000, bitrate: 2031 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (DX50 / 0x30355844), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 384 kb/s
    

    How can I use the settings above with ffmpeg to convert my .mp4 file?