ofxFFmpegRecorder icon indicating copy to clipboard operation
ofxFFmpegRecorder copied to clipboard

Can't open video

Open suprb opened this issue 6 years ago • 3 comments

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?

suprb avatar Oct 16 '19 05:10 suprb

Try to use VLC player

alptugan avatar Nov 15 '19 14:11 alptugan

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")

stephanschulz avatar Feb 05 '21 17:02 stephanschulz

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);

stephanschulz avatar Feb 05 '21 18:02 stephanschulz