Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
A .NET P/Invoke to convert with ffmpeg ?
31 août 2011, par ShimmyI need to create a program that should convert audio and video files to supported types.
I've found ffmpeg to be a great tool. However I donno C (which ffmpeg was written with), and I was wondering if there is a way (besides command-line which I donnu if I would use since I'm not sure if you can control the conversion process and get info about its percentage) that I can interact with ffmpeg and build a conversion program on it's API.
Basically I'm looking for a single .NET-compatible method:
void Convert(sourceFile, targetFile, string targetExtension);
It shouldn't ask for bitrate etc., but only should it try to make a 1 to 1 conversion.
I don't know how to write the underlying P/Invoke, and since I donno ffmpeg from inside, I can't tell what dll it uses, so even I'd want to write the PI myself, I don't know what among the zillion functions of the ffmpeg libraries the conversion functions are.
So any guidance or approach will be really appreciated.
-
Trouble with the ffmpeg -ss flag when capturing one frame from a Macbook iSight webcam
31 août 2011, par AndyFor about five years I've used ffmpeg in a shell script to grab one frame from my linux'd-up Macbook's iSight:
ffmpeg -f video4linux2 -s 640x480 -r 15 -i /dev/video0 -an -vframes 1 -vcodec mjpeg -y -sameq -ss 1.5 snapshot.jpg
I just upgraded my Ubuntu distro from Lucid to Natty (ffmpeg ver. 0.6.2-4:0.6.2-1ubuntu1). Now that syntax turns the iSight on but hangs indefinitely.
[output snipped, ending with:] frame= 0 fps= 0 q=0.0 Lsize= -0kB time=10000000000.00 bitrate= -0.0kbits/s video:0kB audio:0kB global headers:0kB muxing overhead -inf%
Without the '-ss' flag it seems to successfully grab the first frame and exit immediately - the only difference in output being:
frame= 1 fps= 0 q=0.0 Lsize= -0kB time=0.07 bitrate= -2.6kbits/s video:16kB audio:0kB global headers:0kB muxing overhead -100.132730%
However, the '-ss 1.5' was necessary to delay the frame capture by 1.5 seconds to allow the cam sufficient time to adjust the exposure.
The -itsoffset flag seemed promising, but doesn't seem to change ffmpeg's behavior (ie doesn't hang, but no delay).
Any ideas?
-
Using FFmpeg from .NET
31 août 2011, par Lieven CardoenI have been searching for an hour on how to use FFmpeg from .NET and it seems you need to execute the FFmpeg.exe with a Process to get things done. To get a duration of an flv file for instance, you would need to start using grep to get something back out of cmd window. It all seems complicated... + you'd have to start installing things on remote servers (@ customers)...
Is there another way? Aren't there dll's containing the FFmpeg logic? Other solutions to get some information out of flv files in .NET?
-
Anyone know of a set of C# bindings for FFMPEG ?
31 août 2011, par MikeJDoes anyone know of a set of bindings for C# to drive the FFMpeg library directly ? I could shell to ffmpeg.exe directly but I found it hard to sync/control as a separate process. any help would be appreciated.
-
Convert raw image using open-source library with permissive license
30 août 2011, par BrianI need to convert a raw, rgb32-formatted image to a PNG with a library (written in, in order of preference, Java, C, C++) having a permissive (e.g. BSD or Apache) license.
I'm able to convert the image using FFmpeg with this call:
ffmpeg.exe -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 20x40 -i infile -f image2 -vcodec png out.png
where 20x40 is the width by the height.
But, sadly, I need to avoid FFmpeg due to its license.
I've seen people speculate that libpng could do the job, but I'm skeptical given the documentation I've seen at the libpng site. Perhaps you'll give an example.
I don't know what the rawvideo and rgb32 values mean to FFmpeg, so I asked this question.
EDIT 1: edited the ffmpeg call to show width x height.