Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Split video file from 'n' th frame to end of video in Linux

    17 novembre 2011, par Skkard

    I need to split a video file using frames as the measure, e.g. I need to save the part of the video from the 34th frame to the end of the video in Linux( specifically fedora 16, xfce, 64bit ).

    I've tried using ffmpeg, using the '-vframes' option to specify how many frames to save, but it starts from the beginning, so is not that useful. How can I start from a certain frame in between the video and save the video from there to the end in a new file.

    I know about the '-ss' option, but while converting number of frames to the specified time, there might be errors( or so I believe. Please correct me if I'm wrong ) due to rounding.

    Could you please suggest a method? Thanks!

  • Point CMake project to specific include file

    16 novembre 2011, par Unapiedra

    I am trying to build OpenCV 2.3.0 with FFMPEG enabled. Since Ubuntu 11.10 only supplies libavcodec/format with version 0.7 and the ticket #1020(link below) indicates that it should work with 0.8.

    If I try to compile I get the following error:

    [ 18%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o
    In file included from /home/chris/src/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg.cpp:45:0:
    /home/foo/src/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:103:36: fatal error: libavformat/avformat.h: No such file or directory
    compilation terminated.
    

    This file lives in /opt/linux64-debug/include/ffmpeg/libavformat/avformat.h. I tried pointing make at that with CMAKE_INCLUDE_{DIRECTORY,PATH}, CMAKE_PREFIX_PATH and CMAKE_LIBRARY_PATH. None of that worked. ( I always used the path /opt/linux64-debug/include/ffmpeg.)

    https://code.ros.org/trac/opencv/ticket/1020

  • Use FFMPEG to create video from jpeg, and index using vlc

    16 novembre 2011, par Greg

    OpenSuse 11.4 FFMEG 0.8.5

    I'm using FFMPEG to create a 5 minute mpeg from about 2100 individual jpegs (7fps). I've been using the following command (OpenSuse 11.4)
    /usr/bin/ffmpeg -y -r 7.01 -i %03d-capture.jpg -s 800x600 -r 25 Event-3692-r1-s1-3.mpg

    Now I Try to open the file (In windows XP with VLC 1.1.11 Player).
    Media->AdvancedFileOpen
    *I select "Show more options" and set StartTime to 5s. I expect that the video should start 5 seconds in, but instead it starts at a seemingling random (although consistent) time of ~30 seconds in.

    I also tried changing ffmpeg command to:
    /usr/bin/ffmpeg -sameq -y -r 7.01 -i %03d-capture.jpg -s 800x600 -r 25 Event-3692-r1-s1-3.mpg
    *This result in about a constant 2x offset (5sec => 10sec) (10s => 20s) etc. But filesize is also about 6x larger, which is a strain on my storage.

    I also tried
    /usr/bin/ffmpeg -y -r 7.01 -i %03d-capture.jpg -s 800x600 -r 25 -f mpegts Event-3692-r1-s1-3.mpg
    *This result in vlc not indexing at all into my video. Also not desired. Anybody have any clues what is going on here. It is very important for me to be able to use this VLC feature and have it work correctly.

    Thanks in advance

  • Qt Audio playback from Axis Camera

    16 novembre 2011, par user1047400

    I want to get a RTP audio stream coming from an Axis Camera and then play it back in real time in my Qt project.

    I'm using Live555 in order to manage the audio stream and decode it with FFMPEG. When I decode a packet I emit a signal that is managed inside a slot of my widget with:

    ap.ioDevice->write((const char*)ptrArr, frameSize);
    

    The problem is that when I listen, my voice but a little bit metallic! I set these parameters for the QAudioOutput:

    format.setFrequency(22050);
    format.setChannels(1);
    format.setSampleSize(16);
    format.setCodec("audio/pcm");
    format.setByteOrder(QAudioFormat::LittleEndian);
    format.setSampleType(QAudioFormat::UnSignedInt);
    

    What's wrong?


    Thank you to all.

    As I said in a comment I'm able to obtain an enough clear playback with 8000Hz and 2 channels.

    Now I'm trying to solve other problems and than I'll try to improve audio quality for example with Phonon.

  • NSTask and FFMpeg losing output

    16 novembre 2011, par Morgan

    I'm trying to call ffmpeg from NSTask in objective-c. I execute the ffmpeg command in terminal and it works flawlessly every time. I make the same command using NSTask, and it never gives me the whole output. It cuts it off half way through the output, at a seemingly random spot every time. Here is my code.

        - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    {
        NSString* ffmpegPath = [[NSBundle mainBundle] pathForResource:@"ffmpeg" ofType:@""];
        NSString* path = @"test.mov";
    
        NSTask *task = [[NSTask alloc] init];
        NSArray *arguments = [NSArray arrayWithObjects: @"-i", path, nil];
        NSPipe *pipe = [NSPipe pipe];
        NSFileHandle * read = [pipe fileHandleForReading];
    
        [task setLaunchPath: ffmpegPath];
        [task setArguments: arguments];
        [task setStandardOutput: pipe];
        [task launch];
        [task waitUntilExit];
    
        NSData* data = [read readDataToEndOfFile];
        NSString* stringOutput = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    
    
        NSLog(@"%@", stringOutput);
        NSLog(@"%i", [task terminationStatus]);
        NSLog(@"DONE");
    }