Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How can I use ffmpeg's swscale to convert from NV12 to RGB32 ?
28 août 2017, par AsikSay I have an NV12 frame in memory as an array of bytes. I know:
- its Width and Height
- its Stride (total width of a line including padding), which is the same for Y and UV components as per NV12 specification
- I know where Y begins, U begins at Y + (Stride * Height), and V begins at U + 1 (interleaved with U).
Now this is what I have so far:
SwsContext* context = sws_getContext(frameWidth, frameHeight, AV_PIX_FMT_NV12, frameWidth, frameHeight, AV_PIX_FMT_RGB32, 0, nullptr, nullptr, nullptr); sws_scale(context,
So I don't know what the parameters to sws_scale should be:
- srcSlice : a pointer to the array of bytes? It should apparently be a pointer to a pointer, but what I have is just a single-dimensional array of bytes.
- srcStride : apparently expects an array of strides, but I have just one stride for the entire file. Should I pass an array with just one element?
- srcSliceY : an offset to the first byte I guess? Should be 0 then.
- srcSliceH : the frame height I guess
- dst : once again, pointer to a pointer, but my destination output is actually just another array of bytes...
- dstStride : Width * 4 I guess?
Any help appreciated.
-
yum install php-devel raised error
28 août 2017, par Mahesh Prajapatii am installing (yum install php-devel) on linux VPS server from putty but that command fire error like Cannot find a valid baseurl for repo: 9xhost hear is the my 9xhost repo code
[9xhost] name=9xhost Packages CentOS 6 - $basearch baseul=http://mirror.centos.org/centos/6/sclo/x86_64/$basearch/ enabled=1 gpgcheck=0
What is the base url needed for install this package ?
-
Android - Decoding via a pipe will not work : Could not find an ffmpeg binary for your system
28 août 2017, par DanieleI'm trying to use TarsosDSP for real time pitch shifting on Android.
This is my code:
Uri song; // initialized in another method double rate = 1.0; RateTransposer rateTransposer; AudioDispatcher dispatcher; WaveformSimilarityBasedOverlapAdd wsola; dispatcher = AudioDispatcherFactory.fromPipe(getRealPathFromUri(song), 44100, 5000, 2500); rateTransposer = new RateTransposer(rate); wsola = new WaveformSimilarityBasedOverlapAdd(WaveformSimilarityBasedOverlapAdd.Parameters .musicDefaults(rate, 44100)); wsola.setDispatcher(dispatcher); dispatcher.addAudioProcessor(wsola); dispatcher.addAudioProcessor(rateTransposer); dispatcher.addAudioProcessor(new AndroidAudioPlayer(dispatcher.getFormat())); dispatcher.setZeroPadFirstBuffer(true); dispatcher.setZeroPadLastBuffer(true);
I get an error here
dispatcher = AudioDispatcherFactory.fromPipe(getRealPathFromUri(song), 44100, 5000, 2500);
Decoding via a pipe will not work: Could not find an ffmpeg binary for your system
Why does this happen and how should I fix it?
EDIT:
As far as I was able to understand it's because ffmpeg isn't integrated within the app. I looked for a guide here on SO but I couldn't find any updated one. Using NDK r15c and FFmpeg 3.3.3
-
How can I fill skipped video frames of a movie with duplicated frames using ffmpeg ?
28 août 2017, par Aviv SharonI have an avi movie that contains some skipped frames (can be easily seen with virtual dub, that it duplicates them to the previous frame). My question is how can I use ffmpeg tool to convert a movie to be the same, just to fill the skipped frames with the previous ones, without changing the compression, using the very same source frames. I know there is a "-vsync cfr" option that works when re-encoding ("-vcodec [some codec]"), and there is "-vcodec copy", which maintains the codec and quality. However, these 2 ("-vsync cfr -vcodec copy") are not working together. In such case, the output video is the same as the input video (bit-exact).
Any clue how can I do it? Thanks
-
Animate Windows desktop background using a timer in VB
28 août 2017, par Mousa AlfhailyI'm working on code that should animate the desktop background using a timer and I achieved that using the code below, but I'n not planing to change it randomly to random wallpapers, so here is my problem, i'm using (ffmpeg) command-line to extract all the frames from a
GIF
image, then I'm running a timer with a low interval(100), to loop through all the frames and change the background using theUser32.dll
API, but the problem is that the animation is not very smooth as if you open it in the browser, and the program will be very slow during the animation, so I don't know if there is another way to change the background without the lag, here is what i have done so far :Imports System.IO Public Class Form1 Private Declare Auto Function SystemParametersInfo Lib "user32.dll" (ByVal X As Integer, ByVal Y As Integer, ByVal Z As String, ByVal W As Integer) As Integer Dim FrameX As Integer Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Timer1.Start() End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick 'If the frame is not exist then loop from the begenning with the frame 0. If Not File.Exists(Application.StartupPath & "\Frames\animation" & FrameX & ".png") Then FrameX = 0 End If Try SystemParametersInfo(20, 0, Application.StartupPath & "\Frames\animation" & FrameX & ".png", 1 Or 2) Catch ex As Exception : End Try FrameX += 1 Timer1.Start() End Sub End Class