I'd like to convert mp3's to lower bitrates, as well as possibly convert video to mp3 using Perl. I looked at the ffmpeg module but it doesn't appear that it supports converting files, the only example I saw was grabbing pictures out of a video stream. Is there a way to do this in Perl with out using system() to call ffmpeg?
Can I use ffmpeg from inside a Perl script without a system call?
There is a project called
pacpl which does a wide variety of audio and a least some video conversions. Looking at the source, it does use the
system() command to run third-party utilities such as
ffmpeg. I'm interested in doing conversions similar to what you asked about and I plan on trying out
So far it seem like there are no pure Perl answers. All of the methods use some other conversion software. Which tells me it's probably more efficient to use some other program written in C.
So I would turn the question back to you: what is your reason for not wanting to use
Why do you want to avoid another process? I have a Perl script which does this for me and I fork a process for each video I want to convert. That way I can convert several videos at the same time and have my master Perl program do whatever else it needs to do.
You don't need to use system, which blocks until it is done. There are many other ways to communicate with external processes. See the perlipc documentation for details.