Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Extract jpg images from mp4, crop and save exif

    5 juin 2017, par StevenH

    I am trying to take some dashcam footage, crop it, export 1fps to jpg and then the bit I'm stuck on add exif/file date to match the time & date it would have been taken based on my input video.

    The following command does the crop and export to jpg:

    ffmpeg -i c:\temp\dashcam\vid1.mp4 -vf "crop=2560:1311:0:0, fps=1" c:\temp\dashcam\vid1%03d.jpg
    

    Can I somehow do this by combining a command with ffprobe.

    Ideally I would also add gpx location data using a matching vid1.gpx but there are plenty of tools to do that bit if I can get jpgs with the correct date and time.

    Any help appreciated, thanks.

  • Affectiva/Affdex SDK video file analysis error in Android

    5 juin 2017, par Abhishek Asole

    I have an app which records the video in the background and after a button click, the Affdex API analyzes the recorded video files stored. The application is behaving weirdly where it works the first time, but gives the following error later:

    Note: I am not recording any audio while the video is being recorded

    06-01 17:41:16.010 6829-8352/com.sample.camerarecorder E/Affectiva: Invalid index 0, size is 0 06-01 17:41:16.052 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc 06-01 17:41:16.062 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2 06-01 17:41:16.064 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2 06-01 17:41:16.068 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/x-ms-wmv 06-01 17:41:16.069 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/divx 06-01 17:41:16.071 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/divx311 06-01 17:41:16.072 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/divx4 06-01 17:41:16.075 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/mp4v-esdp 06-01 17:41:16.086 6829-8352/com.sample.camerarecorder I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es 06-01 17:41:16.089 6829-8352/com.sample.camerarecorder W/AudioCapabilities: Unsupported mime audio/x-ape 06-01 17:41:16.090 6829-8352/com.sample.camerarecorder W/AudioCapabilities: Unsupported mime audio/ffmpeg 06-01 17:41:16.090 6829-8352/com.sample.camerarecorder W/AudioCapabilities: Unsupported mime audio/dts 06-01 17:41:16.092 6829-8352/com.sample.camerarecorder W/AudioCapabilities: Unsupported mime audio/mpeg-L2 06-01 17:41:16.092 6829-8352/com.sample.camerarecorder W/AudioCapabilities: Unsupported mime audio/vnd.rn-realaudio 06-01 17:41:16.093 6829-8352/com.sample.camerarecorder W/AudioCapabilities: Unsupported mime audio/x-ms-wma 06-01 17:41:16.094 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/divx 06-01 17:41:16.095 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/x-flv 06-01 17:41:16.099 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/vnd.rn-realvideo 06-01 17:41:16.100 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/vc1 06-01 17:41:16.101 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/ffmpeg 06-01 17:41:16.102 6829-8352/com.sample.camerarecorder W/VideoCapabilities: Unsupported mime video/x-ms-wmv 06-01 17:41:16.104 6829-8481/com.sample.camerarecorder I/OMXClient: Using client-side OMX mux. 06-01 17:41:16.161 6829-8480/com.sample.camerarecorder I/MediaCodec: [OMX.google.h264.decoder] setting surface generation to 6992898 06-01 17:41:16.161 6829-8481/com.sample.camerarecorder W/OMXNodeInstance: [1:google.h264.decoder] component does not support metadata mode; using fallback 06-01 17:41:16.161 6829-8481/com.sample.camerarecorder E/ACodec: [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -1010

  • Installation of ffmpeg and others on UWAMP

    5 juin 2017, par Cudex

    i try to install clip bucket for making a youtube clone site but the script ask to install ffmpeg and others compression tools on the server and i dont know how to do it . Lots of online host dont allow those libs for free. I use UWAMP but dont know how to install ffmpeg on UWAMP ... Anyone know ?

  • Python read sound file, ogg or wav ?

    5 juin 2017, par RUser4512

    I want to import music in Python, I am using soundfile. I noticed that importing ogg or wav files yield different results, as the following shows (the wav file is a conversion of the ogg file using ffmpeg). Using the code below, I observe a small difference between the ogg and wav files, is this difference normal ?

    Edit : I used the following command to convert my ffmpeg -i filename.mp3 newfilename.wav

    X, sample_rate= sf.read(wav_file)
    print(wav_file)
    print(X[0:20,])
    

    And it outputs:

    test_inputs/Shikantaza.wav
    [[  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [ -3.05175781e-05  -3.05175781e-05]
     [ -3.05175781e-05   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]
     [  0.00000000e+00   0.00000000e+00]]
    test_inputs/Shikantaza.ogg
    [[  1.17459308e-06   3.78499834e-07]
     [  5.19584228e-06   2.25495864e-06]
     [  1.13173719e-05   6.28675980e-06]
     [  1.07316619e-05   4.50928837e-06]
     [  2.70867986e-06  -3.40946622e-06]
     [  5.37277947e-06   5.06399772e-07]
     [  3.64179391e-06   6.27796169e-07]
     [ -5.09244865e-06  -6.14764804e-06]
     [ -4.38827237e-06  -3.74127058e-06]
     [ -5.41250847e-06  -3.70974522e-06]
     [ -2.75347884e-06  -7.08531957e-07]
     [ -9.67129495e-07   6.15705801e-07]
     [ -4.91217952e-06  -3.82820826e-06]
     [  4.38740926e-06   6.00675048e-06]
     [ -3.00040119e-06  -4.78463562e-08]
     [ -2.18559871e-05  -1.67418439e-05]
     [ -1.57035538e-05  -8.82137283e-06]
     [ -1.28820702e-05  -5.31934711e-06]
     [ -9.44996100e-06  -8.10974825e-07]
     [ -5.33486082e-06   3.71237797e-06]]
    
  • How to stream live video from DJI Professional 3 camera ?

    5 juin 2017, par raullalves

    I have to get the live stream video from DJI Phantom 3 camera in my C++ application, in order to do a Computer Vision processing in OpenCV.

    First I tried sending the H264 raw data through an UDP socket, inside this callback:

            mReceivedVideoDataCallBack = new CameraReceivedVideoDataCallback() {
    
            @Override
            public void onResult(byte[] videoBuffer, int size) {
                //Here, I call a method from a class I created, that sends the buffer through UDP
                if (gravar_trigger) controleVideo.enviarFrame(videoBuffer, size);
    
                if (mCodecManager != null)  mCodecManager.sendDataToDecoder(videoBuffer, size);
    
            }
    
        };
    

    That communication above works well. However, I haven't been able to decode that UDP H264 data in my C++ desktop application. I have tested with FFmpeg lib, but couldn't get to alocate an AVPacketwith my UDP data, in order to decode using avcodec_send_packet and avcodec_receive_frame. I also had problems with AVCodecContext, since my UDP communication wasn't a stream like RTSP, where it could get information about its source. Therefore, I had to change how I was trying to solve the problem.

    Then, I found libstreaming, in which can be associate to stream the android video camera to a Wowza Server, creating something like a RTSP stream connection, where the data could be obtained in my final C++ application easily using OpenCV videoCapture. However, libstreaming uses its own surfaceView. In other words, I would have to link the libstreaming surfaceView with the DJI Drone's videoSurface. I'm really new to Android, so don't have any clue of how to do that.

    To sum up, is that the correct approach? Someone has a better idea? Thanks in advance