1 | initial version |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
OpenCV doesn't have a function to get the list of available codecs. But, it's really useful to programmatically get this list or you just need to know if a codec is available or to know its fourcc ?
after this, some points:
int codec=CV_FOURCC('M','R','L',E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. MPEG, DIVX, H264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, VideoWriter uses VFW (Video For Windows API) thus any available codec that is VFW compliant can be used with VideoWriter
.
To check for Installed Video Codecs on you system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
2 | No.2 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
OpenCV doesn't have a function to get the list of available codecs. But, it's really useful to programmatically get this list or you just need to know if a codec is available or to know its fourcc ?
after this, some points:
int codec=CV_FOURCC('M','R','L',E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. MPEG, DIVX, H264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, VideoWriter cv::VideoWriter uses VFW (Video For Windows API) thus any available codec that is VFW compliant can be used with VideoWriter
.
To check for Installed installed Video Codecs on you your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
3 | No.3 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
UPDATE
OpenCV doesn't have a function to get the list of available codecs. But, it's really useful to programmatically To a get this list of available codecs you need to call some system function. Pn Windows OpenCV just calls the function that pup up the OS codec form.
BTW each codec follows some specs (frame size or you just need to know ratio, fps, compression ...) thus if your app provides codec selection you have to manage codec specs too.
You might define a codec is available or to know its fourcc ?vector of supported codecs than test if they are available at start-up with multiple calls to VideoWriter::open and write. Something like this:
vector<int> availableCodecs;
vector<int> supportedCodec({
CV_FOURCC('M','J','P','G'),
CV_FOURCC('M','R','L','E'),
others you can support ...
});
for(int i=0; i<supportedCodec.size(); i++) {
VideoWriter vw("test.avi", supportedCodec[i], ...);
if(vw.isOpened())
if (vw.write(testImg))
availableCodecs.push_back(supportedCodec[i]);
vw.release();
}
endUPDATE
after this, some points:
int codec=CV_FOURCC('M','R','L',E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. MPEG, DIVX, H264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, cv::VideoWriter uses VFW (Video For Windows API) thus any available codec that is VFW compliant can be used with VideoWriter
.
To check for installed Video Codecs on your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
4 | No.4 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
UPDATE
OpenCV doesn't have a function to get the list of available codecs. To a get list of available codecs you need to call some system function. Pn Windows On Windows, OpenCV just calls the function that pup up the OS codec form.
BTW each codec follows some specs (frame size or ratio, fps, compression ...) thus if your app provides codec selection you have to manage codec specs too.
You might define a vector of supported codecs than test if they are available at start-up with multiple calls to VideoWriter::open and write. Something like this:
vector<int> availableCodecs;
vector<int> supportedCodec({
CV_FOURCC('M','J','P','G'),
CV_FOURCC('M','R','L','E'),
others you can support ...
});
for(int i=0; i<supportedCodec.size(); i++) {
VideoWriter vw("test.avi", supportedCodec[i], ...);
if(vw.isOpened())
if (vw.write(testImg))
availableCodecs.push_back(supportedCodec[i]);
vw.release();
}
endUPDATE
after this, some points:
int codec=CV_FOURCC('M','R','L',E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. MPEG, DIVX, H264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, cv::VideoWriter uses VFW (Video For Windows API) thus any available codec that is VFW compliant can be used with VideoWriter
.
To check for installed Video Codecs on your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
5 | No.5 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
UPDATE
OpenCV doesn't have a function to get the list of available codecs. To a get list of available codecs you need to call some system function. On Windows, OpenCV just calls the function that pup up the OS codec form.
The CV_FOURCC('M','J','P','G')
codec should be supported natively by OpenCV (no need of external library)
BTW each codec follows some specs (frame size or ratio, fps, compression ...) thus if your app provides codec selection you have to manage codec specs too.
You might define a vector of supported codecs than test if they are available at start-up with multiple calls to VideoWriter::open and write. Something like this:
vector<int> availableCodecs;
vector<int> supportedCodec({
CV_FOURCC('M','J','P','G'),
CV_FOURCC('M','R','L','E'),
others you can support ...
});
for(int i=0; i<supportedCodec.size(); i++) {
VideoWriter vw("test.avi", supportedCodec[i], ...);
if(vw.isOpened())
if (vw.write(testImg))
availableCodecs.push_back(supportedCodec[i]);
vw.release();
}
endUPDATE
after this, some points:
int codec=CV_FOURCC('M','R','L',E')codec=CV_FOURCC('M','R','L','E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. MPEG, DIVX, H264, XVID, X264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, cv::VideoWriter uses VFW (Video For Windows API) thus any available codec that is VFW compliant can be used with VideoWriter
.
To check for installed Video Codecs on your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
6 | No.6 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
UPDATE
OpenCV doesn't have a function to get the list of available codecs. To a get list of available codecs you need to call some system function. On Windows, OpenCV just calls the function that pup up the OS codec form.
The CV_FOURCC('M','J','P','G')
codec should be supported natively by OpenCV (no need of external library)
BTW each codec follows some specs (frame size or ratio, fps, compression ...) thus if your app provides codec selection you have to manage codec specs too.
You might define a vector of supported codecs than test if they are available at start-up with multiple calls to VideoWriter::open and write. Something like this:
Size myFrameSize(320,240); //codecs are sensible to frame size
Mat testImg(myFrameSize,CV_8UC3); //and frame depth
vector<int> availableCodecs;
vector<int> supportedCodec({
CV_FOURCC('M','J','P','G'),
CV_FOURCC('M','R','L','E'),
others you can support ...
});
for(int i=0; i<supportedCodec.size(); i++) {
VideoWriter vw("test.avi", supportedCodec[i], ...);
if(vw.isOpened())
if (vw.write(testImg))
availableCodecs.push_back(supportedCodec[i]);
vw.release();
}
endUPDATE
after this, some points:
int codec=CV_FOURCC('M','R','L','E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. XVID, X264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, cv::VideoWriter uses VFW (Video For Windows API) thus any available codec that is VFW compliant can be used with VideoWriter
.
To check for installed Video Codecs on your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
7 | No.7 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
UPDATE
OpenCV doesn't have a function to get the list of available codecs. To a get list of available codecs you need to call some system function. On Windows, OpenCV just calls the function that pup up the OS codec form.
The CV_FOURCC('M','J','P','G')
codec should be supported natively by OpenCV (no need of external library)
BTW each codec follows some specs (frame size or ratio, fps, compression ...) thus if your app provides codec selection you have to manage codec specs too.
You might define a vector of supported codecs than test if they are available at start-up with multiple calls to VideoWriter::open and write. Something like this:
Size myFrameSize(320,240); //codecs are sensible to //some codecs have limitations about frame size
Mat testImg(myFrameSize,CV_8UC3); //and frame depth
vector<int> availableCodecs;
vector<int> supportedCodec({
CV_FOURCC('M','J','P','G'),
CV_FOURCC('M','R','L','E'),
others you can support ...
});
for(int i=0; i<supportedCodec.size(); i++) {
VideoWriter vw("test.avi", supportedCodec[i], ...);
if(vw.isOpened())
if (vw.write(testImg))
availableCodecs.push_back(supportedCodec[i]);
vw.release();
}
endUPDATE
after this, some points:
int codec=CV_FOURCC('M','R','L','E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. XVID, X264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, cv::VideoWriter uses VFWMJPG or VFW API (Video For Windows API) Windows) thus MJPG codec or any available codec that is VFW compliant can be used with VideoWriter
.
To check for installed Video Codecs on your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps
8 | No.8 Revision |
1st of all, codecs must be available on your system at runtime and doesn't depends on OpenCV but depends on codec you have installed on your system. This means that the codec must be available on the machine that runs the OpenCV application.
UPDATE
OpenCV doesn't have a function to get the list of available codecs. To a get list of available codecs you need to call some system function. On Windows, OpenCV just calls the function that pup up the OS codec form.
The CV_FOURCC('M','J','P','G')
codec should be supported natively by OpenCV (no need of external library)
BTW each codec follows some specs (frame size or ratio, fps, compression ...) thus if your app provides codec selection you have to manage codec specs too.
You might define a vector of supported codecs than test if they are available at start-up with multiple calls to VideoWriter::open and write. Something like this:
Size myFrameSize(320,240); //some codecs have limitations about frame size
Mat testImg(myFrameSize,CV_8UC3); //and frame depth
vector<int> availableCodecs;
vector<int> supportedCodec({
CV_FOURCC('M','J','P','G'),
CV_FOURCC('M','R','L','E'),
others you can support ...
});
VideoWriter vw;
for(int i=0; i<supportedCodec.size(); i++) {
VideoWriter vw("test.avi", vw.open("test.avi", supportedCodec[i], ...);
if(vw.isOpened())
if (vw.write(testImg))
availableCodecs.push_back(supportedCodec[i]);
vw.release();
}
endUPDATE
after this, some points:
int codec=CV_FOURCC('M','R','L','E')
for Microsoft RLE (see this http://www.fourcc.org/mrle/). This codec is native on Windows.codec=0; fps=0;
you can create an uncompressed (raw) video file. In this case you have to deploy the ffmpeg's DLL with your exe.I would suggest to install some 3rd party codec pack, (take a look also to ffdshow). This will install on your system a lot of codecs (e.g. XVID, X264, HFYU,...) that you can use with many applications including OpenCV or VirtualDub.
Remember that on Windows, cv::VideoWriter uses MJPG or VFW API (Video For Windows) thus MJPG codec or any available codec that is VFW compliant can be used with VideoWriter
.
To check for installed Video Codecs on your system:
About > Technical Info
components > Multimedia > Codec video
codec = -1
. VideoWriter pops up codec selection dialog from the system, the list include all available and compatible codecs.Finally, get the 4 char code (fourcc) for your selected codec from http://www.fourcc.org/ and create the int code using int codec = CV_FOURCC(...)
macro as above.
I hope this helps