
Recherche avancée
Autres articles (3)
-
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...)
Sur d’autres sites (1852)
-
avformat/hls : Be more picky on extensions
16 janvier, par Michael Niedermayeravformat/hls : Be more picky on extensions
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
mpegts is treated independent of the extensionIt is recommended to set the whitelists correctly
instead of depending on extensions, but this should help a bit,
and this is easier to backportFixes : CVE-2023-6602 II. HLS Force TTY Demuxer
Fixes : CVE-2023-6602 IV. HLS XBIN Demuxer DoS AmplificationThe other parts of CVE-2023-6602 have been fixed by prior commits
Found-by : Harvey Phillips of Amazon Element55 (element55)
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
Ffmpeg - Reading header information takes too long
13 mars 2023, par Md YeaminI am using ffmpeg-kit to encode videos on android devices. For some files ffmpeg takes too long to read the header information. This issue happens very randomly. Sometime the execution completes within 1 or 2 seconds, sometime it takes longer than 10 seconds to complete, for the file linked below.


I have build ffmpeg to log some additional info to figure out the root cause. There is a 10s gap between the log output at
15:17:02.276
and15:17:12.909
(added a separator for quick find). After completion of themov_read_ftyp
there is a long delay before themov_read_dref
method starts the execution. Is there any other method that executed in between and could take this much long time to complete the execution ? What could be the reason behind the delay ?

Here is detailed log about the issue.


Log :


2023-03-12 15:17:02.096 :: ffmpeg-kit-debug: execute:
2023-03-12 15:17:02.116 :: ffmpeg-kit-debug: LogCallback: setjmp
2023-03-12 15:17:02.120 :: ffmpeg-kit-debug: LogCallback: setjmp done
2023-03-12 15:17:02.124 :: ffmpeg-kit-debug: LogCallback: ffmpeg_var_cleanup
2023-03-12 15:17:02.127 :: ffmpeg-kit-debug: LogCallback: ffmpeg_var_cleanup done
2023-03-12 15:17:02.132 :: ffmpeg-kit-debug: LogCallback: init_dynload
2023-03-12 15:17:02.135 :: ffmpeg-kit-debug: LogCallback: init_dynload done
2023-03-12 15:17:02.137 :: ffmpeg-kit-debug: LogCallback: register_exit
2023-03-12 15:17:02.141 :: ffmpeg-kit-debug: LogCallback: register_exit done
2023-03-12 15:17:02.144 :: ffmpeg-kit-debug: LogCallback: avdevice_register_all
2023-03-12 15:17:02.151 :: ffmpeg-kit-debug: LogCallback: avdevice_register_all done
2023-03-12 15:17:02.155 :: ffmpeg-kit-debug: LogCallback: avformat_network_init
2023-03-12 15:17:02.159 :: ffmpeg-kit-debug: LogCallback: avformat_network_init done
2023-03-12 15:17:02.163 :: ffmpeg-kit-debug: LogCallback: show_banner
2023-03-12 15:17:02.165 :: ffmpeg-kit-debug: LogCallback: show_banner done
2023-03-12 15:17:02.169 :: ffmpeg-kit-debug: LogCallback: ffmpeg_parse_options
2023-03-12 15:17:02.172 :: ffmpeg-kit-debug: LogCallback: allocating memory
2023-03-12 15:17:02.176 :: ffmpeg-kit-debug: LogCallback: split_commandline
2023-03-12 15:17:02.179 :: ffmpeg-kit-debug: LogCallback: Splitting the commandline.

2023-03-12 15:17:02.182 :: ffmpeg-kit-debug: LogCallback: Reading option '-hide_banner' ...
2023-03-12 15:17:02.184 :: ffmpeg-kit-debug: LogCallback: matched as option 'hide_banner' (do not show program banner) with argument '1'.

2023-03-12 15:17:02.187 :: ffmpeg-kit-debug: LogCallback: Reading option '-y' ...
2023-03-12 15:17:02.189 :: ffmpeg-kit-debug: LogCallback: matched as option 'y' (overwrite output files) with argument '1'.

2023-03-12 15:17:02.193 :: ffmpeg-kit-debug: LogCallback: Reading option '-i' ...
2023-03-12 15:17:02.197 :: ffmpeg-kit-debug: LogCallback: matched as input url with argument 'saf:6.MP4'.

2023-03-12 15:17:02.199 :: ffmpeg-kit-debug: LogCallback: Finished splitting the commandline.

2023-03-12 15:17:02.202 :: ffmpeg-kit-debug: LogCallback: split_commandline done
2023-03-12 15:17:02.203 :: ffmpeg-kit-debug: LogCallback: parse_optgroup
2023-03-12 15:17:02.205 :: ffmpeg-kit-debug: LogCallback: Parsing a group of options: global .

2023-03-12 15:17:02.207 :: ffmpeg-kit-debug: LogCallback: Applying option hide_banner (do not show program banner) with argument 1.

2023-03-12 15:17:02.210 :: ffmpeg-kit-debug: LogCallback: Applying option y (overwrite output files) with argument 1.

2023-03-12 15:17:02.212 :: ffmpeg-kit-debug: LogCallback: Successfully parsed a group of options.

2023-03-12 15:17:02.217 :: ffmpeg-kit-debug: LogCallback: parse_optgroup done
2023-03-12 15:17:02.220 :: ffmpeg-kit-debug: LogCallback: term_init
2023-03-12 15:17:02.224 :: ffmpeg-kit-debug: LogCallback: term_init done
2023-03-12 15:17:02.226 :: ffmpeg-kit-debug: LogCallback: open_files INPUT
2023-03-12 15:17:02.228 :: ffmpeg-kit-debug: LogCallback: Parsing a group of options: input url saf:6.MP4.

2023-03-12 15:17:02.232 :: ffmpeg-kit-debug: LogCallback: Successfully parsed a group of options.

2023-03-12 15:17:02.236 :: ffmpeg-kit-debug: LogCallback: Opening an input file: saf:6.MP4.

2023-03-12 15:17:02.239 :: ffmpeg-kit-debug: LogCallback: [NULL @ 0xb40000730dd9dbf0] Opening 'saf:6.MP4' for reading

2023-03-12 15:17:02.243 :: ffmpeg-kit-debug: LogCallback: [saf @ 0xb40000728de0ca10] Setting default whitelist 'saf,crypto,data'

2023-03-12 15:17:02.245 :: ffmpeg-kit-debug: LogCallback: fd_open start
2023-03-12 15:17:02.248 :: ffmpeg-kit-debug: LogCallback: fd_open opening
2023-03-12 15:17:02.252 :: ffmpeg-kit-debug: LogCallback: fd_open opened
2023-03-12 15:17:02.255 :: ffmpeg-kit-debug: LogCallback: mov_probe
2023-03-12 15:17:02.257 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100

2023-03-12 15:17:02.260 :: ffmpeg-kit-debug: LogCallback: mov_read_header
2023-03-12 15:17:02.264 :: ffmpeg-kit-debug: LogCallback: mov_read_header seeking
2023-03-12 15:17:02.268 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] ISO: File Type Major Brand: mp41

2023-03-12 15:17:02.270 :: ffmpeg-kit-debug: LogCallback: mov_read_ftyp dict set
2023-03-12 15:17:02.273 :: ffmpeg-kit-debug: LogCallback: mov_read_ftyp mov_aaxc_crypto before
2023-03-12 15:17:02.276 :: ffmpeg-kit-debug: LogCallback: mov_read_ftyp mov_aaxc_crypto done
-----------------------------------------------------------------------------------------------
2023-03-12 15:17:12.909 :: ffmpeg-kit-debug: LogCallback: mov_read_dref started
2023-03-12 15:17:12.911 :: ffmpeg-kit-debug: LogCallback: mov_read_dref check entries
2023-03-12 15:17:12.915 :: ffmpeg-kit-debug: LogCallback: mov_read_dref drefs_count 0 
2023-03-12 15:17:12.918 :: ffmpeg-kit-debug: LogCallback: mov_read_dref av_free sc->drefs
2023-03-12 15:17:12.920 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Unknown dref type 0x73696c61 size 12

2023-03-12 15:17:12.923 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Processing st: 0, edit list 0 - media time: 0, duration: 39436397

2023-03-12 15:17:12.925 :: ffmpeg-kit-debug: LogCallback: mov_read_dref started
2023-03-12 15:17:12.931 :: ffmpeg-kit-debug: LogCallback: mov_read_dref check entries
2023-03-12 15:17:12.935 :: ffmpeg-kit-debug: LogCallback: mov_read_dref drefs_count 0 
2023-03-12 15:17:12.938 :: ffmpeg-kit-debug: LogCallback: mov_read_dref av_free sc->drefs
2023-03-12 15:17:12.945 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Unknown dref type 0x73696c61 size 12

2023-03-12 15:17:12.951 :: ffmpeg-kit-debug: LogCallback: mov_read_dref started
2023-03-12 15:17:12.958 :: ffmpeg-kit-debug: LogCallback: mov_read_dref check entries
2023-03-12 15:17:12.965 :: ffmpeg-kit-debug: LogCallback: mov_read_dref drefs_count 0 
2023-03-12 15:17:12.971 :: ffmpeg-kit-debug: LogCallback: mov_read_dref av_free sc->drefs
2023-03-12 15:17:12.975 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Unknown dref type 0x73696c61 size 12

2023-03-12 15:17:12.978 :: ffmpeg-kit-debug: LogCallback: mov_read_dref started
2023-03-12 15:17:12.985 :: ffmpeg-kit-debug: LogCallback: mov_read_dref check entries
2023-03-12 15:17:12.988 :: ffmpeg-kit-debug: LogCallback: mov_read_dref drefs_count 0 
2023-03-12 15:17:12.990 :: ffmpeg-kit-debug: LogCallback: mov_read_dref av_free sc->drefs
2023-03-12 15:17:12.992 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Unknown dref type 0x73696c61 size 12

2023-03-12 15:17:12.994 :: ffmpeg-kit-debug: LogCallback: mov_read_dref started
2023-03-12 15:17:12.996 :: ffmpeg-kit-debug: LogCallback: mov_read_dref check entries
2023-03-12 15:17:12.997 :: ffmpeg-kit-debug: LogCallback: mov_read_dref drefs_count 0 
2023-03-12 15:17:12.999 :: ffmpeg-kit-debug: LogCallback: mov_read_dref av_free sc->drefs
2023-03-12 15:17:13.002 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Unknown dref type 0x73696c61 size 12

2023-03-12 15:17:13.003 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] All samples in data stream index:id [4:5] have zero duration, stream set to be discarded by default. Override using AVStream->discard or -discard for ffmpeg command.

2023-03-12 15:17:13.006 :: ffmpeg-kit-debug: LogCallback: mov_read_header seek done
2023-03-12 15:17:13.008 :: ffmpeg-kit-debug: LogCallback: mov_read_header parse done
2023-03-12 15:17:13.010 :: ffmpeg-kit-debug: LogCallback: mov_read_header trex data read done
2023-03-12 15:17:13.011 :: ffmpeg-kit-debug: LogCallback: mov_read_header bitrate calculation code
2023-03-12 15:17:13.013 :: ffmpeg-kit-debug: LogCallback: mov_read_header fps calculation done
2023-03-12 15:17:13.015 :: ffmpeg-kit-debug: LogCallback: mov_read_header read side data done
2023-03-12 15:17:13.017 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] Before avformat_find_stream_info() pos: 3720541874 bytes read:3720541874 seeks:0 nb_streams:5

2023-03-12 15:17:13.019 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] nal_unit_type: 7(SPS), nal_ref_idc: 1

2023-03-12 15:17:13.022 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] nal_unit_type: 8(PPS), nal_ref_idc: 1

2023-03-12 15:17:13.024 :: ffmpeg-kit-debug: LogCallback: fd_seek start
2023-03-12 15:17:13.028 :: ffmpeg-kit-debug: LogCallback: fd_seek seeking
2023-03-12 15:17:13.030 :: ffmpeg-kit-debug: LogCallback: fd_seek seek done
2023-03-12 15:17:13.033 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] nal_unit_type: 7(SPS), nal_ref_idc: 1

2023-03-12 15:17:13.035 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] nal_unit_type: 8(PPS), nal_ref_idc: 1

2023-03-12 15:17:13.038 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] nal_unit_type: 9(AUD), nal_ref_idc: 0

2023-03-12 15:17:13.042 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] nal_unit_type: 5(IDR), nal_ref_idc: 1

2023-03-12 15:17:13.047 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] Format yuvj420p chosen by get_format().

2023-03-12 15:17:13.059 :: ffmpeg-kit-debug: LogCallback: [h264 @ 0xb40000731df00bc0] Reinit context to 1920x1088, pix_fmt: yuvj420p

2023-03-12 15:17:13.066 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] All info found

2023-03-12 15:17:13.071 :: ffmpeg-kit-debug: LogCallback: fd_seek start
2023-03-12 15:17:13.075 :: ffmpeg-kit-debug: LogCallback: fd_seek size check error
2023-03-12 15:17:13.077 :: ffmpeg-kit-debug: LogCallback: fd_seek start
2023-03-12 15:17:13.081 :: ffmpeg-kit-debug: LogCallback: fd_seek size check error
2023-03-12 15:17:13.087 :: ffmpeg-kit-debug: LogCallback: fd_seek start
2023-03-12 15:17:13.090 :: ffmpeg-kit-debug: LogCallback: fd_seek size check error
2023-03-12 15:17:13.093 :: ffmpeg-kit-debug: LogCallback: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb40000730dd9dbf0] After avformat_find_stream_info() pos: 323745 bytes read:3720930284 seeks:1 frames:3

2023-03-12 15:17:13.096 :: ffmpeg-kit-debug: LogCallback: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'saf:6.MP4':

2023-03-12 15:17:13.099 :: ffmpeg-kit-debug: LogCallback: Metadata:

2023-03-12 15:17:13.102 :: ffmpeg-kit-debug: LogCallback: major_brand : 
2023-03-12 15:17:13.108 :: ffmpeg-kit-debug: LogCallback: mp41
2023-03-12 15:17:13.110 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.113 :: ffmpeg-kit-debug: LogCallback: minor_version : 
2023-03-12 15:17:13.115 :: ffmpeg-kit-debug: LogCallback: 538120216
2023-03-12 15:17:13.119 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.121 :: ffmpeg-kit-debug: LogCallback: compatible_brands: 
2023-03-12 15:17:13.124 :: ffmpeg-kit-debug: LogCallback: mp41
2023-03-12 15:17:13.127 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.129 :: ffmpeg-kit-debug: LogCallback: creation_time : 
2023-03-12 15:17:13.132 :: ffmpeg-kit-debug: LogCallback: 2022-02-06T13:53:53.000000Z
2023-03-12 15:17:13.136 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.138 :: ffmpeg-kit-debug: LogCallback: firmware : 
2023-03-12 15:17:13.140 :: ffmpeg-kit-debug: LogCallback: HD9.01.01.60.00
2023-03-12 15:17:13.142 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.144 :: ffmpeg-kit-debug: LogCallback: Duration: 
2023-03-12 15:17:13.146 :: ffmpeg-kit-debug: LogCallback: 00:10:57.27
2023-03-12 15:17:13.149 :: ffmpeg-kit-debug: LogCallback: , start: 
2023-03-12 15:17:13.152 :: ffmpeg-kit-debug: LogCallback: 0.000000
2023-03-12 15:17:13.154 :: ffmpeg-kit-debug: LogCallback: , bitrate: 
2023-03-12 15:17:13.157 :: ffmpeg-kit-debug: LogCallback: 45284 kb/s
2023-03-12 15:17:13.159 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.161 :: ffmpeg-kit-debug: LogCallback: Chapters:

2023-03-12 15:17:13.164 :: ffmpeg-kit-debug: LogCallback: Chapter #0:0: 
2023-03-12 15:17:13.166 :: ffmpeg-kit-debug: LogCallback: start 619.735000, 
2023-03-12 15:17:13.169 :: ffmpeg-kit-debug: LogCallback: end 657.273000

2023-03-12 15:17:13.171 :: ffmpeg-kit-debug: LogCallback: Stream #0:0
2023-03-12 15:17:13.174 :: ffmpeg-kit-debug: LogCallback: [0x1]
2023-03-12 15:17:13.175 :: ffmpeg-kit-debug: LogCallback: (eng)
2023-03-12 15:17:13.177 :: ffmpeg-kit-debug: LogCallback: , 1, 1/60000
2023-03-12 15:17:13.182 :: ffmpeg-kit-debug: LogCallback: : Video: h264, 1 reference frame (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 0/1, 45005 kb/s
2023-03-12 15:17:13.185 :: ffmpeg-kit-debug: LogCallback: , 
2023-03-12 15:17:13.189 :: ffmpeg-kit-debug: LogCallback: 59.94 fps, 
2023-03-12 15:17:13.192 :: ffmpeg-kit-debug: LogCallback: 59.94 tbr, 
2023-03-12 15:17:13.194 :: ffmpeg-kit-debug: LogCallback: 60k tbn
2023-03-12 15:17:13.197 :: ffmpeg-kit-debug: LogCallback: (default)
2023-03-12 15:17:13.199 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.200 :: ffmpeg-kit-debug: LogCallback: Metadata:

2023-03-12 15:17:13.203 :: ffmpeg-kit-debug: LogCallback: creation_time : 
2023-03-12 15:17:13.204 :: ffmpeg-kit-debug: LogCallback: 2022-02-06T13:53:53.000000Z
2023-03-12 15:17:13.206 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.209 :: ffmpeg-kit-debug: LogCallback: handler_name : 
2023-03-12 15:17:13.211 :: ffmpeg-kit-debug: LogCallback: GoPro AVC 
2023-03-12 15:17:13.213 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.216 :: ffmpeg-kit-debug: LogCallback: vendor_id : 
2023-03-12 15:17:13.219 :: ffmpeg-kit-debug: LogCallback: [0][0][0][0]
2023-03-12 15:17:13.220 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.223 :: ffmpeg-kit-debug: LogCallback: encoder : 
2023-03-12 15:17:13.225 :: ffmpeg-kit-debug: LogCallback: GoPro AVC encoder
2023-03-12 15:17:13.227 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.229 :: ffmpeg-kit-debug: LogCallback: Stream #0:1
2023-03-12 15:17:13.231 :: ffmpeg-kit-debug: LogCallback: [0x2]
2023-03-12 15:17:13.233 :: ffmpeg-kit-debug: LogCallback: (eng)
2023-03-12 15:17:13.236 :: ffmpeg-kit-debug: LogCallback: , 1, 1/48000
2023-03-12 15:17:13.238 :: ffmpeg-kit-debug: LogCallback: : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s
2023-03-12 15:17:13.240 :: ffmpeg-kit-debug: LogCallback: (default)
2023-03-12 15:17:13.243 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.244 :: ffmpeg-kit-debug: LogCallback: Metadata:

2023-03-12 15:17:13.247 :: ffmpeg-kit-debug: LogCallback: creation_time : 
2023-03-12 15:17:13.252 :: ffmpeg-kit-debug: LogCallback: 2022-02-06T13:53:53.000000Z
2023-03-12 15:17:13.255 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.257 :: ffmpeg-kit-debug: LogCallback: handler_name : 
2023-03-12 15:17:13.259 :: ffmpeg-kit-debug: LogCallback: GoPro AAC 
2023-03-12 15:17:13.262 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.264 :: ffmpeg-kit-debug: LogCallback: vendor_id : 
2023-03-12 15:17:13.268 :: ffmpeg-kit-debug: LogCallback: [0][0][0][0]
2023-03-12 15:17:13.271 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.274 :: ffmpeg-kit-debug: LogCallback: Stream #0:2
2023-03-12 15:17:13.276 :: ffmpeg-kit-debug: LogCallback: [0x3]
2023-03-12 15:17:13.278 :: ffmpeg-kit-debug: LogCallback: (eng)
2023-03-12 15:17:13.280 :: ffmpeg-kit-debug: LogCallback: , 1, 1/60000
2023-03-12 15:17:13.281 :: ffmpeg-kit-debug: LogCallback: : Data: none (tmcd / 0x64636D74), 0/1
2023-03-12 15:17:13.284 :: ffmpeg-kit-debug: LogCallback: (default)
2023-03-12 15:17:13.288 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.290 :: ffmpeg-kit-debug: LogCallback: Metadata:

2023-03-12 15:17:13.291 :: ffmpeg-kit-debug: LogCallback: creation_time : 
2023-03-12 15:17:13.292 :: ffmpeg-kit-debug: LogCallback: 2022-02-06T13:53:53.000000Z
2023-03-12 15:17:13.294 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.296 :: ffmpeg-kit-debug: LogCallback: handler_name : 
2023-03-12 15:17:13.299 :: ffmpeg-kit-debug: LogCallback: GoPro TCD 
2023-03-12 15:17:13.302 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.306 :: ffmpeg-kit-debug: LogCallback: Stream #0:3
2023-03-12 15:17:13.309 :: ffmpeg-kit-debug: LogCallback: [0x4]
2023-03-12 15:17:13.310 :: ffmpeg-kit-debug: LogCallback: (eng)
2023-03-12 15:17:13.313 :: ffmpeg-kit-debug: LogCallback: , 0, 1/1000
2023-03-12 15:17:13.316 :: ffmpeg-kit-debug: LogCallback: : Data: bin_data (gpmd / 0x646D7067), 0/1, 61 kb/s
2023-03-12 15:17:13.318 :: ffmpeg-kit-debug: LogCallback: (default)
2023-03-12 15:17:13.320 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.322 :: ffmpeg-kit-debug: LogCallback: Metadata:

2023-03-12 15:17:13.325 :: ffmpeg-kit-debug: LogCallback: creation_time : 
2023-03-12 15:17:13.327 :: ffmpeg-kit-debug: LogCallback: 2022-02-06T13:53:53.000000Z
2023-03-12 15:17:13.329 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.331 :: ffmpeg-kit-debug: LogCallback: handler_name : 
2023-03-12 15:17:13.335 :: ffmpeg-kit-debug: LogCallback: GoPro MET 
2023-03-12 15:17:13.337 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.339 :: ffmpeg-kit-debug: LogCallback: Stream #0:4
2023-03-12 15:17:13.342 :: ffmpeg-kit-debug: LogCallback: [0x5]
2023-03-12 15:17:13.344 :: ffmpeg-kit-debug: LogCallback: (eng)
2023-03-12 15:17:13.345 :: ffmpeg-kit-debug: LogCallback: , 0, 1/60000
2023-03-12 15:17:13.347 :: ffmpeg-kit-debug: LogCallback: : Data: none (fdsc / 0x63736466), 0/1, 13 kb/s
2023-03-12 15:17:13.350 :: ffmpeg-kit-debug: LogCallback: (default)
2023-03-12 15:17:13.352 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.354 :: ffmpeg-kit-debug: LogCallback: Metadata:

2023-03-12 15:17:13.356 :: ffmpeg-kit-debug: LogCallback: creation_time : 
2023-03-12 15:17:13.359 :: ffmpeg-kit-debug: LogCallback: 2022-02-06T13:53:53.000000Z
2023-03-12 15:17:13.361 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.365 :: ffmpeg-kit-debug: LogCallback: handler_name : 
2023-03-12 15:17:13.369 :: ffmpeg-kit-debug: LogCallback: GoPro SOS 
2023-03-12 15:17:13.372 :: ffmpeg-kit-debug: LogCallback: 

2023-03-12 15:17:13.374 :: ffmpeg-kit-debug: LogCallback: Successfully opened the file.

2023-03-12 15:17:13.376 :: ffmpeg-kit-debug: LogCallback: open_files INPUT done
2023-03-12 15:17:13.378 :: ffmpeg-kit-debug: LogCallback: apply_sync_offsets
2023-03-12 15:17:13.382 :: ffmpeg-kit-debug: LogCallback: apply_sync_offsets done
2023-03-12 15:17:13.386 :: ffmpeg-kit-debug: LogCallback: init_complex_filters
2023-03-12 15:17:13.389 :: ffmpeg-kit-debug: LogCallback: init_complex_filters done
2023-03-12 15:17:13.391 :: ffmpeg-kit-debug: LogCallback: open_files OUTPUT
2023-03-12 15:17:13.392 :: ffmpeg-kit-debug: LogCallback: open_files OUTPUT done
2023-03-12 15:17:13.395 :: ffmpeg-kit-debug: LogCallback: check_filter_outputs
2023-03-12 15:17:13.397 :: ffmpeg-kit-debug: LogCallback: check_filter_outputs done
2023-03-12 15:17:13.399 :: ffmpeg-kit-debug: LogCallback: ffmpeg_parse_options done
2023-03-12 15:17:13.402 :: ffmpeg-kit-debug: LogCallback: At least one output file must be specified

2023-03-12 15:17:13.405 :: ffmpeg-kit-debug: LogCallback: [AVIOContext @ 0xb4000072dddd6510] Statistics: 3720930284 bytes read, 1 seeks

2023-03-12 15:17:13.407 :: ffmpeg-kit-debug: LogCallback: fd_close start
2023-03-12 15:17:13.410 :: ffmpeg-kit-debug: LogCallback: fd_close done
2023-03-12 15:17:13.412 :: ffmpeg-kit-debug: LogCallback: setjmp done



Note : I have built ffmpeg-kit with the following script :


#!/bin/bash

export ENCODERS="libvorbis,libvpx_vp8,libvpx_vp9,libx264,libx265,mpeg1video,mpeg2video,mpeg4,flv,wmv1,wmv2,msmpeg4v3,libaom_av1,\
h261,h263,theora,libtheora,png,aac,ac3,alac,libopencore_amrnb,libvo_amrwbenc,eac3,flac,mp2,libtwolame,libmp3lame,libopus,libspeex,wavpack,wmav1,wmav2,pcm_s16le,\
ssa,ass,dvbsub,dvdsub,movtext,srt,subrip,text,ttml,webvtt,xsub"

export SETTINGS="--disable-indevs \
 --enable-pthreads \
 --enable-indev=lavfi \
 --disable-outdevs \
 --disable-protocols \
 --enable-protocol=file,fd,saf,async \
 --disable-encoders \
 --enable-encoder=${ENCODERS}"

export CUSTOM_CONFIG=${SETTINGS}

./android.sh --disable-arm-v7a --disable-arm-v7a-neon --disable-x86 --disable-x86-64 --enable-android-media-codec --enable-android-zlib --enable-chromaprint --enable-dav1d --enable-fontconfig --enable-freetype --enable-fribidi --enable-gmp --enable-gnutls --enable-kvazaar --enable-lame --enable-libaom --enable-libass --enable-libiconv --enable-libilbc --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-opencore-amr --enable-openh264 --enable-opus --enable-sdl --enable-shine --enable-snappy --enable-soxr --enable-speex --enable-tesseract --enable-twolame --enable-vo-amrwbenc --enable-zimg --enable-x264 --enable-x265 --enable-gpl -l



Sample file : https://drive.google.com/file/d/1lvCiOBQqBEnUECn_HJi8qUoaCPCBnkgO/view?usp=share_link


Ffmpeg version : 5.1.


-
Error initializing FFmpegKit : "TypeError : Cannot read property 'getLogLevel' of null" in React Native
9 janvier, par Md Monirozzaman khanI'm developing a React Native application where I need to process videos using the ffmpeg-kit-react-native library. However, I'm encountering an issue during the initialization of FFmpegKitConfig. The error message is :


ERROR Error initializing FFmpegKit: [TypeError: Cannot read property 'getLogLevel' of null]



Here is my App.js code




import React, { useState, useEffect } from 'react';
import { StyleSheet, Text, View, TouchableOpacity, Alert, Dimensions, ScrollView, LayoutAnimation, UIManager, Platform } from 'react-native';
import * as ImagePicker from 'expo-image-picker';
import * as FileSystem from 'expo-file-system';
import { Video } from 'expo-av';
import { MaterialIcons } from '@expo/vector-icons';
import { FFmpegKit, FFmpegKitConfig, ReturnCode } from 'ffmpeg-kit-react-native';

const windowWidth = Dimensions.get('window').width;

if (Platform.OS === 'android') {
 UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
}

export default function App() {
 const [videoFiles, setVideoFiles] = useState([]);
 const [isGridView, setIsGridView] = useState(false);
 const [isConverting, setIsConverting] = useState(false);

 useEffect(() => {
 FFmpegKitConfig.init()
 .then(() => {
 console.log('FFmpegKit initialized');
 })
 .catch((error) => {
 console.error('Error initializing FFmpegKit:', error);
 });
 }, []);

 const pickVideo = async () => {
 const { status } = await ImagePicker.requestMediaLibraryPermissionsAsync();
 if (status !== 'granted') {
 alert('Sorry, we need media library permissions to make this work!');
 return;
 }

 let result = await ImagePicker.launchImageLibraryAsync({
 mediaTypes: ImagePicker.MediaTypeOptions.Videos,
 allowsMultipleSelection: true,
 });

 if (!result.canceled && result.assets.length > 0) {
 const newFiles = result.assets.filter(
 (newFile) => !videoFiles.some((existingFile) => existingFile.uri === newFile.uri)
 );

 if (newFiles.length < result.assets.length) {
 Alert.alert('Duplicate Files', 'Some files were already added.');
 }

 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
 setVideoFiles([...videoFiles, ...newFiles]);
 }
 };

 const convertVideos = async () => {
 setIsConverting(true);
 const outputDir = `${FileSystem.documentDirectory}Output`;

 const dirInfo = await FileSystem.getInfoAsync(outputDir);
 if (!dirInfo.exists) {
 await FileSystem.makeDirectoryAsync(outputDir, { intermediates: true });
 }

 for (const video of videoFiles) {
 const { uri } = video;
 const filename = uri.split('/').pop();
 const outputFilePath = `${outputDir}/${filename.split('.').slice(0, -1).join('.')}_modified.mp4`;

 const ffmpegCommand = `-y -i "${uri}" -af "atempo=1.02, bass=g=4:f=80:w=3, treble=g=4:f=3200:w=3, firequalizer=gain_entry='entry(0,0);entry(62,2);entry(125,1.5);entry(250,1);entry(500,1);entry(1000,1);entry(2000,1.5);entry(4000,2.5);entry(8000,3);entry(16000,4)', compand=attacks=0.05:decays=0.25:points=-80/-80-50/-15-30/-10-10/-2:soft-knee=4:gain=2, deesser, highpass=f=35, lowpass=f=17000, loudnorm=I=-16:LRA=11:TP=-1.5, volume=3.9dB" -c:v copy -c:a aac -b:a 224k -ar 48000 -threads 0 "${outputFilePath}"`;

 try {
 const session = await FFmpegKit.execute(ffmpegCommand);
 const returnCode = await session.getReturnCode();

 if (ReturnCode.isSuccess(returnCode)) {
 console.log(`Video converted: ${outputFilePath}`);
 } else if (ReturnCode.isCancel(returnCode)) {
 console.log('Conversion cancelled');
 } else {
 console.error(`FFmpeg process failed: ${session.getFailStackTrace()}`);
 }
 } catch (error) {
 console.error(`Error converting video: ${error.message}`);
 }
 }

 setIsConverting(false);
 Alert.alert('Conversion Complete', 'All videos have been converted.');
 };

 const deleteVideo = (uri) => {
 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
 setVideoFiles(videoFiles.filter((video) => video.uri !== uri));
 };

 const clearAllVideos = () => {
 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
 setVideoFiles([]);
 };

 const toggleLayout = () => {
 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
 setIsGridView(!isGridView);
 };

 return (
 <view style="{styles.container}">
 <text style="{styles.header}">Video Converter App</text>
 <touchableopacity style="{styles.addButton}">
 <text style="{styles.addButtonText}">Select or Browse Videos</text>
 </touchableopacity>
 <view style="{styles.headerContainer}">
 <text style="{styles.videoCount}">Total Videos: {videoFiles.length}</text>
 {videoFiles.length > 0 && (
 <>
 <touchableopacity style="{styles.clearButtonContainer}">
 <materialicons size="{24}" color="red" style="{styles.clearIcon}"></materialicons>
 <text style="{styles.clearAllText}">Clear All</text>
 </touchableopacity>
 <touchableopacity style="{styles.toggleLayoutButton}">
 <materialicons size="{24}" color="#fff"></materialicons>
 </touchableopacity>
 >
 )}
 </view>
 {isGridView ? (
 <scrollview contentcontainerstyle="{styles.gridContainer}">
 {videoFiles.map((item, index) => (
 <view key="{index}" style="{styles.videoItemGrid}">
 
 <touchableopacity>> deleteVideo(item.uri)} style={styles.deleteButtonGrid}>
 <materialicons size="{24}" color="red"></materialicons>
 </touchableopacity>
 </view>
 ))}
 </scrollview>
 ) : (
 <view style="{styles.list}">
 {videoFiles.map((item, index) => (
 <view key="{index}" style="{styles.videoItem}">
 
 <text style="{styles.fileName}">{decodeURI(item.fileName || item.uri.split('/').pop() || 'Unknown File')}</text>
 <touchableopacity>> deleteVideo(item.uri)} style={styles.deleteButton}>
 <materialicons size="{24}" color="red"></materialicons>
 </touchableopacity>
 </view>
 ))}
 </view>
 )}
 {videoFiles.length > 0 && (
 <touchableopacity style="{styles.convertButton}" disabled="{isConverting}">
 <text style="{styles.convertButtonText}">{isConverting ? 'Converting...' : 'Convert'}</text>
 </touchableopacity>
 )}
 </view>
 );
}

const styles = StyleSheet.create({
 container: {
 flex: 1,
 backgroundColor: '#fff',
 alignItems: 'center',
 padding: 10,
 },
 header: {
 fontSize: 24,
 fontWeight: 'bold',
 marginBottom: 5,
 },
 addButton: {
 backgroundColor: '#007BFF',
 padding: 15,
 borderRadius: 10,
 alignItems: 'center',
 marginBottom: 5,
 width: '100%',
 elevation: 2,
 shadowColor: '#000',
 shadowOffset: { width: 0, height: 5 },
 shadowOpacity: 0.8,
 shadowRadius: 2,
 },
 addButtonText: {
 color: '#fff',
 fontSize: 18,
 fontWeight: 'bold',
 },
 headerContainer: {
 flexDirection: 'row',
 alignItems: 'center',
 justifyContent: 'space-between',
 width: '100%',
 marginBottom: 10,
 },
 videoCount: {
 fontSize: 18,
 },
 clearButtonContainer: {
 flexDirection: 'row',
 alignItems: 'center',
 marginRight: 10,
 },
 clearIcon: {
 marginRight: 5,
 },
 clearAllText: {
 fontSize: 16,
 color: 'red',
 textDecorationLine: 'underline',
 },
 toggleLayoutButton: {
 backgroundColor: '#007BFF',
 padding: 1,
 borderRadius: 8,
 alignItems: 'center',
 justifyContent: 'center',
 },
 list: {
 flex: 1,
 width: '100%',
 },
 videoItem: {
 padding: 5,
 borderBottomColor: '#ccc',
 borderBottomWidth: 0.7,
 flexDirection: 'row',
 alignItems: 'center',
 },
 videoItemGrid: {
 flexDirection: 'column',
 alignItems: 'center',
 margin: 4,
 borderWidth: 1,
 borderColor: '#ccc',
 borderRadius: 8,
 padding: 2,
 position: 'relative',
 },
 thumbnail: {
 width: 70,
 height: 70,
 marginRight: 10,
 },
 thumbnailGrid: {
 width: 80,
 height: 80,
 marginBottom: 0,
 },
 fileName: {
 fontSize: 16,
 marginLeft: 10,
 flex: 1,
 },
 deleteButton: {
 marginLeft: 60,
 width: 20,
 height: 20,
 },
 deleteButtonGrid: {
 position: 'absolute',
 bottom: 5,
 right: 5,
 },
 convertButton: {
 backgroundColor: '#007BFF',
 padding: 15,
 borderRadius: 10,
 alignItems: 'center',
 marginTop: 20,
 width: '100%',
 },
 convertButtonText: {
 color: '#fff',
 fontSize: 18,
 fontWeight: 'bold',
 },
 gridContainer: {
 flexDirection: 'row',
 flexWrap: 'wrap',
 justifyContent: 'flex-start',
 paddingVertical: 5,
 paddingHorizontal: 5,
 width: '100%',
 },
});







App.json




{
 "expo": {
 "name": "VidoeConvert",
 "slug": "VidoeConvert",
 "version": "1.0.0",
 "orientation": "portrait",
 "icon": "./assets/icon.png",
 "userInterfaceStyle": "light",
 "splash": {
 "image": "./assets/splash.png",
 "resizeMode": "contain",
 "backgroundColor": "#ffffff"
 },
 "ios": {
 "supportsTablet": true
 },
 "android": {
 "adaptiveIcon": {
 "foregroundImage": "./assets/adaptive-icon.png",
 "backgroundColor": "#ffffff"
 },
 "package": "com.anonymous.VidoeConvert"
 },
 "web": {
 "favicon": "./assets/favicon.png"
 },
 "plugins": [
 "@config-plugins/ffmpeg-kit-react-native",
 "expo-build-properties"
 ]
 }
}







Package.json




{
 "name": "vidoeconvert",
 "version": "1.0.0",
 "main": "expo/AppEntry.js",
 "scripts": {
 "start": "expo start",
 "android": "expo run:android",
 "ios": "expo run:ios",
 "web": "expo start --web"
 },
 "dependencies": {
 "@config-plugins/ffmpeg-kit-react-native": "^8.0.0",
 "@expo/metro-runtime": "~3.2.1",
 "expo": "~51.0.17",
 "expo-asset": "~10.0.10",
 "expo-av": "^14.0.6",
 "expo-document-picker": "~12.0.2",
 "expo-file-system": "~17.0.1",
 "expo-image-picker": "~15.0.7",
 "expo-media-library": "~16.0.4",
 "expo-status-bar": "~1.12.1",
 "ffmpeg-kit-react-native": "^6.0.2",
 "react": "18.2.0",
 "react-dom": "18.2.0",
 "react-native": "^0.74.3",
 "react-native-document-picker": "^9.3.0",
 "react-native-ffmpeg": "^0.5.2",
 "react-native-vector-icons": "^10.1.0",
 "react-native-web": "~0.19.10",
 "expo-build-properties": "~0.12.3"
 },
 "devDependencies": {
 "@babel/core": "^7.20.0"
 },
 "private": true
}







Has anyone encountered a similar issue or can point me in the right direction to resolve this error ? Any help would be greatly appreciated !


How to remove the error ?


any configruation required for this project ?