How to use run ffmpeg command in ios - ios

I had successfully build ffmpeg into xcode but I didn't get idea , how to execute command into project.I research hard on it and fined how to play video using encoding and decoding,but did not get idea how to run command.

You cannot run ffmpeg command directly via code, instead you should leverage the c code to do encoding decoding which can be achieved by using objective c wrappers. FFmpegWrapper gives you a lightweight wrapper class for media conversion.

Related

Device handling in Nim

I am looking for a library that could capture streams of images from webcam or USB camera, and then converting image data into multidimensional matrices, in order to do some mathematical operation on them; afterward saving the result as a png file.
I am stuck in the first step. It seems there is only opencv to capture images from camera, which uses highgui.dll for the job. Unfortunately after installing opencv using nimble install opencv, and running a simple code
import opencv/imgproc
import opencv/highgui
import opencv/core
var capture = captureFromCam(CAP_ANY)
the error could not load: (lib|)opencv_highgui(249|231|)(d|).dll arises. Opencv cannot find the library to import necessary functions from it. So far I could not find any way to overcome this issue. In standard libraries of Nim, there are two libraries serial and winim that if I am not wrong, are handling device ports. I could not find a simple way to use them. The question is, what is the proper library for handling devices and how to use them in a simple manner?
For the rest of the job (manipulating image data) I think pixie is a good library to use. It would be good to know, if there is better library, in simplicity and performance.
As Christoph said, the nim package seems years out of date. However if you download Version 249 and put the right dlls into your directory or link them through your nimble file, your code will run.
For your code you would need to copy from opencv\build\x64\vc12\bin files opencv_core249.dll, opencv_highgui249.dll and opencv_imgproc249.dll
You might want to instead just write a quick wrapper for the functions you need from a newer version yourself since you probably only need a few functions. You can look at the nim-opencv library for how to wrap functions.
Or you could use a different application to capture the footage and nim to process it.

OpenCV - RTSP stream not opening

I have a RTPS streaming camera. The stream works fine when I test it with VLC:
vlc -vvv rtsp://192.168.0.23:554/stream
However with openCV it does not open:
cv::VideoCapture capture;
bool ok = capture.open("rtsp://192.168.0.23:554/stream");
returns false.
What can be the reason?
I had a similar problem. In my case the dll starts with "opencv_ffmpeg" was missing in the run path.
If you are using OpenCV 4+ you need to copy the ffmpeg related dll and paste it next to your executable. For example I've built my OpenCV with the BUILD_opencv_world option and I have a file named opencv_videoio_ffmpeg430_64.dll in my bin folder in the my build directory. Without that file it won't open the stream and shows nothing.
When using the VideoCaptuer class with OpenCV 4, in C++, it does not work with RTSP streams.
you can do it by OpenCV and python as below:
import cv2
str1=cv2.VideoCapture("RTSP Address")
while True:
_,frame=str1.read()
cv2.imshow('SOMENAME',frame)
s=cv2.waitkey(0)

How do I use Faust2Juce to convert faust.dsp to Jucer Project?

How do I use Faust2Juce to convert faust.dsp to Jucer Project?
Faust creates its code and UI from its own functional language , how do I continuously integrate to JUCE project?
After installing the faust compiler you can use within terminal:
faust2juce -standalone "Example.dsp"
...to get a standalone project.
faust2juce --help
Will give you a more extensive list of commands.
Alternatively use the online compiler, set the architecture to JUCE and then you can download the exec file (a producer project) from there.
Here is a github link to the architecture for more info.

ffmpeg and windows command line

I am trying to use ffmpeg for windows to convert thousands of images and sounds to a single video file.
ffmpeg -i apples.jpg -i oranges.jpg -i orangessound.wav -i bananas.jpg -vcodec mpeg4 test.avi
My delphi program generates the command line as a string, and I use shellexecute to call it.
But is it true that a command line cannot be longer than 8191 characters? If so, can ffmpeg read the parameters from a file instead?
It is not possible in this case to rename the pictures with consecutive numbers
You might want to consider using the open source libavcodec library in your own code instead. It is the same library that ffmpeg uses internally (there is a separate library called libav, which is an off-shoot of the original ffmpeg libavcodec library). Then you can do whatever you want with the files. You can look at the ffmpeg source code to see how it interprets the parameters you want to use, then adapt that logic to your own code.
ffmpeg does not support taking the entire command from file. you need to modify the code for your custom use.
it can take encoding parameter using "-fpre" option.

IplImage 'None' error on CaptureFromFile() - Python 2.7.1 and OpenCV 2.2 WinXP

I am running Python2.7.1 and OpenCV 2.2 without problems in my WinXP laptop and wrote a tracking program that is working without a glitch. But for some strange reason I cannot get the same program to run in any other computer where I tried to install OpenCV and Python (using the same binaries or appropriate 64 bit binaries). In those computers OpenCV seems to be correctly installed (although I have only tested and CaptureFromCamera() in the webcam of the laptop), but CaptureFromFile() return 'None' and give "error: Array should be CvMat or IplImage" after a QueryFrame, for example.
This simple code:
import cv /
videofile = cv.CaptureFromFile('a.avi') /
frame = cv.QueryFrame(videofile) /
print type(videofile) /
print type(frame)
returns:
type 'cv.Capture' /
type 'NoneType'
OpenCV and Python are in the windows PATH...
I have moved the OpenCV site-packages content back and forth to the Pyhton27 Lib\Site-packages folder.
I tried different avi files (just in case it was some CODEC problem). This AVI uses MJPEG encoding (and GSpot reports that ffdshow Video Decoder is used for reading).
Images work fine (I think): the simple convert code:
im = cv.LoadImageM("c:\tests\colormap3.tif")
cv.SaveImage("c:\tests\colormap3-out.png", im)
opens, converts and saves the new image...
I have tested with AVI files in different folders, using "c:\", "c:/", "c:\" and "c://".
I am lost here... Anyone has any idea of what stupid and noob mistake may be the cause of this? Thanks
It may sound stupid, but I just had the same issue with the same symptoms for the same code snippet (Python 2.7.1, Win 7, OpenCV 2.2.0). I changed file path from
capture = cv.CaptureFromFile('C:\Misc\tree.avi')
to
capture = cv.CaptureFromFile('C:/Misc/tree.avi')
and voila
<type 'cv.Capture'>
<type 'cv.iplimage'>
I was having this problem, and here is how I fixed it. I took a look at the output of OpenCV's cmake command, and it had the following line:
...
-- FFMPEG: NO
...
In order to fix this, you might be able to get away with simply installing the following libraries:
sudo apt-get install libavformat-dev libavcodec-dev libavfilter-dev libswscale-dev
Re-running cmake will hopefully now say:
...
-- FFMPEG: YES
...
Re-compile OpenCV, re-install it, and hopefully you can now read videos. If you still have problems, you can try to compile ffmpeg using the --enable-shared option, using these as guides:
http://opencv.willowgarage.com/wiki/FFMPEG
http://ubuntuforums.org/showthread.php?t=786095
Hope that helps.
This must be an issue with the default codecs. OpenCV uses brute force methods to open video files or capture from camera. It goes by trial and error through all sources/codecs/apis it can find in some reasonable order. (at least 1.1 did so).
That means that on n different systems (or days) you may get n different ways of accessing the same video. The order of multiple webcams for instance, is also non-deterministic and may depend on plugging order or butterflies.
Find out what your laptop uses, (re)install that on all the systems and retry.
Also, in the c version, you can look at the capture's properties
look for cvGetCaptureProperty and cvSetCaptureProperty where you might be able to hint to the format.
[EDIT]
Just looked i tup in the docs, these functions are also available in Python. Take a look, it should help.

Resources