ofxFFmpegRecorder
ofxFFmpegRecorder copied to clipboard
Can't open video
Thank making this! Unfortunately, I cannot open my videos using Quicktime on OSX (or other video apps). I get the error message: "The file isn’t compatible with QuickTime Player." when I try to open my .mp4 files.
Any ideas?
Try to use VLC player
I think this has to do with the selected video codec.
Is there a way to set which codec get's used? Right now it seems to be args.push_back("-vcodec rawvideo"); or m_VideCodec("mpeg4")
works now.
I had to add args.push_back("-pix_fmt yuv420p");
std::vector<std::string> args;
std::copy(m_AdditionalInputArguments.begin(), m_AdditionalInputArguments.end(), std::back_inserter(args));
//args.push_back("-pix_fmts");
args.push_back("-y");
args.push_back("-an");
args.push_back("-r " + std::to_string(m_Fps));
args.push_back("-framerate " + std::to_string(m_Fps));
args.push_back("-s " + std::to_string(static_cast<unsigned int>(m_VideoSize.x)) + "x" + std::to_string(static_cast<unsigned int>(m_VideoSize.y)));
args.push_back("-f rawvideo");
//args.push_back("-pix_fmt rgb24");
args.push_back("-pix_fmt " + mPixFmt);
args.push_back("-vcodec rawvideo");
args.push_back("-i -");
args.push_back("-vcodec " + m_VideCodec);
args.push_back("-b:v " + std::to_string(m_BitRate) + "k");
args.push_back("-r " + std::to_string(m_Fps));
args.push_back("-pix_fmt yuv420p");
args.push_back("-framerate " + std::to_string(m_Fps));
std::copy(m_AdditionalOutputArguments.begin(), m_AdditionalOutputArguments.end(), std::back_inserter(args));
args.push_back(m_OutputPath);