[FFmpeg-devel] Wrapping ffmpeg.c
nicolas.george at normalesup.org
Thu Jul 14 01:01:11 CEST 2011
Le quintidi 25 messidor, an CCXIX, Evan Klinger a écrit :
> I am trying to create a shared library that wraps most of the
> functionality/code in ffmpeg.c into a more user friendly API. The code
> is essentially the same as ffmpeg.c except the static variables have
> been replaced by a struct with the variables as members, and the
> struct is passed around to each function. Also, rather than using
> command line options, I am trying to mimic the behavior of FFmpeg's
> command line options programmatically. The code is successfully
> reading in the video file and creating the output file, but it is not
> using any of the settings I am supplying. For example, setting the
> audio rate, frame rate, bitrates, etc.
With ffmpeg command line, the order of parameters matters. Basically, if you
write "-ar 42000" to set the audio bitrate, it will affect the next input
(-i) or output file on the command line.
If your program imitates that behaviour, then:
> ret = set_input_file(tp, "/home/eklinger/Ray_Final.mp4");
> ret= set_output_file(tp, "/home/eklinger/out.mp4");
> ret= set_audio_codec(tp, "libfaac");
... you should try to live set_audio_codec before set_output_file, and the
same for the rest of the settings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel