Skip to content

Possibility to select "yuyv" encoding #15

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions src/apps/linux/cam2web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ XManualResetEvent ExitEvent;
struct
{
uint32_t DeviceNumber;
bool JpegEncoding;
uint32_t FrameWidth;
uint32_t FrameHeight;
uint32_t FrameRate;
Expand Down Expand Up @@ -107,6 +108,7 @@ class CameraErrorListener : public IVideoSourceListener
void SetDefaultSettings( )
{
Settings.DeviceNumber = 0;
Settings.JpegEncoding = true;
Settings.FrameWidth = 640;
Settings.FrameHeight = 480;
Settings.FrameRate = 30;
Expand Down Expand Up @@ -265,6 +267,10 @@ bool ParseCommandLine( int argc, char* argv[] )
{
Settings.CameraTitle = value;
}
else if ( key == "type" )
{
Settings.JpegEncoding = ( value != "yuyv" );
}
else
{
break;
Expand Down Expand Up @@ -296,6 +302,7 @@ bool ParseCommandLine( int argc, char* argv[] )
printf( "Available command line options: \n" );
printf( " -dev:<num> Sets video device number to use. \n" );
printf( " Default is 0. \n" );
printf( " -type:<jpeg|yuyv> Sets video device encoding type to use. \n" );
printf( " -size:<0-12> Sets video size to one from the list below: \n" );
printf( " 0: 320x240 \n" );
printf( " 1: 480x360 \n" );
Expand Down Expand Up @@ -408,6 +415,7 @@ int main( int argc, char* argv[] )
xcamera->SetVideoDevice( Settings.DeviceNumber );
xcamera->SetVideoSize( Settings.FrameWidth, Settings.FrameHeight );
xcamera->SetFrameRate( Settings.FrameRate );
xcamera->EnableJpegEncoding( Settings.JpegEncoding );

// restore camera settings
serializer.LoadConfiguration( );
Expand Down