avcodec | of encoder/decoder/render/player | Messaging library
kandi X-RAY | avcodec Summary
kandi X-RAY | avcodec Summary
of encoder/decoder/render/player
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of avcodec
avcodec Key Features
avcodec Examples and Code Snippets
Community Discussions
Trending Discussions on avcodec
QUESTION
For my project I need to convert a RGB (GL_RGB
) Image generated by glReadPixels
into a AVFrame
. I've googled it and found just examples of the other way around. But in this case I need from GL_RGB
to AVFrame
.
Here's my code:
Here's how I set my codec:
...ANSWER
Answered 2022-Apr-10 at 16:29The second argument of sws_scale
is an array of pointers: const uint8_t *const srcSlice[]
Instead of pointer cast: (const uint8_t * const *)&rgb
, place rgb
pointer inside an array of pointers:
QUESTION
i have the following scenario that is driving me crazy:
i have a capture device. Here the ffprobe on it:
...ANSWER
Answered 2022-Apr-08 at 00:16*.mjpeg
is a raw stream format. FFmpeg documentation states of raw muxers: "They do not store timestamps or metadata." So, instead try storing the data in an mp4 container:
QUESTION
I'm outputting an H264 stream, encoded by my application using ffmpeg. I can display it using ffplay
, but when trying to view the stream in VLC, I only get the first frame, or it looks like that's the case.
The messages output shows that it is "buffering", taking around a minute to get to 100% when the frame updates.
When using ffplay
, the latency is about 50-100ms at worst.
I am sending to rtp://127.0.0.1:6666?pkt_size=1316
with the format rtp_mpegts
.
I am new to this and it's highly likely I haven't set the frame up completely correctly. The process is (minus declarations and error checking)
ANSWER
Answered 2022-Mar-15 at 12:45The problem with my approach above was that it was based on the ffmpeg example encode_video.c
with some bits for stream output borrowed from google.
Thanks to @rotem I started putting together a standalone executable and stumbled on the example muxing.c
in the ffmpeg examples.
This let me find the steps I was missing: set the stream index on the packet, and rescale the time:
QUESTION
As the title explains, I am trying to bundle FFMPEG with my executable application.
However, I can't seem to figure out the runtime loading of the FFMPEG shared libraries. I'm not sure what is incorrect:
RPATH/RUNPATH
of main project and FFMPEG libraries.- The CMake install steps.
- Or just my entire approach (most likely).
This is a CMake project and in hope of finally finding a "standard solution", I am going to include everything needed to reproduce this issue.
CMakeLists.txt: ...ANSWER
Answered 2022-Mar-10 at 19:59To try to reproduce your problem, I actually discarded all CMake stuff and just compiled main.cpp
from the command line. I think you'll agree that the root of the issue is in the ffmpeg
build.
QUESTION
I have the latest release of FFmpeg, version 5.0-full_build-www.gyan.dev, which is a compiled executable for Windows. I downloaded "ffmpeg-release-full-shared.7z," which includes dlls in \bin.
AudacityI have the latest release of Audacity, 3.1.3, which I installed using the 64-bit installer.
In Audacity's Preferences > Libraries, there is an option to use FFmpeg's libraries. Under Help > Diagnostics > Show log, Audacity seems to be looking for one of three versions of avformat-NN.dll: avformat-58.dll, avformat-57.dll, or avformat-55.dll
...ANSWER
Answered 2022-Feb-24 at 04:59The numbers 56
..etc refer to the version number of the individual libraries that are a part of the FFmpeg project. So, avcodec-59
is major version 59 of libavcodec.
Yes, you can have parallel installations without issue, provided you can set custom search paths for the client application.
I suspect these clients are using libavcodec to export to major codecs. Those are generally mature, so older versions should be fine.
That's correct. Across major versions, the API and ABI will likely have changed.
Depends on what API calls they're using. A new decode/encode API was introduced some years ago but the old one was kept for compatibility, so clients could transition over gradually. In v59, those old calls were removed. So, if they did transition, then yes.
QUESTION
I'm using avcodec to decode some hevc clip on linux, the avcodec lib is built from source package ffmpeg-4.3.1 with command:
...ANSWER
Answered 2022-Feb-22 at 08:56I do decoding like below:
QUESTION
I have a YUV420 image. I want to split image into two slices (height/2) and scale(yuv->rgb) them separately using ws_scale (may be in different threads). For example
...ANSWER
Answered 2022-Feb-17 at 22:48It looks like the slicing feature works only when the same SwsContext
is used for both slices.
In case we want to use individual context for each slice, we have to configure each SwsContext
as if there are two individual images.
The fist context may "scale" the top half, and the second context may "scale" the bottom half.
- The image size for both contexts applies height/2.
- The fist context gets pointers to source and destination data of the top half.
- The second context gets pointers to source and destination data of the bottom half (both source and destination pointers are advanced).
For YUV420p input, the solution is going to work only if height is a multiple of 4.
Here is the relevant part of the code:
QUESTION
I'm trying to add rotation metadata to the video recorded from RTSP stream. All works fine until I try to run recording with segment format. My command looks like this:
...ANSWER
Answered 2022-Feb-11 at 10:03I found out it has been resolved in
and it works fine in ffmpeg 5.0. You can also apply this patch to 4.4.
QUESTION
I implemented a network video player (like VLC) using ffmpeg. But it can not decode AAC audio stream received from a IP camera. It can decode other audio sterams like G711, G726 etc. I set the codec ID as AV_CODEC_ID_AAC and I set channels and sample rate of AvCodecContext. But avcodec_decode_audio4 fails with an error code of INVALID_DATA. I checked previously asked questions, I tried to add extrabytes to AvCodecContext using media format specific parameters of "config=1408". And I set extradatabytes as 2 bytes of "20" and "8" but it also not worked. I appreciate any help, thanks.
...ANSWER
Answered 2021-Dec-27 at 09:09Did you check data for INVALID_DATA?
You can check it according to RFC
RFC3640 (3.2 RTP Payload Structure)
AAC Payload can be seperated like below
AU-Header | Size Info | ADTS | Data
Example payload 00 10 0c 00 ff f1 60 40 30 01 7c 01 30 35 ac
According to configs that u shared
AU-size (SizeLength=13)
AU-Index / AU-Index-delta (IndexLength=3/IndexDeltaLength=3)
The length in bits of AU-Header is 13(SizeLength) + 3(IndexLength/IndexDeltaLength) = 16
.
AU-Header 00 10
You should use AU-size(SizeLength) value for Size Info
AU-size: Indicates the size in octets of the associated Access Unit in the Access Unit Data Section in the same RTP packet.
First 13 (SizeLength) bits 0000000000010
equals to 2. So read 2 octets for size info.
Size Info 0c 00
ADTS ff f1 60 40 30 01 7c
ADTS Parser
ID MPEG-4
MPEG Layer 0
CRC checksum absent 1
Profile Low Complexity profile (AAC LC)
Sampling frequency 16000
Private bit 0
Channel configuration 1
Original/copy 0
Home 0
Copyright identification bit 0
Copyright identification start 0
AAC frame length 384
ADTS buffer fullness 95
No raw data blocks in frame 0
Data starts with 01 30 35 ac
.
QUESTION
I am writing a screen recorder using FFMPEG lib but in output it is showing only a video with green screen. My code is below
...ANSWER
Answered 2021-Dec-17 at 22:43The green video is a result of encoding frames filled by zeros in YUV color space (pixel with Y
,U
,V
value equals 0
,0
,0
is displayed as green colored pixel).
You are configuring sws_getContext
, but you are not using it.
After decoding the grabbed video frame, the result is a frame with BGRA pixel format.
We should convert the frame from BGRA to YUV420p pixel format, and write the result to the output encoder.
When executing your code sample, I have encountered some strange behavior.
I tried to fix the code, using code snippets from the following post.
Note:
- I am still learning how to use the C interface of FFmpeg.
There are implementation details that I am not sure about.
Some polishing is still required...
Updated code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install avcodec
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page