Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whenever I convert a video into mp4 with h.264 codec, it doesn't play immediately on Windows or iPad. It plays fine when I convert the video with mp4box. I use the following command to convert.

mp4box -hint video.mp4

I like to know what I'm adding to the video with mp4box..

How does it work?

share|improve this question
up vote 2 down vote accepted

Note that mp4box does not encode any video, it is only used to re-package existing content. So my guess is that you already have an encoded video and then use mp4box to add the hint option. While that workflow doesn't really make sense to me at first, let me explain what hint means:

The -hint option is probably called in order to introduce a so called Hint Track to the video file.

What is a hint track? Well, your video file itself is a series of bits, nothing more, and in some applications, this is very inefficient. Take the example of a server that streams the video. It has to encapsule the video into packets that are sent over the network. But how does the server know which parts of the video to put in which packet? If the server doesn't know the structure of the bitstream, it will not be able to correctly packetize it.

Here is where the hint track comes into play. It is generated to allow a streaming server to correctly packetize the video into RTP packets. Basically such a hint track says "Put part XY of the video in packet AB".

That all being said a true h.264 does not need to have a hint track for streaming, as h.264 has a Network Abstraction Layer that provides a streaming server with all the necessary information to packetize the video. Hinting is only necessary for MPEG-4 Visual videos (for example encoded with DivX or XviD).

Check if your encoder already outputs a valid mp4 file — which one do you use actually?

share|improve this answer
// Thank you for your very detailed information. I use handbrake. – user45326 May 21 '11 at 9:15
@user12077 That's interesting. So even if you're using the appropriate settings for iPad, the file generated by Handbrake don't open? – slhck May 21 '11 at 9:19
@user12077: If you are streaming this video then this hinting information is important, but I don't think it should be if its just being accessed as a local file. How exactly are you accessing the file for playback? If you are streaming it, does it play back fine if you play it back on the local machine? – Spectre May 22 '11 at 12:51
@Spectre // sorry for the delay in response; i'm actually streaming this file over the net. – user45326 Aug 12 '11 at 0:52

What program are you using to create/encode the h264 video in the place? It could be that the encoder is outputting a raw h264 file, this raw stream usually needs to be put into a container format, such as mkv or mp4, along with the audio stream, before its able to be played back.

Check your h264 encoder to see if it automatically puts the encoded video in an mp4 container for you, or if it has a specific profile/settings for your device. if it does, but still doesnt play back, it might just be a bug, in which case youll have to stick to using mp4box manually.

share|improve this answer
// I'm using HandBrake. – user45326 May 21 '11 at 9:15
Hmm, I just realised I may have misread your question, you say it doesn't "play immediately", does that mean that it doesn't play at all, or just takes longer than normal to start playing? – Spectre May 22 '11 at 12:47
// it takes longer than normal to start playing. – user45326 Aug 12 '11 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .