Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm sending a movie via email.

Will a file encoded with the ffmpeg's option libx264, be able to play back natively in Windows 8 without any external software?

ffmpeg -i in.avi -vcodec libx264 out.avi
share|improve this question
    
AFAIK WMP, even with the Media Center Pack, does not support H.264 MKVs. Never has (not unless a codec pack with the required splitter etc. is installed). Don't think the Store Video app can handle MKVs either. H.264 MP4s should play back fine though. –  Karan Nov 6 '12 at 17:29
    
Is there any particular ffmpeg cmd line you are using, or do you want help in crafting one? Mp4 is a good container to use. –  askvictor Nov 8 '12 at 10:30
1  
A codec will provide the algorithm for encoding the video (and a separate codec will do audio). A container does several things - it interleaves the audio and video (perhaps many streams of each, and subtitles), it adds information to allow the decoder to recover if the stream is corrupted (scratched disc, noisy transmission). Mp4, avi, mov, mkv, ogg, are containers, while mpeg, mpeg2, mpeg4, mp3 (actually mpeg 2, layer 3), vorbis, theora, vp3, aac are codecs. (mpeg4 is a bit confusing as it defines both codecs including h264, and a container) –  askvictor Nov 8 '12 at 10:40
add comment

3 Answers 3

up vote 4 down vote accepted
+50

TL;DR:

  • Windows 8 can play x264-encoded video as long as it's in an MP4 or 3GP file (reference)
  • AVI files might work, but don't have to, because AVI doesn't support everything x264 offers.

For further info, I'll point you to the answer I've posted here: What is a Codec (e.g. DivX?), and how does it differ from a File Format (e.g. MPG)? This goes way beyond what I'm writing here, but for this question, we can narrow it down a little.

What is x264?

So, first of all, libx264 is an FFmpeg library that allows FFmpeg to encode video using the x264 encoder. x264 again is just one encoder that encodes video in the H.264 codec standard – also known as MPEG-4 Part 10 AVC / Advanced Video Coding. The codec ("encoder/decoder") simply specifies a standard that encoders and decoders have to adhere to.

Because there's just a codec standard, there are many other H.264 encoders apart from x264 such as Mainconcept or even a built-in one from FFmpeg. But x264 is free, open source, very efficient and delivers good quality, which is why it's used so often.

Why do we need a container?

x264 can only encode actual video. You could theoretically just store it in a .264 file, and it'd be a valid video bit/bytestream. No audio, no subtitles, etc. But often, you don't just want to watch video without audio. This is why we need to merge video, audio and subtitles in one file. This file is called the container, as it contains all the individual media tracks.

A container will synchronize video and audio frames according to their Presentation Time Stamp (PTS), which makes sure they are displayed at exactly the same time.

Popular containers these days include …

  • MP4, short for MPEG-4 Part 14, not to be confused with video codec standards such as MPEG-4 Part 2 video (e.g. XviD-encoded) or MPEG-4 Part 10 video (the H.264 we've talked about above, e.g. x264-encoded).

  • MKV, short for Matroska, a container that can include almost everything you feed it.

  • AVI, a really old container format that is supported almost anywhere, but doesn't support a lot itself. Don't use it unless you really have to.

To sum it up: Codecs are stored inside of a container. Codecs represent the actual media, and the containers just bundle them into one file. You could call them both "formats", but don't use that term because it's ambiguous.

share|improve this answer
add comment

x.264 is an H.264 / MPEG-4 Part 10 encoder. H.264 codecs are supported:

enter image description here

Source: Building a rich and extensible media platform - MSDN Blogs

share|improve this answer
    
So, if I send the file they will need to downoad media center? I wonder if IE10 can play it is as the encoder is supported by metro applications. –  Mikhail Nov 6 '12 at 8:25
    
No, it seems that the Windows Store Video application can play it, and it ships with all versions of Windows 8. –  Caleb Jares Nov 6 '12 at 16:59
2  
@CalebJares: H.264 is a codec. Are you sure the container (such as MKV) will be supported? MKV =/= MP4, even though both can contain H.264 video streams. –  Karan Nov 6 '12 at 17:36
1  
@Misha - this is a good answer but doesn't take the final step to say what you need to do. If you use ffmpeg and the libx264 codec to generate an MP4 container with H.264 video / AAC audio, then people will be able to play it on Windows 8. If you use the same application and codec to produce an MKV container, then without installing additional software, they won't. –  PJC Nov 10 '12 at 22:39
add comment

It should play in Windows Media Player by default (x.264 is an MPEG-4 Part 10 / AVC encoder, which is supported). However, Windows Media Player does not necessarily ship by default with Windows (I think this is due to antitrust issues in Europe).

Not quite related to your question, but why not consider hosting the file online (YouTube, Picasa/Google+, Flickr)? Then your recipient just needs a web browser.

share|improve this answer
    
That is a solid suggestion, but we are sending this clip to a publishing house. –  Mikhail Nov 6 '12 at 6:41
    
x264 is an encoder, not a format or a collection of specifications. –  LordNeckbeard Nov 6 '12 at 7:32
    
askvictor, you can choose whether to buy the N version (without Media Player) or the regular one in Germany at least. If I remember correctly there were about 1000 sales of the Vista N back in the day which prompted Microsoft to sue the EU back because offering an SKU that isn't bought can hardly be called profitable. TL;DR: The N version isn't any default anywhere here. But it is sold if you want it desperately. –  Joey Nov 8 '12 at 6:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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