Skip to content

Instantly share code, notes, and snippets.

View jpret's full-sized avatar

Jan Gabriel Pretorius jpret

View GitHub Profile
@mandyedi
mandyedi / redirect-io.cpp
Created June 6, 2017 22:09
Redirect cin and cout to file.
// https://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files
#include <iostream>
#include <fstream>
#include <string>
void f()
{
std::string line;
while(std::getline(std::cin, line)) //input from the file in.txt
@yohhoy
yohhoy / ff2cv.cpp
Last active December 14, 2024 12:44
Read video frame with FFmpeg and convert to OpenCV image
/*
* Read video frame with FFmpeg and convert to OpenCV image
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>