-movflags +faststart has no effect
Hi, from option -movflags +faststart I expect, that I can start playing the video, even the encoding process has not finished yet. But this does not work,why? If I encode a video without -movflags +faststart and kill the process with Ctrl-C after a while the video surprisingly is playable. So there seems it doesn't matter if I use it or not. Also I'm wondering where to find this option in the ffmpeg documentation, I only find it in the wiki. Here the output: $ ffmpeg -i 20200205_161649.mp4 -vf scale=w=iw/2:h=ih/2 -movflags +faststart 20200205_161649_2_f.mp4 ffmpeg version 4.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20200205_161649.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.29.100 Duration: 00:04:08.84, start: 0.000000, bitrate: 17268 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17004 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30 tbr, 90k tbn, 180k tbc (default) Metadata: handler_name : VideoHandle Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default) Metadata: handler_name : SoundHandle Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help [libx264 @ 0x624bd00] using SAR=1/1 [libx264 @ 0x624bd00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64 [libx264 @ 0x624bd00] profile Progressive High, level 3.1, 4:2:0, 8-bit [libx264 @ 0x624bd00] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to '20200205_161649_2_f.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.29.100 Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default) Metadata: handler_name : VideoHandle encoder : Lavc58.54.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandle encoder : Lavc58.54.100 aac frame= 6 fps=0.0 q=0.0 size= 0kB time=00:00:00.21 bitrate= 1.8kbits/sframe= 18 fps= 17 q=0.0 size= 0kB time=00:00:00.61 bitrate= 0.6kbits/sframe= 27 fps= 17 q=0.0 size= 0kB time=00:00:00.91 bitrate= 0.4kbits/sframe= 37 fps= 18 q=0.0 size= 0kB time=00:00:01.23 bitrate= 0.3kbits/sframe= 46 fps= 18 q=0.0 size= 0kB time=00:00:01.51 bitrate= 0.3kbits/sframe= 48 fps= 15 q=29.0 size= 0kB time=00:00:01.60 bitrate= 0.2kbits/frame= 51 fps= 13 q=29.0 size= 0kB time=00:00:01.70 bitrate= 0.2kbits/frame= 54 fps= 12 q=29.0 size= 0kB time=00:00:01.81 bitrate= 0.2kbits/frame= 58 fps= 12 q=29.0 size= 0kB time=00:00:01.94 bitrate= 0.2kbits/frame= 62 fps= 11 q=29.0 size= 0kB time=00:00:02.06 bitrate= 0.2kbits/frame= 65 fps= 10 q=29.0 size= 0kB time=00:00:02.17 bitrate= 0.2kbits/frame= 69 fps=9.8 q=29.0 size= 0kB time=00:00:02.30 bitrate= 0.2kbits/frame= 73 fps=9.4 q=29.0 size= 256kB time=00:00:02.43 bitrate= 862.5kbits/frame= 77 fps=9.0 q=29.0 size= 256kB time=00:00:02.58 bitrate= 812.6kbits/frame= 81 fps=8.7 q=29.0 size= 256kB time=00:00:02.70 bitrate= 774.2kbits/frame= 85 fps=8.5 q=29.0 size= 256kB time=00:00:02.83 bitrate= 739.3kbits/ -Ulf -- Von meinem Seibert gesendet
On 25-02-2020 07:47 pm, Ulf Zibis wrote:
Hi,
from option -movflags +faststart I expect, that I can start playing the video, even the encoding process has not finished yet. But this does not work,why?
It's not expected to. faststart is to allow playback during progressive downloaded of a complete and valid MP4 file. See docs at http://ffmpeg.org/ffmpeg-formats.html#Options-8
If I encode a video without -movflags +faststart and kill the process with Ctrl-C after a while the video surprisingly is playable.
When ffmpeg is sent SIGINT, ffmpeg will attempt to close outputs gracefully. For regular MP4 output, this includes flushing the moov atom to file. That makes the file playable. Gyan
Am 25.02.2020 um 15:17 schrieb Ulf Zibis <Ulf.Zibis@gmx.de>:
Also I'm wondering where to find this option in the ffmpeg documentation
http://ffmpeg.org/ffmpeg-formats.html#Options-8 For future questions please remember that only current FFmpeg git head is supported here. Carl Eugen
Am 25.02.20 um 16:05 schrieb Carl Eugen Hoyos:
Am 25.02.2020 um 15:17 schrieb Ulf Zibis <Ulf.Zibis@gmx.de>:
Also I'm wondering where to find this option in the ffmpeg documentation http://ffmpeg.org/ffmpeg-formats.html#Options-8
Much thanks! When reading the mov mp4 ismv section I have some question: 1. Are there differences between these 3 formats? 2. When only using output.mp4, the video is NOT fragmented, right? 3. Does -movflags +fastrstart revert the fragmentation, i.e. move all metadata to the start? 4. What is the difference of using -movflags -ismv - or -f mov/mp4/ismv? 5. Why is -movflags -ismv missing in the options list (it's only in the examples below). 6. What is the difference between -faststart and +faststart
For future questions please remember that only current FFmpeg git head is supported here.
When is version 4.3 (or 4.2.3) expected to be released? I prefer to wait for this. -Ulf
When reading the mov mp4 ismv section I have some question: 1. Are there differences between these 3 formats? 2. When only using output.mp4, the video is NOT fragmented, right? 3. Does -movflags +fastrstart revert the fragmentation, i.e. move all metadata to the start? 4. What is the difference of using -movflags -ismv - or -f mov/mp4/ismv? 5. Why is -movflags -ismv missing in the options list (it's only in the examples below). 6. What is the difference between -faststart and +faststart
Hi, 1. To start I think the most obvious is the brand names in the ftyp atom. These indicate the different standards/specifications that each format follows. I think mov is either QuickTime or ISO MBFF (MPEG-4 part 12), mp4 is MP4 as in MPEG-4 part 14, and ismv I’m not entirely sure except that it writes fragments by default, but based on the name I’d guess it follows the specs from Microsoft primarily implemented in IIS silverlight. 2. Not by default, right. 3. I don’t think faststart does anything that complicated, in fragmented files I think the sidx is moved up instead of the moov atom, or maybe both. 4. Do you mean the isml flag? It’s for windows server streaming it looks like. 5. See 4 6. + sets the flag, - clears it. Regards, Ted Park
participants (4)
-
Carl Eugen Hoyos -
Gyan Doshi -
Ted Park -
Ulf Zibis