Changes between Version 1 and Version 2 of HowToCheckIfFaststartIsEnabledForPlayback


Ignore:
Timestamp:
Nov 3, 2021, 2:59:34 AM (5 years ago)
Author:
Pascal S
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToCheckIfFaststartIsEnabledForPlayback

    v1 v2  
    1 (page under construction)
     1= ''(page under construction)'' =
    22
    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 =
    44
    55Normally, a MP4 file has all the metadata about all packets stored at the end of the file,
     
    77an atom named "moov" is moved at the beginning of the MP4 file during the ffmpeg second pass.
    88
    9 This "faststart" allows to start playback of the movie earlier in some cases : the player does
     9This "faststart" allows to start the playback of the movie faster in some cases : the player does
    1010not need to read the full file before starting playback.
    1111
    1212Therefore, the position of the "moov" atom in an existing MP4 file (begining or end) helps to
    1313know if fast start is operative or not for this file.
     14
     15== Prerequisites ==
    1416
    1517This page is intended for Windows 10 users but can be used by Unix users with only small changes.
     
    1820an Internet site.
    1921
    20 The first approach is to fully scan the H.264/MP4 files for mdat and moov atoms.
     22== First approach
    2123
     24The first approach is to fully scan the H.264/MP4 files to look for mdat and moov atoms.
     25{{{
    2226@echo off
    2327for /F "delims=µ" %%i in ('dir /b /on *.mp4') do (
     
    2529ffmpeg -v trace -i "%%i" NUL 2>&1 | grep -m 1 -o -e "type:'mdat'" -e "type:'moov'"
    2630)
    27 
     31pause
     32exit
     33}}}
    2834This batch file searches only the first occurence of either mdat atom or moov atom. When a
    2935MP4 file is ready for fast start playback, the moov atom appears first. When not, the mdat
    3036atom appears first.
    3137
    32 The drawback of this batch file is that it can take a while when scanning hundreds of MP4 files.
     38The drawback of this batch file is that it can take a while to run when scanning hundreds of MP4 files.
     39
     40== Alternate method ==
    3341
    3442An alternate method is to truncate the MP4 files before scanning. If the moov atom is not in the
    3543first 4K bytes, the file is not fast start ready.
    36 
     44{{{
    3745@echo off
    3846echo 1>NUL 2>OUTPUT.txt
     
    4755pause
    4856exit
    49 
     57}}}
    5058The OUTPUT.txt file contains the list of MP4 files that are NOT fast start ready.