Skip to content

Where is the streaming part? #2

@Tsardoz

Description

@Tsardoz

I have looked over the code for the part that streams to localhost but cannot find it.
Is this it (in MainStreamer)?

` VideoCapture cap(VIDEO_FILE, CAP_FFMPEG);

if(!cap.isOpened()){ FrameError=true; goto Ferr; }

if (!cap.read(frame)) { FrameError=true; goto Ferr; }

cout << "Camera start streaming...." << endl;
//reset lock mechanism
unlink(SWAP_IMG_FILE);
unlink(SWAP_RDY_FILE);

while(true)
{
    //wait until ready
    while(FileExists(SWAP_IMG_FILE) || FileExists(SWAP_RDY_FILE)) cap.read(frame);
    //event app is ready to recieve a new frame
    cap.read(frame);
    cv::resize(frame, norm_frame, cv::Size(320, 240));
    imwrite(SWAP_IMG_FILE,norm_frame);
    //signal image to file writing is done
    Fdone.open(SWAP_RDY_FILE);
    Fdone.close(); //write empty file
}`

It just seems to write the image to SWAP_IMG_FILE.
I am new to c++ - just trying to work it out.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions