Relative Content

Tag Archive for c++ffmpeg

FFmpeg.AutoGen C# library Can’t open Codec G726

I am stuck with FFmpeg.AutoGen G726 Audio codec, it always shows error invalid argument.
Note that I Tried other codecs such as G722, G711 and it is working fine except for G726 codec. I also confirm that my binaries does support G726 codec using this command ffmpeg -formats. Please tell me what could be the reason, and if you know any other library for decoding G726 that would be better

How to decode stream data via ffmpeg library

I found this example on GitHub: avio_read_callback.c. Unfortunately, it is a very simplified example because it reads the whole input file into memory and processes it at once.

Trimming end of mp4 works, why not the start | Using ffmpeg librarie libavformat

Hello everyone, I’m working on a project that involves trimming a video using FFmpeg libraries in C++. While I can successfully append and trim the end of the video, I’m facing an issue with trimming the start. The output video is always a correct length clip of a single frame from the original video, rather […]

Is avcodec_send_frame thread safe for a single AVFrame?

I’m doing video transcoding live stream. The H264 input stream from the usb camera, I decided to encode the same AVFrame in different threads for streaming x264 with low bitrate and for jpg snapshots, but at some points avcodec_send_frame is successful, at others it returns error -22, and sometimes even Segmentation fault.

FFMpeg gets stuck while using c# but not shell

I’m working on a C# project where I need to run FFmpeg commands to process videos. The FFmpeg command works perfectly fine when executed directly in the shell, but it hangs when run from my C# application. I suspect the issue is related to the output pipes getting full.

How do I prevent an extended frame when suspending and resuming an ffmpeg process in C#?

I have a c# application where I have control of an ffmpeg (https://www.ffmpeg.org/) process. I am using it to capture video and audio, either from desktop or webcam. I am using code similar to the answer from this question (How to pause/resume ffmpeg video capture in windows from C# application) to suspend and resume the process. However, while suspended, the captured video extends the frame it was suspended on for the entire duration of the suspension.

avformat_open_input not read only? is a bug?

I’m recording my screen on Windows using the command: ./ffmpeg -f gdigrab -framerate 30 -i desktop -c:v libx264 -crf 20 -preset ultrafast -max_muxing_queue_size 1024 -hls_time 5 -hls_list_size 10 -hls_flags delete_segments -hls_segment_filename "d:\1\file%03d.ts" "d:\1\playlist.m3u8"

Dynamic ffmpeg crop, scale & encoding code seems to break when the crop size changes

The following code works perfectly as long as I only move the crop rectangle, however as soon as I change its size I no longer get frames out of my filter (av_buffersink_get_frame returns -11). It’s crazy, even after the size changes, if it eventually changes to the original size that frame will go through, then it will go back to no longer providing frames.