Changes between Version 2 and Version 3 of HowToCheckIfFaststartIsEnabledForPlayback


Ignore:
Timestamp:
Nov 3, 2021, 5:43:44 PM (5 years ago)
Author:
Pascal S
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToCheckIfFaststartIsEnabledForPlayback

    v2 v3  
    11= ''(page under construction)'' =
    22
    3 = How to know if a H.264/MP4 file is ready for fast start playback =
     3= How to check if Fast Start is enabled for playback =
    44
    5 Normally, a MP4 file has all the metadata about all packets stored at the end of the file,
    6 unless it has been created by adding "faststart" to the -movflags option. In this latter case,
    7 an atom named "moov" is moved at the beginning of the MP4 file during the ffmpeg second pass.
     5== Introduction ==
    86
    9 This "faststart" allows to start the playback of the movie faster in some cases : the player does
    10 not need to read the full file before starting playback.
     7This '''How to''' applies to '''H.264/MP4''' files only but will probably work with '''H.264/MOV''' files too.
    118
    12 Therefore, the position of the "moov" atom in an existing MP4 file (begining or end) helps to
    13 know if fast start is operative or not for this file.
     9Streaming web sites recommend to upload videos with Fast Start enabled. It allows video playback to begin before the file has been completely downloaded.
     10
     11Why ?
     12
     13Normally, a MP4 file has all the metadata about all packets stored at the end of the file, unless it has been created by adding the '''-movflags faststart''' option to the ffmpeg command line. In this latter case, an atom named "moov" is moved at the beginning of the MP4 file during the ffmpeg second pass.
     14
     15Therefore, the location of the "moov" atom in an existing MP4 file (begining or end) helps to check if Fast Start is enabled or not for this file.
     16
     17Another atom named "mdat" may also help. If the "moov" atom is located before the "mdat" atom then the file is enabled for Fast Start playback.
    1418
    1519== Prerequisites ==
    1620
    17 This page is intended for Windows 10 users but can be used by Unix users with only small changes.
     21This page is intended for Windows 10 users but can be adapted by Unix users with only small changes.
    1822
    19 Prior to using the next *.BAT files, Windows users should download grep.exe and head.exe from
    20 an Internet site.
     23Prior to using the next batch files, Windows users should download '''grep.exe''' and '''head.exe''' from an Internet site.
    2124
    2225== First approach
    2326
    24 The first approach is to fully scan the H.264/MP4 files to look for mdat and moov atoms.
     27The first approach is to fully scan the H.264/MP4 files to look for "mdat" and "moov" atoms. Under Windows, the "delims=µ" parameter allows to manage file names containing white spaces or any other special character.
    2528{{{
    2629@echo off
     
    3033)
    3134pause
    32 exit
    3335}}}
    34 This batch file searches only the first occurence of either mdat atom or moov atom. When a
    35 MP4 file is ready for fast start playback, the moov atom appears first. When not, the mdat
    36 atom appears first.
     36This batch file searches only the first occurence of either "mdat" atom or "moov" atom (i.e. grep -m 1) within each MP4 file in the current directory. The output listing contains two lines for each file :
     37* the MP4 file name
     38* the first atom found (either "moov" or "mdat")
     39
     40When a MP4 file is enabled for Fast Start playback, the "moov" atom is printed within the second line. If not, it is the "mdat" atom.
    3741
    3842The drawback of this batch file is that it can take a while to run when scanning hundreds of MP4 files.