Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
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.
-
Is there a set of working P/Invoke declarations for FFMpeg, libavutil, libavformat and libavcodec in .NET ?
30 août 2011, par casperOneI'm currently looking to access libavutil, libavformat and libavcodec (all part of FFMpeg) from .NET.
Currently, I'm getting the libraries from the automated builds of the shared FFMpeg package performed every night for Windows 32-bit.
I am also using the code from the ffmpeg-sharp project. In that project, I have removed a number of classes that were not compiling (they are wrapper classes not the P/Invoke declarations).
The code compiles fine, but I am running into a few issues.
First, it appears that the build of av*.dll uses the cdecl calling convention, as I was receiving a number of
PInvokeStackImbalanceException
when trying to callav_open_input_file
. This was easy enough to change to get it to work right. TheAVFormatContext
structure is populated.After that, I want to call
av_find_stream_info
to get information about the streams in the file. However, when calling that with theAVFormatContext
retrieved from the call toav_open_input_file
, anAccessViolationException
is thrown indicating that I am trying to read or write from protected memory.Has anyone used P/Invoke to access the libavutil, libavformat and libavcodec dll libraries through P/Invoke and have gotten it to work?
I should mention that working with the command-line version of FFMpeg, while a solution, is not a viable solution in this case, access needs to occur through the libraries. The reason for this is that I'd have to thrash the disk way too much to do what I need to do (I have to do a frame-by-frame analysis of some very high definition video) and I want to avoid the disk as much as possible.
-
FFMPEG Convert from mov, mjpeg codec error
30 août 2011, par vitelI've a problem when i try to convert a .mov to a .webm with ffmpeg... I've no problems from any others video format.
I've enable the Quicktime formats "--enable-zlib" and with the "ffmpeg -formats" command i get .mov files as encode or decode.
When i try to transform a video i get this :
# ffmpeg -i /var/www/static/uploads/usersVideos/cavity0.mov -vcodec mjpeg /var/www/static/uploads/usersVideos/cavity.webm ffmpeg version N-32159-gc70e852, Copyright (c) 2000-2011 the FFmpeg developers built on Aug 30 2011 14:16:07 with gcc 4.4.5 configuration: --enable-gpl --enable-libmp3lame --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx libavutil 51. 14. 0 / 51. 14. 0 libavcodec 53. 12. 0 / 53. 12. 0 libavformat 53. 10. 0 / 53. 10. 0 libavdevice 53. 3. 0 / 53. 3. 0 libavfilter 2. 37. 0 / 2. 37. 0 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x13b7320] stream 0, error opening alias: path='/matlab_sv13/work/cavity_flow/up500.jpg', dir='cavity_flow', filename='up500.jpg', volume='NONAME', nlvl_from=1, nlvl_to=1** [mov,mp4,m4a,3gp,3g2,mj2 @ 0x13b7320] Could not find codec parameters (Video: mjpeg (jpeg / 0x6765706A), 434x343, 4762 kb/s) /var/www/static/uploads/usersVideos/cavity0.mov: could not find codec parameters [1] 8265 exit 1 ffmpeg -i /var/www/static/uploads/usersVideos/cavity0.mov -vcodec mjpeg
Someone has an idea?