Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating frame compilation. #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Sources/Video.FFMPEG/VideoFileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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( );

Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions Sources/Video.FFMPEG/VideoFileWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ namespace AForge { namespace Video { namespace FFMPEG
///
/// <exception cref="System::IO::IOException">Thrown if no video file was open.</exception>
///
property int FrameRate
property double FrameRate
{
int get( )
double get()
{
CheckIfVideoFileIsOpen( );
return m_frameRate;
Expand Down Expand Up @@ -202,7 +202,7 @@ namespace AForge { namespace Video { namespace FFMPEG
/// codec.</note></para>
/// </remarks>
///
void Open( String^ fileName, int width, int height, int frameRate );
void Open(String^ fileName, int width, int height, double frameRate);

/// <summary>
/// Create video file with the specified name and attributes.
Expand All @@ -226,7 +226,7 @@ namespace AForge { namespace Video { namespace FFMPEG
/// <exception cref="VideoException">A error occurred while creating new video file. See exception message.</exception>
/// <exception cref="System::IO::IOException">Cannot open video file with the specified name.</exception>
///
void Open( String^ fileName, int width, int height, int frameRate, VideoCodec codec );
void Open(String^ fileName, int width, int height, double frameRate, VideoCodec codec);

/// <summary>
/// Create video file with the specified name and attributes.
Expand Down Expand Up @@ -255,7 +255,7 @@ namespace AForge { namespace Video { namespace FFMPEG
/// <exception cref="VideoException">A error occurred while creating new video file. See exception message.</exception>
/// <exception cref="System::IO::IOException">Cannot open video file with the specified name.</exception>
///
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);

/// <summary>
/// Write new video frame into currently opened video file.
Expand Down Expand Up @@ -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;

Expand Down