How to I configure sox to work on mp4? - ffmpeg

I am using ubuntu 8.10. I wanted to know what I need to do to get SOX to work on MP4 files.

Yes..sox has support for mp4, m4p, & m4a. They're marked as optional in the pdf manual. Perhaps one has to compile sox from the source files e.g. the sox(version number).tar.gz source package...unpack it using an archive manager, then do something like make, make install, etc... while including the additional option for the mp4 types of files. Checkout the README file in the package to make sure.

Are you sure there's any support in SOX for them? You may have to use a separate encoder/decoder to go to/from mp4.

Related

electron-packager - exclude ffmpeg from final build

I am working on electron windows desktop app. I would like to make my build little bit smaller. I noticed that electron-packager add ffmpeg and other files into final build, my question is, is there possibility to make build without ffmpeg possibly without other unnecessary files (if there are any).
My build command look like this:
"electron-packager . hiss_xread --overwrite --asar --platform=win32 --arch=x64 --appCopyright=\"Copyright 2020 Tom Ravn, all rights reserved.\" --icon=src/favicon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Hiss xRead\""
Thank you very much in advance.

Use ffmpeg on OSX Xcode Project for Mac

I am planning to create a new app for personal use on my Mac that uses FFMPEG library, to store a feed from a RTSP IP camera.
Following this official installation procedure from FFMPEG I have manage to successfully achieve the following 2 steps:
To get ffmpeg for OS X, you first have to install ​Homebrew. If you don't want to use Homebrew, see the section below.
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then:
- brew install automake fdk-aac git lame libass libtool libvorbis
libvpx \ opus sdl shtool texi2html theora wget x264 xvid yasm
Question:
My question here because I am confused, is how to import a library into Xcode so I can use it in the application I am about to build for my Mac. I can see plenty of GitHub projects related to FFMPEG with IOS/Android, but none for OSX.
All the FFMPEG commands under terminal are working fine, such as converting a video etc.
If you look in /usr/local/Cellar/ffmpeg you will find the actual ffmpeg package and everything in homebrew is just symbolic links to that. For example:
/usr/local/bin/ffmpeg -> ../Cellar/ffmpeg/3.0.2/bin/ffmpeg
Now, if you stay in that directory and do this, you will find all the pkgconfig configuration settings for the constituent parts of ffmpeg:
find . -name \*.pc
./lib/pkgconfig/libavcodec.pc
./lib/pkgconfig/libavdevice.pc
./lib/pkgconfig/libavfilter.pc
./lib/pkgconfig/libavformat.pc
./lib/pkgconfig/libavresample.pc
./lib/pkgconfig/libavutil.pc
./lib/pkgconfig/libpostproc.pc
./lib/pkgconfig/libswresample.pc
./lib/pkgconfig/libswscale.pc
That means you can now find the include path and library paths that you need to put in the Xcode settings. So, for example, if you want the includes for libavutil, you can do:
pkg-config --cflags libavutil
and it will tell you:
-I/usr/local/Cellar/ffmpeg/3.0.2/include
If you want the library settings for libavfilter, you can do:
pkg-config --libs libavfilter
and it will tell you
-L/usr/local/Cellar/ffmpeg/3.0.2/lib -lavfilter
So that is how you get the settings for the compiler/linker. Then you need to put them into Xcode, and I have described that here - look at the bit with the yellow, red and blue boxes.
Hope that helps. Oh, you need to do:
brew install pkg-config
first to get the pkgconfig binary.
In general, you need to configure the Xcode target build settings to add /usr/local/include to the Header Search Path.
Then your #include <ffmpeg.h> (or whatever it's called) will start to work.
Then for linking to libffmpeg.a (or whatever it's called), you can do one of two things:
Add the file to the Additional Libraries and Frameworks of the build settings (selecting it via a file open dialog).
Add /usr/local/lib to the Library Search Paths and -lffmpeg to the Other Linker Flags.
(1. is better if you ask me).
I use Macports, so for me the paths are /opt/local/{include,lib} however with Homebrew there might be an additional level of directory (like /usr/local/ffmpeg/{include,lib}, but you should be able to work that out yourself.
I won't go into details of how to actually use FFMPEG as that is way too involved (and I know nothing about it).
Although this does not answer the specific question here ("how to import such and such libraries"),
for anyone googling here, these days to use FFmpeg in OSX you just
Use the famous import script of Kewlbear
which you can easily find here
https://github.com/kewlbear/FFmpeg-iOS-build-script
and which does everything.
It is a huge amount of non-trivial work maintaining such a build script, and fortunately there's someone who does that work on an ongoing basis.

How to create PDF documentation with Sphinx in Windows

I am using Sphinx to create documentation for my Python project in Windows. I need to generate PDF documentation. I found many explanation how to do this in Linux, but no good explanation how to do this in Windows. As far as i understand I need to create Latex format with Sphinx, and than use Texworks to convert Latex to PDF. Can someone provide step by step explanation how can I do this, assuming I created documentation in Latex format and installed Texworks?
Install MiKTeX (< 200mb)
wget -nv -N http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable-2.9.4757.exe
7z.exe x -y miktex-portable-2.9.4757.exe -o"miktex"
Add the bin directory to your path
SET Path=%Path%;%CD%\miktex\miktex\bin
Run Sphinx's "make.bat" to generate the .tex file.
SET SPHINXOPTS=-W -E
make.bat latex
Invoke MiKTeX's pdflatex:
cd build/latex
pdflatex.exe YOUR_PROJECT_NAME.tex
The resultant PDF will be in your build/latex directory
Install the full tex live distribution, it will install latex, PDF backends and texworks. Yes it is much, yes, it will dl and install for a fat hour depending on your pipe. But it will be sub gig total, and harddisks are large nowadays.
From what I see, Texworks is just a simple LaTeX editor with some build functionality and latex syntax highlighting. It is not really needed for just compiling (you could use notepad)
Then it should be a matter of simply putting the tex live binary directory i the path and doing
pdflatex <yourlatexdocument.tex>
on the cmdline, at least that is what I do with the latex output of our own documentation generating tool
As you have figured out: use Sphinx to generate LaTeX source, and then run it through a LaTex compiler to produce your PDF.
Instead of troubling yourself with installing LaTeX (which can be daunting) and getting an editor set up, I suggest that you use one of the on-line LaTeX services. You then only have to create a project in ShareLaTeX or Overleaf, for example (which are in the process of merging), upload the contents of the Sphinx build\latex directory, compile on-line, and download the finished PDF.
This works reasonably well, but since the output targets are very different (HTML vs a formal document), you may have to fiddle with the reST to get things the way you like it.

What parameters are required to use x264 via ffmpeg?

i have an AVI file, i have decoded it into Raw form first, now i want to encode it in .h264 format. I am using libavcodec.dll and libavformat.dll.
The point is when i try to open the codec from avcodec_open(AVCodecContext,AVCodec)
It doesnot open. Am i missing some parameters that i need to specify for execution of this method for the lib x264?
Any help will be deeply appreciated.
Thanks
There are two common ways to encode AVI file to H.264 using x264:
1, Compile and install ffmpeg, with --enable-shared, then compile and install x264. You'll see lavf: yes when configuring. Then do the converting using x264 cli or something else(such as DirectX264).
2, Compile and install x264, with --enable-shared, then compile and install ffmpeg with --enable-libx264. Then you will be able to convert using ffmpeg cli or something else(such as WinFF).
And btw .h264 is not a sufficient suffix, please use ".mkv", ".mp4" or something instead.

how to link ffmpeg to php.ini

hi i am using mac osx with mamp and i was wondering how i can link ffmpeg to php.ini so that i can use it with php exec() ?
the directory that ffmpeg got installed in is /users/sarmenhb/ffmpeg although i wish it didnt get installed here and got installed somewhere more appropriate, i sadly have no clue how to change the system to know where the new location is.
i read a few articles telling me to put something like extensions = /users/sarmenhb/ffmpeg/ffmpeg.so but looking in the directory i dont see a so file. i do see ffmpeg as a console app is that an so file itself?
thanks
ps: i did a test of ffmpeg in console from a flv file to a mp4 file and the audio didnt work on the new file. do i have to install something?
You can use the full path when executing ffmpeg:
exec("/users/sarmenhb/ffmpeg");

Resources