ffmpeg-player | A macOS player base on ffmpeg using OC and Swift | Video Player library
kandi X-RAY | ffmpeg-player Summary
kandi X-RAY | ffmpeg-player Summary
A macOS player base on ffmpeg using OC and Swift.
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 ffmpeg-player
ffmpeg-player Key Features
ffmpeg-player Examples and Code Snippets
Community Discussions
Trending Discussions on ffmpeg-player
QUESTION
I am writing simple video player using ffmpeg for android. Following are the steps I followed
- Read AVFrame from file
- Convert AVFrame to RGB565 format using
sws_scale
- Get buffer from using
av_image_copy_to_buffer
- Display this buffer to
SurfaceView
by copying buffer toANativeWindow_Buffer
Most of the videos are playing fine, but there is issue with videos which have lower resolution than window. For ex, when I play a 656x480 video on my OnePlus 7T (2206x1080), video looks distorted. The same video plays fine on emulator (2160x1080).
When I debugged whole pipe, I found that on OP7T, after locking ANativeWindow
, ANativeWindow_Buffer.stride
was set to 704 instead of 656. For all videos which plays normal, stride is same as width of buffer. The same is not the case with Android emulator.
I did some trials and tried to scale width to 600, then stride jumped to 640 and video was distorted. When I scaled width to 640, video was displayed vertically half correct.
Can anyone help me understand, How stride is calculated? And What is the reason stride is wrongly calculated?
I found one same problem here: Simple FFMpeg player for Android OP mentions that video works fine for 640, 1280, 1920.
...ANSWER
Answered 2020-Aug-17 at 12:30It seems since my device is arm64-v8a, stride was always aligned to 64. To overcome this, I get stride after locking window and using ANative_WindowBuffer
. Then I use this windowbuffer.stride
to calculate dst_slice for sws_scale
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ffmpeg-player
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