Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Create or change wav file to Wav, 16000Hz mono

    2 avril 2018, par channae

    I'm merging multiple wav files using following command in ffmpeg:

    -f concat -safe 0 -i /storage/emulated/0/AudioClipsForSpeakerRecognition/1/speaker_1_segments.txt -c copy /storage/emulated/0/AudioClipsForSpeakerRecognition/1/speaker_1.wav

    How can I get the output wav file in 16000Hz mono?

  • Writing H.264 RTP stream data to a container file

    2 avril 2018, par Kamal

    In a call, I receive RTP packets (h264 payload). I am trying to depacketize it and write it to a container file like mkv or mp4 using ffmpeg. However the output file is not playing. I am following below steps, please let me know whats wrong here.

    1. Got RTP packet
    2. Removed RTP header 12 bytes
    3. Read one more byte and calculated F, NRI & Type value. Type value comes to 1 most of the time, sometime it is 5 also.
    4. Since type is in between 1 & 23, it is of type single NAL unit.
    5. Allocates a buffer say BUF.
    6. Writes first 3 byte as 0x00 0x00 0x01.
    7. Then copy from video payload + 1 offset (since we have read 1 byte as described in point #3) to BUF
    8. Use this BUF to prepare avpacket and write this to output file using AV_Write_* API of ffmpeg. This part I have done correctly as it works fine for me in case of vp8 codec.
    9. Get the output file.
    10. However this file is not playing in ffmpeg.

    Please let me know of my approach is correct.

    I have observed sometimes group of packets coming with marker bit as 0, with same RTP timestamp. Do I need to concatenate such group of packets and write as single NALU, or each packet I should write as single NALU to output file.

  • How to fade video using a custom curve function in ffmpeg ?

    2 avril 2018, par Zoltan

    I would like to fade out a video using a different transition curve than what the fade filter uses (which is probably linear).

    For audio, I can easily choose from a wide variety of curves that the afade filter provides, or I can supply a custom expression to the volume filter, like (sin(PI/2 * min(1\, max(-1\, 1/2 * (t - 3)))) + 1)/2. For video, however, I could not find similar possibilities.

    Based on its description, it seems to me that the geq filter could be misused to achieve this, but I couldn't get it to work. Additionally, it is very slow, probably because it works on individual pixels, even though the expression only depends on time.

  • Past duration 0.750206 too large when capturing my screen

    2 avril 2018, par it_is_a_literature

    I want to capture my screen with ffmpeg

    xrandr
    Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
    ffmpeg -f x11grab -framerate 30 -threads 0 -s 1920 x 1080 -i :0 /tmp/capture.mp4
    

    Error info:

    [x11grab @ 0x556025373ae0] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Past duration 0.750206 too large     435kB time=00:00:01.00 bitrate=3564.5kbits/s dup=19 drop=0 speed=0.382x    
    Past duration 0.749168 too large
    

    Try other ffmpeg command.

    ffmpeg -f x11grab -video_size 1360x768 -framerate 30 -i :0.0 -f pulse -i default -preset ultrafast -crf 18 -pix_fmt yuv420p out.mkv
    
    [x11grab @ 0x55db2f72fc00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [pulse @ 0x55db2f7374e0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [output stream 0:1 @ 0x55db2f7784e0] 100 buffers queued in output stream 0:1, something may be wrong.
    [libvorbis @ 0x55db2f753720] Queue input is backward in time
    [matroska @ 0x55db2f750760] Non-monotonous DTS in output stream 0:1; previous: 3411, current: 3272; changing to 3411. This may result in incorrect timestamps in the output file.
    

    How to fix it?

  • Create or change wav file to Wav, 16000Hz mono in ffmpeg-android

    2 avril 2018, par channae

    I'm merging multiple wav files using following command in ffmpeg-android,

    -f concat -safe 0 -i /storage/emulated/0/AudioClipsForSpeakerRecognition/1/speaker_1_segments.txt -c copy /storage/emulated/0/AudioClipsForSpeakerRecognition/1/speaker_1.wav

    How can I get the output wav file in 16000Hz mono?

    Thanks,