[FFmpeg-user] Tricks for fragmented mp4
Gabriele Greco
gabrielegreco at gmail.com
Mon Mar 2 16:37:58 EET 2020
Hi guys,
there is a way to probe a fragmented mp4 available through FTP faster? The
operation is almost instant on a local file, while it takes almost 1 minute
with a very good internet connection.
This test file is a 3 hours video file made with ffmpeg in fragmented mode,
every fragment is 1 min length, so there are 180 fragments.
ffprobe reads every fragment doing a range http request, using the grep and
wc I saw that there are 183 http requests in total.
Reducing the number of fragments is not an option since sadly the file
should be playable almost realtime with a moderate delay (and 1 min is
already enough)
the version of ffprobe is HEAD, here is the complete console output, the
test file should be public to everyone:
time ../ffmpeg-head/ffprobe
http://wycutters.wyscout.com/box/argentina/velez_test_g1234567.mp4
ffprobe version N-96711-gdd81f73946 Copyright (c) 2007-2020 the FFmpeg
developers
built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
configuration: --disable-videotoolbox --disable-audiotoolbox
--enable-libx264 --enable-libfdk-aac --enable-nonfree --enable-gpl
libavutil 56. 39.100 / 56. 39.100
libavcodec 58. 68.100 / 58. 68.100
libavformat 58. 38.100 / 58. 38.100
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 75.100 / 7. 75.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '
http://wycutters.wyscout.com/box/argentina/velez_test_g1234567.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1iso6mp41
artist : 171
encoder : Lavf58.20.100
genre : fast
Duration: 03:00:00.03, start: 0.000000, bitrate: 6265 kb/s
Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661),
yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 6132 kb/s, 24.97 fps,
59.94 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandler
real 1m2.094s
user 0m0.206s
sys 0m0.169s
Trace of the content-range calls:
ffprobe -v trace
http://wycutters.wyscout.com/box/argentina/velez_test_g1234567.mp4 2>&1 |
grep Content-Range
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
0-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
46834645-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
93336173-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
140460071-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
187703091-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
234834646-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
281564338-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
328890982-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
375821706-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
422895067-8458597672/8458597673'
[... total of 183 calls, included the one I've not cut ... ]
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
8458590761-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
40154-8458597672/8458597673'
[http @ 0x55a4d8addaa0] header='Content-Range: bytes
45874897-8458597672/8458597673'
--
Bye,
Gabry
More information about the ffmpeg-user
mailing list