Changes between Version 2 and Version 3 of HowToCheckIfFaststartIsEnabledForPlayback
- Timestamp:
- Nov 3, 2021, 5:43:44 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HowToCheckIfFaststartIsEnabledForPlayback
v2 v3 1 1 = ''(page under construction)'' = 2 2 3 = How to know if a H.264/MP4 file is ready for fast startplayback =3 = How to check if Fast Start is enabled for playback = 4 4 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 == 8 6 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. 7 This '''How to''' applies to '''H.264/MP4''' files only but will probably work with '''H.264/MOV''' files too. 11 8 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. 9 Streaming web sites recommend to upload videos with Fast Start enabled. It allows video playback to begin before the file has been completely downloaded. 10 11 Why ? 12 13 Normally, 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 15 Therefore, 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 17 Another 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. 14 18 15 19 == Prerequisites == 16 20 17 This page is intended for Windows 10 users but can be used by Unix users with only small changes.21 This page is intended for Windows 10 users but can be adapted by Unix users with only small changes. 18 22 19 Prior to using the next *.BAT files, Windows users should download grep.exe and head.exe from 20 an Internet site. 23 Prior to using the next batch files, Windows users should download '''grep.exe''' and '''head.exe''' from an Internet site. 21 24 22 25 == First approach 23 26 24 The first approach is to fully scan the H.264/MP4 files to look for mdat and moov atoms.27 The 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. 25 28 {{{ 26 29 @echo off … … 30 33 ) 31 34 pause 32 exit33 35 }}} 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. 36 This 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 40 When 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. 37 41 38 42 The drawback of this batch file is that it can take a while to run when scanning hundreds of MP4 files.
