What is MIME type "video/x-mpeg"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

video/x-mpeg is a MIME type used for video files encoded using the MPEG-2 standard. It handles compressed video and audio streams.

Key Purposes:
This type is essential for delivering streaming video data over networks. It is also used in legacy multimedia applications and some broadcast television systems.

Files such as MPG and MPEG use this MIME type to ensure proper handling and playback in various applications.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: video/x-mpeg    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="video/x-mpeg">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'video/x-mpeg');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the difference between video/x-mpeg and video/mpeg?

The video/mpeg MIME type is the standard IANA-registered identifier for MPEG video content. The video/x-mpeg type is a non-standard, experimental, or legacy alias often used in older systems or specific server configurations. While modern web servers should prioritize the standard type, video/x-mpeg is still recognized by many applications for backward compatibility.

Does HTML5 natively support video/x-mpeg playback?

Generally, no. Most modern browsers (Chrome, Firefox, Safari) do not natively support the MPEG-1 or MPEG-2 video codecs associated with this MIME type in the HTML5 <video> element. To ensure video plays across all devices, it is recommended to convert these files to H.264 (video/mp4) or WebM (video/webm).

How do I configure Apache to serve video/x-mpeg files?

To ensure your Apache server sends the correct header for legacy MPEG files, add the following line to your .htaccess file or httpd.conf: AddType video/x-mpeg .mpg .mpeg. This instructs the server to associate the specific file extensions with this MIME type.

Why does my MPG file download instead of playing in the browser?

This usually happens for two reasons: either the server is sending a generic MIME type like application/octet-stream, or the browser does not support the video codec (MPEG-1/2). Since most modern browsers cannot render video/x-mpeg inline, they default to downloading the file for local playback in a media player like VLC.

How do I add video/x-mpeg support to Nginx?

You can define the MIME type mapping in your nginx.conf or the mime.types file included by Nginx. Add the following entry within the types block: video/x-mpeg mpg mpeg;. After saving the file, reload Nginx to apply the changes.

Which file extensions are associated with video/x-mpeg?

This MIME type is primarily associated with the .mpg and .mpeg file extensions. These containers typically hold video and audio streams encoded using the MPEG-1 or MPEG-2 standards.

Is video/x-mpeg safe to open?

Video files are generally safe, but vulnerabilities in media players (buffer overflows) can sometimes be exploited by malformed files. It is best to open these files using updated, reputable media players and to scan files from unknown sources before playback.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.