I´m using ffmpeg with flutter and I create a video from a lot of images. The problem: ffmpeg seems to not create a video with a right codec or something else.... please check my description below for concrete informations.
First the code parts:
Creating video from images
-r $settings_fps -i $tempPath/img%04d.jpg -vcodec libx264 -y -an -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -shortest $tempPath/$videoFileName.mp4
Adding audio to the created video
-i ${finalSong.path} -i $videoPath -c:a aac -shortest $tempPath/$newVideoFileName.mp4
This is my video output from console on creating this video:
flutter: ffmpeg version git-2020-01-25-fd11dd500 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk --prefix=/Users/taner/Projects/mobile-ffmpeg/prebuilt/ios-arm64-apple-darwin/ffmpeg --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/mobile-ffmpeg/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target aarch64-ios-darwin -march=armv8-a+crc+crypto -mcpu=generic -DMOBILE_FFMPEG_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20200125 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --enable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --enable-small --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --disable-sdl2 --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv
libavutil 56. 38.100 / 56. 38.100
libavcodec 58. 65.102 / 58. 65.102
libavformat 58. 35.101 / 58. 35.101
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 70.101 / 7. 70.101
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
Input #0, mp3, from '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/melodic_slow.mp3':
Metadata:
encoder : LAME 32bits version 3.99.5 (http://lame.sf.net)
TLEN : 134072
Duration: 00:02:14.11, start: 0.025057, bitrate: 320 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
Metadata:
encoder : LAME3.99r
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/Memories_163dfbf0-f4cf-11ea-86c6-cd08c5621e56.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.50, start: 0.000000, bitrate: 10069 kb/s
Stream #1:0(und): Video: h264 (avc1 / 0x31637661), yuvj422p(pc), 1920x1080 [SAR 1:1 DAR 16:9], 10065 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #1:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
sws_param option is deprecated and ignored
using SAR=1/1
using cpu capabilities: ARMv8 NEON
profile High 4:2:2, level 4.0, 4:2:2, 8-bit
264 - core 159 - 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=9 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=24 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 '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/Memories_191007b0-f4cf-11ea-9024-c9fcef51db39.mp4':
Metadata:
TLEN : 134072
encoder : Lavf58.35.101
Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.65.102 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.65.102 aac
frame= 47 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 61 fps= 49 q=28.0 size= 256kB time=00:00:00.23 bitrate=9033.3kbits/s speed=0.187x
frame= 73 fps= 42 q=28.0 size= 512kB time=00:00:00.71 bitrate=5827.4kbits/s speed=0.411x
frame= 84 fps= 21 q=-1.0 Lsize= 3418kB time=00:00:03.50 bitrate=7986.4kbits/s speed=0.856x
video:3359kB audio:55kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.117042%
frame I:1 Avg QP:22.78 size:170700
frame P:22 Avg QP:23.95 size: 83595
frame B:61 Avg QP:28.22 size: 23428
consecutive B-frames: 2.4% 2.4% 0.0% 95.2%
mb I I16..4: 1.8% 97.3% 0.9%
mb P I16..4: 0.4% 13.4% 1.0% P16..4: 39.0% 21.7% 14.2% 0.0% 0.0% skip:10.3%
mb B I16..4: 0.1% 2.4% 0.2% B16..8: 27.0% 6.3% 2.1% direct: 2.4% skip:59.5% L0:39.3% L1:47.8% BI:12.9%
8x8 transform intra:91.6% inter:83.1%
coded y,uvDC,uvAC intra: 88.4% 97.3% 40.9% inter: 21.1% 26.6% 1.7%
i16 v,h,dc,p: 18% 27% 7% 48%
i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 18% 16% 5% 8% 8% 9% 7% 9%
i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 16% 13% 7% 11% 10% 10% 7% 8%
i8c dc,h,v,p: 41% 19% 28% 12%
Weighted P-Frames: Y:0.0% UV:0.0%
ref P L0: 53.9% 22.4% 18.3% 5.4%
ref B L0: 86.7% 9.9% 3.4%
ref B L1: 96.1% 3.9%
kb/s:7860.37
Qavg: 149.884
flutter: ffmpeg version git-2020-01-25-fd11dd500
flutter: Copyright (c) 2000-2020 the FFmpeg developers
flutter:
flutter: built with Apple clang version 11.0.0 (clang-1100.0.33.17)
flutter: configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk --prefix=/Users/taner/Projects/mobile-ffmpeg/prebuilt/ios-arm64-apple-darwin/ffmpeg --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/mobile-ffmpeg/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target aarch64-ios-darwin -march=armv8-a+crc+crypto -mcpu=generic -DMOBILE_FFMPEG_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20200125 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --enable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --enable-small --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --disable-sdl2 --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv
flutter: libavutil 56. 38.100 / 56. 38.100
flutter: libavcodec 58. 65.102 / 58. 65.102
flutter: libavformat 58. 35.101 / 58. 35.101
flutter: libavdevice 58. 9.103 / 58. 9.103
flutter: libavfilter 7. 70.101 / 7. 70.101
flutter: libswscale 5. 6.100 / 5. 6.100
flutter: libswresample 3. 6.100 / 3. 6.100
flutter: Input #0, image2, from '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/img%04d.jpg':
flutter: Duration:
flutter: 00:00:03.40
flutter: , start:
flutter: 0.000000
flutter: , bitrate:
flutter: N/A
flutter:
flutter: Stream #0:0
flutter: : Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9]
flutter: ,
flutter: 25 fps,
flutter: 25 tbr,
flutter: 25 tbn,
flutter: 25 tbc
flutter:
flutter: Stream mapping:
flutter: Stream #0:0 -> #0:0
flutter: (mjpeg (native) -> h264 (libx264))
flutter:
flutter: Press [q] to stop, [?] for help
flutter: sws_param option is deprecated and ignored
flutter: using SAR=1/1
flutter: using cpu capabilities: ARMv8 NEON
flutter: profile High 4:2:2, level 4.0, 4:2:2, 8-bit
flutter: 264 - core 159 - 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=9 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=24 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
flutter: Output #0, mp4, to '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/Memories_f578a1c0-f4d0-11ea-9e60-5b43394b2511.mp4':
flutter: Metadata:
flutter: encoder :
flutter: Lavf58.35.101
flutter:
flutter: Stream #0:0
flutter: : Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1
flutter: ,
flutter: 24 fps,
flutter: 12288 tbn,
flutter: 24 tbc
flutter:
flutter: Metadata:
flutter: encoder :
flutter: Lavc58.65.102 libx264
flutter:
flutter: Side data:
flutter:
flutter: cpb:
flutter: bitrate max/min/avg: 0/0/0 buffer size: 0
flutter: vbv_delay: N/A
flutter:
flutter: frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed=N/A
flutter: frame= 47 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
flutter: frame= 60 fps= 53 q=28.0 size= 256kB time=00:00:00.16 bitrate=12579.1kbits/s speed=0.147x
flutter: frame= 72 fps= 43 q=28.0 size= 768kB time=00:00:00.66 bitrate=9436.6kbits/s speed=0.401x
flutter: frame= 84 fps= 38 q=28.0 size= 1280kB time=00:00:01.16 bitrate=8987.5kbits/s speed=0.527x
flutter: frame= 85 fps= 19 q=-1.0 Lsize= 4334kB time=00:00:03.41 bitrate=10391.1kbits/s speed=0.773x
flutter: video:4332kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
flutter: 0.043800%
flutter:
flutter: frame I:1 Avg QP:22.19 size:178746
flutter: frame P:21 Avg QP:23.69 size:106999
flutter: frame B:63 Avg QP:28.13 size: 31899
flutter: consecutive B-frames: 1.2% 0.0% 0.0% 98.8%
flutter: mb I I16..4: 2.4% 97.0% 0.6%
flutter: mb P I16..4: 0.7% 38.2% 0.8% P16..4: 22.6% 19.2% 15.1% 0.0% 0.0% skip: 3.3%
flutter: mb B I16..4: 0.2% 6.7% 0.2% B16..8: 24.6% 8.6% 3.0% direct: 4.2% skip:52.5% L0:47.8% L1:36.8% BI:15.4%
flutter: 8x8 transform intra:95.8% inter:86.8%
flutter: coded y,uvDC,uvAC intra: 89.3% 95.1% 22.5% inter: 26.3% 28.9% 3.0%
flutter: i16 v,h,dc,p: 20% 33% 22% 24%
flutter: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 24% 33% 3% 4% 3% 4% 4% 5%
flutter: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 20% 16% 6% 10% 7% 9% 6% 7%
flutter: i8c dc,h,v,p: 44% 22% 29% 5%
flutter: Weighted P-Frames: Y:0.0% UV:0.0%
flutter: ref P L0: 43.8% 18.2% 23.0% 15.0%
flutter: ref B L0: 69.6% 22.3% 8.1%
flutter: ref B L1: 86.1% 13.9%
flutter: kb/s:10018.70
flutter: Video erfolgreich erstellt
flutter: Ja. Video existiert im Pfad!
flutter: ffmpeg version git-2020-01-25-fd11dd500
flutter: Copyright (c) 2000-2020 the FFmpeg developers
flutter:
flutter: built with Apple clang version 11.0.0 (clang-1100.0.33.17)
flutter: configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk --prefix=/Users/taner/Projects/mobile-ffmpeg/prebuilt/ios-arm64-apple-darwin/ffmpeg --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/mobile-ffmpeg/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target aarch64-ios-darwin -march=armv8-a+crc+crypto -mcpu=generic -DMOBILE_FFMPEG_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20200125 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --enable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --enable-small --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --disable-sdl2 --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv
flutter: libavutil 56. 38.100 / 56. 38.100
flutter: libavcodec 58. 65.102 / 58. 65.102
flutter: libavformat 58. 35.101 / 58. 35.101
flutter: libavdevice 58. 9.103 / 58. 9.103
flutter: libavfilter 7. 70.101 / 7. 70.101
flutter: libswscale 5. 6.100 / 5. 6.100
flutter: libswresample 3. 6.100 / 3. 6.100
flutter: Input #0, mp3, from '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/melodic_slow.mp3':
flutter: Metadata:
flutter: encoder :
flutter: LAME 32bits version 3.99.5 (http://lame.sf.net)
flutter:
flutter: TLEN :
flutter: 134072
flutter:
flutter: Duration:
flutter: 00:02:14.11
flutter: , start:
flutter: 0.025057
flutter: , bitrate:
flutter: 320 kb/s
flutter:
flutter: Stream #0:0
flutter: : Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
flutter:
flutter: Metadata:
flutter: encoder :
flutter: LAME3.99r
flutter:
flutter: Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/Memories_f578a1c0-f4d0-11ea-9e60-5b43394b2511.mp4':
flutter: Metadata:
flutter: major_brand :
flutter: isom
flutter:
flutter: minor_version :
flutter: 512
flutter:
flutter: compatible_brands:
flutter: isomiso2avc1mp41
flutter:
flutter: encoder :
flutter: Lavf58.35.101
flutter:
flutter: Duration:
flutter: 00:00:03.54
flutter: , start:
flutter: 0.000000
flutter: , bitrate:
flutter: 10023 kb/s
flutter:
flutter: Stream #1:0
flutter: (und)
flutter: : Video: h264 (avc1 / 0x31637661), yuvj422p(pc), 1920x1080 [SAR 1:1 DAR 16:9], 10020 kb/s
flutter: ,
flutter: 24 fps,
flutter: 24 tbr,
flutter: 12288 tbn,
flutter: 48 tbc
flutter: (default)
flutter:
flutter: Metadata:
flutter: handler_name :
flutter: VideoHandler
flutter:
flutter: Stream mapping:
flutter: Stream #1:0 -> #0:0
flutter: (h264 (native) -> h264 (libx264))
flutter:
flutter: Stream #0:0 -> #0:1
flutter: (mp3 (mp3float) -> aac (native))
flutter:
flutter: Press [q] to stop, [?] for help
flutter: frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
flutter: sws_param option is deprecated and ignored
flutter: using SAR=1/1
flutter: using cpu capabilities: ARMv8 NEON
flutter: profile High 4:2:2, level 4.0, 4:2:2, 8-bit
flutter: 264 - core 159 - 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=9 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=24 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
flutter: Output #0, mp4, to '/var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/Memories_f81f09a0-f4d0-11ea-983d-0b683ab874e3.mp4':
flutter: Metadata:
flutter: TLEN :
flutter: 134072
flutter:
flutter: encoder :
flutter: Lavf58.35.101
flutter:
flutter: Stream #0:0
flutter: (und)
flutter: : Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1
flutter: ,
flutter: 24 fps,
flutter: 12288 tbn,
flutter: 24 tbc
flutter: (default)
flutter:
flutter: Metadata:
flutter: handler_name :
flutter: VideoHandler
flutter:
flutter: encoder :
flutter: Lavc58.65.102 libx264
flutter:
flutter: Side data:
flutter:
flutter: cpb:
flutter: bitrate max/min/avg: 0/0/0 buffer size: 0
flutter: vbv_delay: N/A
flutter:
flutter: Stream #0:1
flutter: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
flutter:
flutter: Metadata:
flutter: encoder :
flutter: Lavc58.65.102 aac
flutter:
flutter: frame= 47 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
flutter: frame= 61 fps= 57 q=28.0 size= 256kB time=00:00:00.23 bitrate=9033.3kbits/s speed=0.218x
flutter: frame= 74 fps= 46 q=28.0 size= 768kB time=00:00:00.78 bitrate=7969.6kbits/s speed=0.489x
flutter: frame= 85 fps= 22 q=-1.0 Lsize= 3440kB time=00:00:03.55 bitrate=7933.2kbits/s speed=0.902x
flutter: video:3380kB audio:56kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
flutter: 0.117084%
flutter:
flutter: frame I:1 Avg QP:22.68 size:174045
flutter: frame P:22 Avg QP:23.88 size: 84065
flutter: frame B:62 Avg QP:28.21 size: 23184
flutter: consecutive B-frames: 1.2% 4.7% 0.0% 94.1%
flutter: mb I I16..4: 2.0% 97.3% 0.7%
flutter: mb P I16..4: 0.4% 13.4% 0.9% P16..4: 39.3% 21.6% 14.6% 0.0% 0.0% skip: 9.7%
flutter: mb B I16..4: 0.1% 2.4% 0.2% B16..8: 26.7% 6.3% 2.0% direct: 2.5% skip:59.8% L0:41.1% L1:45.7% BI:13.1%
flutter: 8x8 transform intra:91.8% inter:83.1%
flutter: coded y,uvDC,uvAC intra: 88.3% 97.2% 41.4% inter: 21.0% 26.5% 1.7%
flutter: i16 v,h,dc,p: 18% 25% 5% 52%
flutter: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 19% 16% 5% 8% 8% 9% 7% 9%
flutter: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 16% 13% 7% 12% 9% 10% 7% 8%
flutter: i8c dc,h,v,p: 41% 19% 28% 12%
flutter: Weighted P-Frames: Y:0.0% UV:0.0%
flutter: ref P L0: 53.4% 22.2% 18.9% 5.5%
flutter: ref B L0: 86.6% 10.3% 3.2%
flutter: ref B L1: 95.8% 4.2%
flutter: kb/s:7817.54
flutter: Qavg: 149.529
flutter: Speichern mit GallerySaver: /var/mobile/Containers/Data/Application/AEEF7BB8-36F3-4ECD-824B-B294E9DF7294/Library/Caches/Memories_f81f09a0-f4d0-11ea-983d-0b683ab874e3.mp4
flutter: Speichern mit GallerySaver nicht erfolgreich
In general the created video works, but: If i try to save it as video with flutter gallery_saver to the device, this video will not saved. Other videos for example works well. But not the created with ffmpeg.
Can you find any reason for this in the ffmpeg output log? Thank you!
Videos for web playback usually require chroma sampling to be 4:2:0. FFmpeg, by default, will try to preserve the source sampling scheme, so your output is 4:2:2 (see yuvj422p in the output stream).
Use for step 1,
-r $settings_fps -i $tempPath/img%04d.jpg -vcodec libx264 -y -an -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p $tempPath/$videoFileName.mp4
And in step 2, avoid re-encoding video
-i ${finalSong.path} -i $videoPath -c:v copy -c:a aac -shortest $tempPath/$newVideoFileName.mp4
I have a huge 1.1 GB File. It contains only 1 line and 1167889705 characters. I want to replace all the occurences of "LFENT" by "\nLFENT".
I am using
perl 5, version 18, subversion 1 (v5.18.1) built for x86_64-linux –
Perl Script
perl -ne 's/LFENT/\nLFENT/g; print;' queries.txt
Sample
22 serialization::archive 10 0 0 0 0 134477 0 0 0 9 LFENT_1_1 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 12 barack obama 0 0 1 0 12 barack obama 0 0 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9 LFENT_1_2 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 5 obama 2 0 12 barack obama 5 obama 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9 LFENT_1_3 6 LFDOC1 20 documents/LFDOC1.xml 4 MISC 8 american 1 0 8 american 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236
Problem
The script will work on the sample that I posted. But when I try it on the whole line I get the following error:
Substitution loop at -e line 1, <> line 1.
It is simplest to use LFENT as the record separator. That reduces the blocks to a more manageable size and ensures that there is no more than one LFENT to be replaced in each block
Command-line perl allows for setting the record separator with the -0 modifier, but the value of the parameter must be the code point in octal of a single character, and you can't specify a string. So here you have to set it once in a BEGIN block
Like this
perl -p -e'BEGIN{$/="LFENT"} s/LFENT/\nLFENT/'
output
22 serialization::archive 10 0 0 0 0 134477 0 0 0 9
LFENT_1_1 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 12 barack obama 0 0 1 0 12 barack obama 0 0 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9
LFENT_1_2 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 5 obama 2 0 12 barack obama 5 obama 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9
LFENT_1_3 6 LFDOC1 20 documents/LFDOC1.xml 4 MISC 8 american 1 0 8 american 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236[Finished in 0.2s]
By the way, it is unlikely to cause a problem but LFENT is always preceded by a space character in your example data. You may want to remove it by using s/\s*LFENT/\nLFENT for your substitution
And a look-ahead might be more appropriate too s/\s*(?=LFENT)/\n/ so that you don't have to remove and replace the unchanged part of the match
Try updating your perl to a more current version.
This was a known bug for a long time (fixed in v5.22.0): perl #123071: substitution loop issue with long strings
You can do so with the following commands (assuming you are on linux):
wget http://www.cpan.org/src/5.0/perl-5.22.1.tar.gz
tar -xzf perl-5.22.1.tar.gz
cd perl-5.22.1
./Configure -des -Dprefix=$HOME/localperl
make
make test
make install
Then test it by running $HOME/localperl/bin/perl -v and add it to your PATH using this: export PATH=$HOME/localperl/bin/:$PATH.