$ osgmovie --audio movie.avi.ffmpeg
FFmpegImageStream::open audio failed, audio stream will be disabled: unknown audio format
With the attached FFmpegDecoderAudio.cpp, audio sounds correctly.
I am also attaching a modified version of FindFFmpeg.cmake that allows to set as FFMPEG_DIR the ffmpeg compiled in the source directory structure. It should not break anything as it only adds some additional search paths.
"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14654 16af8721-9629-0410-8352-f15c8da7e697
$ osgmovie --audio movie.avi.ffmpeg
FFmpegImageStream::open audio failed, audio stream will be disabled: unknown audio format
With the attached FFmpegDecoderAudio.cpp, audio sounds correctly.
I am also attaching a modified version of FindFFmpeg.cmake that allows to set as FFMPEG_DIR the ffmpeg compiled in the source directory structure. It should not break anything as it only adds some additional search paths.
"
Note from Robert Osfield, I have found in testing that audio quality is not good for planar floating point formats, even with adding support for SDL2 to the osgmovie example. I haven't yet tracked down the cause of these audio problems or a solution.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14609 16af8721-9629-0410-8352-f15c8da7e697
Header update
FindFFmpeg.cmake has been changed in order to support the new header include format for FFmpeg. In the 1.0 release, a new file had been added with the name “time.h” in the avutil library. The previous method of adding includes caused conflicts with the ANSI C “time.h” file. Now the include directive will only use the main include folder. All files using the old include format have been updated to reflect the change.
Added __STDC_CONSTANT_MACROS define to CMakeLists.txt
Since there is no guarantee that FFmpegHeaders.hpp will be included before stdint.h is included, the define has been moved from FFmpegHeaders.hpp to be part of the CMakeLists.txt for the FFmpeg plugin. This will allow the define to work on all compilers regardless of include order.
Replaced AVFormatParameters with AVDictionary
AVFormatParameters is no longer supported in FFmpeg and has been replaced with a key/value map of strings for each setting. FFmpegParameters and FFmpegDecoder has been updated to reflect this.
Replaced av_open_input_file with avformat_open_input
FFmpeg now opens files using avformat_open_input. Since the av_open_input_file method is deprecated, the FFmpegDecoder class has been updated to reflect this change.
Added custom AVIOContext field to options
Since some formats and inputs may not be supported by FFmpeg, I have added a new parameter that allows a user to allocate their own AVIOContext. This class will allow for creating a read, seek, and write callback if they desire.
Checking for start_time validity
It is possible for some file formats to not provide a start_time to FFmpeg. This would cause stuttering in the video since the clocks class would be incorrect.
Removed findVideoStream and findAudioStream
The new FFmpeg release already has a function that will find the best audio and video stream. The code has been replaced with this function.
Updated error reporting
Some functions would not log an error when opening a file or modifying a file failed. New logs have been added as well as a function to convert error numbers to their string descriptions.
decode_video has been replaced
The old decode_video function would remove extra data that some decoders use in order to properly decode a packet. Now av_codec_decode_video2 has replaced that function.
Picture format changed from RGBA32 to RGB24
Since most video will not contain an alpha channel, using a 24 bit texture will use less memory."