Changes between Version 1 and Version 2 of HowToCheckIfFaststartIsEnabledForPlayback
- Timestamp:
- Nov 3, 2021, 2:59:34 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HowToCheckIfFaststartIsEnabledForPlayback
v1 v2 1 (page under construction) 1 = ''(page under construction)'' = 2 2 3 How to know if a H.264/MP4 file is ready for fast start playback 3 = How to know if a H.264/MP4 file is ready for fast start playback = 4 4 5 5 Normally, a MP4 file has all the metadata about all packets stored at the end of the file, … … 7 7 an atom named "moov" is moved at the beginning of the MP4 file during the ffmpeg second pass. 8 8 9 This "faststart" allows to start playback of the movie earlier in some cases : the player does9 This "faststart" allows to start the playback of the movie faster in some cases : the player does 10 10 not need to read the full file before starting playback. 11 11 12 12 Therefore, the position of the "moov" atom in an existing MP4 file (begining or end) helps to 13 13 know if fast start is operative or not for this file. 14 15 == Prerequisites == 14 16 15 17 This page is intended for Windows 10 users but can be used by Unix users with only small changes. … … 18 20 an Internet site. 19 21 20 The first approach is to fully scan the H.264/MP4 files for mdat and moov atoms. 22 == First approach 21 23 24 The first approach is to fully scan the H.264/MP4 files to look for mdat and moov atoms. 25 {{{ 22 26 @echo off 23 27 for /F "delims=µ" %%i in ('dir /b /on *.mp4') do ( … … 25 29 ffmpeg -v trace -i "%%i" NUL 2>&1 | grep -m 1 -o -e "type:'mdat'" -e "type:'moov'" 26 30 ) 27 31 pause 32 exit 33 }}} 28 34 This batch file searches only the first occurence of either mdat atom or moov atom. When a 29 35 MP4 file is ready for fast start playback, the moov atom appears first. When not, the mdat 30 36 atom appears first. 31 37 32 The drawback of this batch file is that it can take a while when scanning hundreds of MP4 files. 38 The drawback of this batch file is that it can take a while to run when scanning hundreds of MP4 files. 39 40 == Alternate method == 33 41 34 42 An alternate method is to truncate the MP4 files before scanning. If the moov atom is not in the 35 43 first 4K bytes, the file is not fast start ready. 36 44 {{{ 37 45 @echo off 38 46 echo 1>NUL 2>OUTPUT.txt … … 47 55 pause 48 56 exit 49 57 }}} 50 58 The OUTPUT.txt file contains the list of MP4 files that are NOT fast start ready.
