Opened 7 years ago
Last modified 7 years ago
#5763 new defect
copy via HTTP with no transcode very slow for MOV vs. MP4
Reported by: | Daniel Heidebrecht | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | mov |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug: Copying a section from an MOV file with no transcoding via HTTP is very slow compared to the same operation on an MP4 file. In the example below - MOV elapsed time is 11 minutes, MP4 elapsed time is ~ 8 seconds.
How to reproduce: The original test file is an 85Mb MOV file, the MP4 comparison file was created by converting the MOV file to MP4:
ffmpeg -i test.mov -c copy test-copy.mp4
The MOV and MP4 files are both publicly available on S3:
https://s3.amazonaws.com/unclipvideo-test/test.mov
https://s3.amazonaws.com/unclipvideo-test/test-copy.mp4
MOV and MP4 example test output:
MOV test
time ./ffmpeg -ss 5 -i https://s3.amazonaws.com/unclipvideo-test/test.mov -t 15 -c copy test-s3.mov ffmpeg version N-81504-g1fb8f6b-tessus Copyright (c) 2000-2016 the FFmpeg developers built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 51.100 / 57. 51.100 libavformat 57. 46.100 / 57. 46.100 libavdevice 57. 0.102 / 57. 0.102 libavfilter 6. 49.100 / 6. 49.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://s3.amazonaws.com/unclipvideo-test/test.mov': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2016-07-31 22:04:54 com.apple.quicktime.location.ISO6709: +41.3207-071.9074-000.385/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s com.apple.quicktime.software: 9.3.3 com.apple.quicktime.creationdate: 2016-07-31T18:04:54-0400 Duration: 00:00:40.80, start: 0.000000, bitrate: 17134 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17042 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc (default) Metadata: creation_time : 2016-07-31 22:04:54 handler_name : Core Media Data Handler encoder : H.264 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 82 kb/s (default) Metadata: creation_time : 2016-07-31 22:04:54 handler_name : Core Media Data Handler Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default) Metadata: creation_time : 2016-07-31 22:04:54 handler_name : Core Media Data Handler Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default) Metadata: creation_time : 2016-07-31 22:04:54 handler_name : Core Media Data Handler [mov @ 0x7fe6f3002e00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Last message repeated 1 times Output #0, mov, to 'test-s3.mov': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt com.apple.quicktime.creationdate: 2016-07-31T18:04:54-0400 com.apple.quicktime.location.ISO6709: +41.3207-071.9074-000.385/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s com.apple.quicktime.software: 9.3.3 encoder : Lavf57.46.100 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, q=2-31, 17042 kb/s, 29.98 fps, 29.97 tbr, 19200 tbn, 600 tbc (default) Metadata: creation_time : 2016-07-31 22:04:54 handler_name : Core Media Data Handler encoder : H.264 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, 82 kb/s (default) Metadata: creation_time : 2016-07-31 22:04:54 handler_name : Core Media Data Handler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 480 fps=0.7 q=-1.0 Lsize= 33291kB time=00:00:15.01 bitrate=18162.3kbits/s speed=0.0227x video:33113kB audio:163kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.044288% real 11m5.040s user 0m3.638s sys 0m1.768s
MP4 test:
time ./ffmpeg -ss 5 -i https://s3.amazonaws.com/unclipvideo-test/test-copy.mp4 -t 15 -c copy test-s3.mp4 ffmpeg version N-81504-g1fb8f6b-tessus Copyright (c) 2000-2016 the FFmpeg developers built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 51.100 / 57. 51.100 libavformat 57. 46.100 / 57. 46.100 libavdevice 57. 0.102 / 57. 0.102 libavfilter 6. 49.100 / 6. 49.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://s3.amazonaws.com/unclipvideo-test/test-copy.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.25.100 Duration: 00:00:40.87, start: 0.000000, bitrate: 17102 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17042 kb/s, 29.98 fps, 29.97 tbr, 19200 tbn, 38400 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 82 kb/s (default) Metadata: handler_name : SoundHandler [mp4 @ 0x7fcc5901ac00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Last message repeated 1 times Output #0, mp4, to 'test-s3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.46.100 Stream #0:0(und): Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(tv, bt709), 1920x1080, q=2-31, 17042 kb/s, 29.98 fps, 29.97 tbr, 19200 tbn, 19200 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, 82 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 480 fps=104 q=-1.0 Lsize= 33291kB time=00:00:15.01 bitrate=18162.2kbits/s speed=3.25x video:33113kB audio:163kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.044021% real 0m7.502s user 0m0.290s sys 0m0.203s
ffmpeg version:
ffmpeg version N-81504-g1fb8f6b-tessus Copyright (c) 2000-2016 the FFmpeg developers built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Change History (3)
comment:1 by , 7 years ago
Version: | unspecified → git-master |
---|
comment:2 by , 7 years ago
Component: | ffmpeg → avformat |
---|---|
Keywords: | mov added |
The fact that FFmpeg seeks wildly in the original mov file (but not in a file remuxed with FFmpeg) leading to many slow reconnections is reproducible with the following command line:
I don't know if there is a bug that can be fixed in FFmpeg.