From 8df143f898f69175b62b73b0700e4de731838bd3 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 28 Oct 2015 12:11:51 -0400 Subject: [PATCH 1/2] updating frame compilation. Making the frame rate a double instead of an int. --- Sources/Video.FFMPEG/VideoFileWriter.cpp | 8 ++++---- Sources/Video.FFMPEG/VideoFileWriter.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/Video.FFMPEG/VideoFileWriter.cpp b/Sources/Video.FFMPEG/VideoFileWriter.cpp index d9ad7f47..ab400a4e 100644 --- a/Sources/Video.FFMPEG/VideoFileWriter.cpp +++ b/Sources/Video.FFMPEG/VideoFileWriter.cpp @@ -31,7 +31,7 @@ namespace AForge { namespace Video { namespace FFMPEG static void write_video_frame( WriterPrivateData^ data ); static void open_video( WriterPrivateData^ data ); -static void add_video_stream( WriterPrivateData^ data, int width, int height, int frameRate, int bitRate, +static void add_video_stream(WriterPrivateData^ data, int width, int height, double frameRate, int bitRate, enum libffmpeg::CodecID codec_id, enum libffmpeg::PixelFormat pixelFormat ); // A structure to encapsulate all FFMPEG related private variable @@ -71,18 +71,18 @@ void VideoFileWriter::Open( String^ fileName, int width, int height ) Open( fileName, width, height, 25 ); } -void VideoFileWriter::Open( String^ fileName, int width, int height, int frameRate ) +void VideoFileWriter::Open(String^ fileName, int width, int height, double frameRate) { Open( fileName, width, height, frameRate, VideoCodec::Default ); } -void VideoFileWriter::Open( String^ fileName, int width, int height, int frameRate, VideoCodec codec ) +void VideoFileWriter::Open( String^ fileName, int width, int height, double frameRate, VideoCodec codec ) { Open( fileName, width, height, frameRate, codec, 400000 ); } // Creates a video file with the specified name and properties -void VideoFileWriter::Open( String^ fileName, int width, int height, int frameRate, VideoCodec codec, int bitRate ) +void VideoFileWriter::Open(String^ fileName, int width, int height, double frameRate, VideoCodec codec, int bitRate) { CheckIfDisposed( ); diff --git a/Sources/Video.FFMPEG/VideoFileWriter.h b/Sources/Video.FFMPEG/VideoFileWriter.h index 43b221ce..ce5a8122 100644 --- a/Sources/Video.FFMPEG/VideoFileWriter.h +++ b/Sources/Video.FFMPEG/VideoFileWriter.h @@ -90,9 +90,9 @@ namespace AForge { namespace Video { namespace FFMPEG /// /// Thrown if no video file was open. /// - property int FrameRate + property double FrameRate { - int get( ) + double get() { CheckIfVideoFileIsOpen( ); return m_frameRate; @@ -202,7 +202,7 @@ namespace AForge { namespace Video { namespace FFMPEG /// codec. /// /// - void Open( String^ fileName, int width, int height, int frameRate ); + void Open(String^ fileName, int width, int height, double frameRate); /// /// Create video file with the specified name and attributes. @@ -226,7 +226,7 @@ namespace AForge { namespace Video { namespace FFMPEG /// A error occurred while creating new video file. See exception message. /// Cannot open video file with the specified name. /// - void Open( String^ fileName, int width, int height, int frameRate, VideoCodec codec ); + void Open(String^ fileName, int width, int height, double frameRate, VideoCodec codec); /// /// Create video file with the specified name and attributes. @@ -255,7 +255,7 @@ namespace AForge { namespace Video { namespace FFMPEG /// A error occurred while creating new video file. See exception message. /// Cannot open video file with the specified name. /// - void Open( String^ fileName, int width, int height, int frameRate, VideoCodec codec, int bitRate ); + void Open(String^ fileName, int width, int height, double frameRate, VideoCodec codec, int bitRate); /// /// Write new video frame into currently opened video file. @@ -304,7 +304,7 @@ namespace AForge { namespace Video { namespace FFMPEG int m_width; int m_height; - int m_frameRate; + double m_frameRate; int m_bitRate; VideoCodec m_codec; From 2150c5f6c55600c86d25103d0a94159512e1a59e Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 28 Oct 2015 13:53:43 -0400 Subject: [PATCH 2/2] one more reference update --- Sources/Video.FFMPEG/VideoFileWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Video.FFMPEG/VideoFileWriter.cpp b/Sources/Video.FFMPEG/VideoFileWriter.cpp index ab400a4e..197b4979 100644 --- a/Sources/Video.FFMPEG/VideoFileWriter.cpp +++ b/Sources/Video.FFMPEG/VideoFileWriter.cpp @@ -374,7 +374,7 @@ static libffmpeg::AVFrame* alloc_picture( enum libffmpeg::PixelFormat pix_fmt, i } // Create new video stream and configure it -void add_video_stream( WriterPrivateData^ data, int width, int height, int frameRate, int bitRate, +void add_video_stream( WriterPrivateData^ data, int width, int height, double frameRate, int bitRate, enum libffmpeg::CodecID codecId, enum libffmpeg::PixelFormat pixelFormat ) { libffmpeg::AVCodecContext* codecContex;