I'm trying to figure out what fourcc value I need to use but I'm a bit confused between file formats and codecs. I have a .mov file and MediaInfo reports it as shown below

I need to specify the fourcc value but can't see it explicitly listed. Is it the Color Space and Chroma subsampling values? If it is the text I'm using suggests I call the file a .avi but does it matter if I call it a .mov?

ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Format settings, GOP                     : M=2, N=5
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1h 8mn
Source duration                          : 1h 8mn
Bit rate mode                            : Variable
Bit rate                                 : 3 224 Kbps
Maximum bit rate                         : 768 Kbps
Width                                    : 1 024 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 1.942
Original display aspect ratio            : 16:9
Frame rate mode                          : Variable
Frame rate                               : 25.000 fps
Minimum frame rate                       : 3.125 fps
Maximum frame rate                       : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.219
Stream size                              : 1.53 GiB (100%)
Source stream size                       : 1.54 GiB (100%)
Language                                 : English
Encoded date                             : UTC 2016-01-16 15:40:20
Tagged date                              : UTC 2016-03-09 18:41:42
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601

1 Answer 1


FourCCs are Microsoft's ID tags for streams e.g. avc1 for H.264/AVC or mp4a for an AAC audio stream. The container doesn't really matter.

If you want to change the FourCC, use ffmpeg like so

ffmpeg -i input.mov -strict -2 -c copy -vtag ABCD new.mov

where ABCD is your new 4CC/tag.

You current file already shows avc1 for the video stream, which is default and expected.

  • I'm not looking to change the fourcc I actually want to know for sure I use the right value when I pass them as a argument to an OpenCV VideoWriter function call to split the original file into smaller segments. Does .avi or .mov matter if I have the fourcc set correctly?
    – Michael
    Commented May 5, 2016 at 19:12
  • Ah, don't know about OpenCV but there's broadly two steps involved - calling a demuxer so that OpenCV can locate and extract the video track. FourCC isn't involved here. And once the video track is being read, calling a H.264 bitstream reader/decoder to correctly split the video - FourCC is required to call the correct library or module. avc1 is good for the 2nd part. Don't know OpenCV, so can't help with first. Maybe, based on extension, it auto-selects?
    – Gyan
    Commented May 5, 2016 at 19:23
  • Found this property value in OpenCV current_vid.get(cv2.CAP_PROP_FOURCC) which might do the trick for me but
    – Michael
    Commented May 8, 2016 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.