Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (48)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (10736)

  • Laravel ffmpeg hls encode multi-bitrate x264 error

    4 octobre 2022, par Osman Şimşek

    I wanted to encode mutliple bitrate hls using Laravel protonomedia library. When I give a single bitrate, it performs the encode operation without error, but when I want to work with mutliple bitrate, it gives an error.

    


    FFmpeg Version : 5.1.1

    


    FFmpeg Command :

    


    [2022-10-04 08:42:47] local.INFO: ffmpeg running command '/opt/ffmpeg-amd64-static/ffmpeg' '-version'  
[2022-10-04 08:42:47] local.INFO: ffmpeg executed command successfully  
[2022-10-04 08:42:47] local.INFO: ffmpeg running command '/opt/ffmpeg-amd64-static/ffmpeg' '-y' '-threads' '12' '-i' '/tmp/phpLH0wts' '-map' '0' '-vcodec' 'libx264' '-b:v' '250k' '-sc_threshold' '0' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_0_250_%05d.ts' '-master_pl_name' 'temporary_segment_playlist_0.m3u8' '-hls_key_info_file' '/tmp/78627e6a6355dc72/hls_encryption.keyinfo' '-hls_flags' 'periodic_rekey' '-acodec' 'aac' '-b:a' '128k' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_0_250.m3u8' '-map' '0' '-vcodec' 'libx264' '-b:v' '500k' '-sc_threshold' '0' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_1_500_%05d.ts' '-master_pl_name' 'temporary_segment_playlist_1.m3u8' '-hls_key_info_file' '/tmp/78627e6a6355dc72/hls_encryption.keyinfo' '-hls_flags' 'periodic_rekey' '-acodec' 'aac' '-b:a' '128k' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_1_500.m3u8' '-map' '0' '-vcodec' 'libx264' '-b:v' '1000k' '-sc_threshold' '0' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_2_1000_%05d.ts' '-master_pl_name' 'temporary_segment_playlist_2.m3u8' '-hls_key_info_file' '/tmp/78627e6a6355dc72/hls_encryption.keyinfo' '-hls_flags' 'periodic_rekey' '-acodec' 'aac' '-b:a' '128k' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_2_1000.m3u8'  
[2022-10-04 08:42:47] local.INFO: ffprobe running command '/opt/ffmpeg-amd64-static/ffprobe' '-help' '-loglevel' 'quiet'  
[2022-10-04 08:42:47] local.INFO: ffprobe executed command successfully  
[2022-10-04 08:42:47] local.INFO: ffprobe running command '/opt/ffmpeg-amd64-static/ffprobe' '/tmp/phpLH0wts' '-show_format' '-print_format' 'json'  
[2022-10-04 08:42:47] local.INFO: ffprobe executed command successfully  
[2022-10-04 08:42:47] local.ERROR: ffmpeg failed to execute command '/opt/ffmpeg-amd64-static/ffmpeg' '-y' '-threads' '12' '-i' '/tmp/phpLH0wts' '-map' '0' '-vcodec' 'libx264' '-b:v' '250k' '-sc_threshold' '0' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_0_250_%05d.ts' '-master_pl_name' 'temporary_segment_playlist_0.m3u8' '-hls_key_info_file' '/tmp/78627e6a6355dc72/hls_encryption.keyinfo' '-hls_flags' 'periodic_rekey' '-acodec' 'aac' '-b:a' '128k' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_0_250.m3u8' '-map' '0' '-vcodec' 'libx264' '-b:v' '500k' '-sc_threshold' '0' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_1_500_%05d.ts' '-master_pl_name' 'temporary_segment_playlist_1.m3u8' '-hls_key_info_file' '/tmp/78627e6a6355dc72/hls_encryption.keyinfo' '-hls_flags' 'periodic_rekey' '-acodec' 'aac' '-b:a' '128k' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_1_500.m3u8' '-map' '0' '-vcodec' 'libx264' '-b:v' '1000k' '-sc_threshold' '0' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_2_1000_%05d.ts' '-master_pl_name' 'temporary_segment_playlist_2.m3u8' '-hls_key_info_file' '/tmp/78627e6a6355dc72/hls_encryption.keyinfo' '-hls_flags' 'periodic_rekey' '-acodec' 'aac' '-b:a' '128k' '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_2_1000.m3u8': ffmpeg version N-63101-gc92edd969a-static https://johnvansickle.com/ffmpeg/  


    


    FFmpeg Error Message :

    


    Output #2, hls, to '/home/crowiaftp/public_html/yeni/public/uploads/streams/1664862167633bc7d76b09b_2_1000.m3u8':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf59.30.101
  Stream #2:0(und): Video: h264, yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1000 kb/s, 25 fps, 90k tbn (default)
    Metadata:
      creation_time   : 2022-04-19T07:50:11.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 04/19/2022.
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.42.104 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: N/A
  Stream #2:1(eng): Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2022-04-19T07:50:11.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 04/19/2022.
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.42.104 aac
frame=    0 fps=0.0 q=0.0 q=0.0 q=0.0 size=N/A time=00:00:00.41 bitrate=N/A speed=5.41x    
x264 [error]: malloc of size 3325760 failed
Error submitting video frame to the encoder
[libx264 @ 0x5a8cec0] final ratefactor: 40.36
[aac @ 0x5abc000] Qavg: 19883.271
[aac @ 0x5abc000] 2 frames left in the queue on closing
[libx264 @ 0x5b20d80] final ratefactor: 34.36
[aac @ 0x5ab7a40] Qavg: 19883.271
[aac @ 0x5ab7a40] 2 frames left in the queue on closing
[libx264 @ 0x5ab6440] final ratefactor: 28.36
[aac @ 0x5a89580] Qavg: 19883.271
[aac @ 0x5a89580] 2 frames left in the queue on closing
Conversion failed!


    


    Hls encoding code :

    


    $uniqFileName = uniqid(time());

FFMpeg::open($file)->exportForHLS()
  ->withRotatingEncryptionKey(function($fileName, $contents){
      Storage::disk('streams')->put("secrets/$fileName", $contents);
  })
  ->addFormat((new \FFMpeg\Format\Video\X264)->setKiloBitrate(250))
  ->addFormat((new \FFMpeg\Format\Video\X264)->setKiloBitrate(500))
  ->addFormat((new \FFMpeg\Format\Video\X264)->setKiloBitrate(1000))
  ->toDisk('streams')
  ->save($uniqFileName.'.m3u8');

 FFMpeg::cleanupTemporaryFiles();


    


  • Hello. I'd like to play a video on my app on android, I tried with videoplayer, it works but doesn't load the video simply open theUI but not thevideo

    26 octobre 2022, par Abdul

    I'd like to play a video on my app on android, I tried with videoplayer, it works but doesn't load the video ( simply open the UI but not the video).

    


    I found out i may need ffpyplayer so I changed buildozer requirements :
requirements = python3,kivy, android,ffpyplayer

    


    but buildozer failed to build apk when i added ffpyplayer and ffmpeg in buildozer.spec file in requirement.

    


    [DEBUG]:    If you think configure made a mistake, make sure you are using the latest&#xA;[DEBUG]:    version from Git.  If the latest version fails, report the problem to the&#xA;[DEBUG]:    ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.&#xA;[DEBUG]:    Include the log file "ffbuild/config.log" produced by configure as this will help&#xA;[DEBUG]:    solve the problem.&#xA;Exception in thread background thread for pid 77802:&#xA;Traceback (most recent call last):&#xA;  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner&#xA;    self.run()&#xA;  File "/usr/lib/python3.7/threading.py", line 870, in run&#xA;    self._target(*self._args, **self._kwargs)&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 1641, in wrap&#xA;    fn(*rgs, **kwargs)&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 2569, in background_thread&#xA;    handle_exit_code(exit_code)&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 2269, in fn&#xA;    return self.command.handle_command_exit_code(exit_code)&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 869, in handle_command_exit_code&#xA;    raise exc&#xA;sh.ErrorReturnCode_1: &#xA;&#xA;  RAN: /content/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/ffmpeg/armeabi-v7a__ndk_target_21/ffmpeg/configure --disable-everything --enable-openssl --enable-nonfree --enable-protocol=https,tls_openssl --enable-gpl --enable-libx264 --enable-libshine --enable-libvpx --enable-parsers --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --disable-symver --disable-programs --disable-doc --enable-filter=aresample,resample,crop,adelay,volume,scale --enable-protocol=file,http,hls,udp,tcp --enable-small --enable-hwaccels --enable-pic --disable-static --disable-debug --enable-shared --target-os=android --enable-cross-compile --cross-prefix=armv7a-linux-androideabi21- --arch=arm --strip=/root/.buildozer/android/platform/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --sysroot=/root/.buildozer/android/platform/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/sysroot --enable-neon --prefix=/content/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/ffmpeg/armeabi-v7a__ndk_target_21/ffmpeg&#xA;&#xA;  STDOUT:&#xA;tput: No value for $TERM and no -T specified&#xA;tput: No value for $TERM and no -T specified&#xA;armv7a-linux-androideabi21-clang is unable to create an executable file.&#xA;C compiler test failed.&#xA;&#xA;If you think configure made a mistake, make sure you are using the latest&#xA;version from Git.  If the latest version fails, report the problem to the&#xA;ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.&#xA;Include the log file "ffbuild/config.log" produced by configure as this will help&#xA;solve the problem.&#xA;&#xA;&#xA;  STDERR:&#xA;&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main&#xA;    "__main__", mod_spec)&#xA;  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code&#xA;    exec(code, run_globals)&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1297, in <module>&#xA;    main()&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main&#xA;    ToolchainCL()&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 730, in __init__&#xA;    getattr(self, command)(args)&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func&#xA;    build_dist_from_args(ctx, dist, args)&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 215, in build_dist_from_args&#xA;    args, "ignore_setup_py", False&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 505, in build_recipes&#xA;    recipe.build_arch(arch)&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/ffmpeg/__init__.py", line 143, in build_arch&#xA;    shprint(configure, *flags, _env=env)&#xA;  File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint&#xA;    for line in output:&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 915, in next&#xA;    self.wait()&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 845, in wait&#xA;    self.handle_command_exit_code(exit_code)&#xA;  File "/usr/local/lib/python3.7/dist-packages/sh.py", line 869, in handle_command_exit_code&#xA;    raise exc&#xA;sh.ErrorReturnCode_1: &#xA;&#xA;  RAN: /content/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/ffmpeg/armeabi-v7a__ndk_target_21/ffmpeg/configure --disable-everything --enable-openssl --enable-nonfree --enable-protocol=https,tls_openssl --enable-gpl --enable-libx264 --enable-libshine --enable-libvpx --enable-parsers --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --disable-symver --disable-programs --disable-doc --enable-filter=aresample,resample,crop,adelay,volume,scale --enable-protocol=file,http,hls,udp,tcp --enable-small --enable-hwaccels --enable-pic --disable-static --disable-debug --enable-shared --target-os=android --enable-cross-compile --cross-prefix=armv7a-linux-androideabi21- --arch=arm --strip=/root/.buildozer/android/platform/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --sysroot=/root/.buildozer/android/platform/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/sysroot --enable-neon --prefix=/content/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/ffmpeg/armeabi-v7a__ndk_target_21/ffmpeg&#xA;&#xA;  STDOUT:&#xA;tput: No value for $TERM and no -T specified&#xA;tput: No value for $TERM and no -T specified&#xA;armv7a-linux-androideabi21-clang is unable to create an executable file.&#xA;C compiler test failed.&#xA;&#xA;If you think configure made a mistake, make sure you are using the latest&#xA;version from Git.  If the latest version fails, report the problem to the&#xA;ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.&#xA;Include the log file "ffbuild/config.log" produced by configure as this will help&#xA;solve the problem.&#xA;&#xA;&#xA;  STDERR:&#xA;&#xA;# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,ffpyplayer,kivy,openssl,certifi,android,pytube,plyer,pyjnius,kivmob,jnius,future,libshine,libx264,ffpyplayer_codecs,Pillow,liblzma,opencv,requests,urllib3,chardet,idna,youtube_search --arch armeabi-v7a --copy-libs --color=always --storage-dir="/content/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug&#xA;# ENVIRONMENT:&#xA;#     NV_LIBCUBLAS_DEV_VERSION = &#x27;11.4.1.1043-1&#x27;&#xA;#     NV_CUDA_COMPAT_PACKAGE = &#x27;cuda-compat-11-2&#x27;&#xA;#     NV_CUDNN_PACKAGE_DEV = &#x27;libcudnn8-dev=8.1.1.33-1&#x2B;cuda11.2&#x27;&#xA;#     PYDEVD_USE_FRAME_EVAL = &#x27;NO&#x27;&#xA;#     LD_LIBRARY_PATH = &#x27;/usr/local/nvidia/lib:/usr/local/nvidia/lib64&#x27;&#xA;#     NV_LIBNCCL_DEV_PACKAGE = &#x27;libnccl-dev=2.8.4-1&#x2B;cuda11.2&#x27;&#xA;#     TCLLIBPATH = &#x27;/usr/share/tcltk/tcllib1.19&#x27;&#xA;#     CLOUDSDK_PYTHON = &#x27;python3&#x27;&#xA;#     LANG = &#x27;en_US.UTF-8&#x27;&#xA;#     NV_LIBNPP_DEV_PACKAGE = &#x27;libnpp-dev-11-2=11.3.2.152-1&#x27;&#xA;#     ENABLE_DIRECTORYPREFETCHER = &#x27;1&#x27;&#xA;#     HOSTNAME = &#x27;875ade0bb031&#x27;&#xA;#     OLDPWD = &#x27;/&#x27;&#xA;#     CLOUDSDK_CONFIG = &#x27;/content/.config&#x27;&#xA;#     USE_AUTH_EPHEM = &#x27;1&#x27;&#xA;#     NV_LIBNPP_VERSION = &#x27;11.3.2.152-1&#x27;&#xA;#     NV_NVPROF_DEV_PACKAGE = &#x27;cuda-nvprof-11-2=11.2.152-1&#x27;&#xA;#     NVIDIA_VISIBLE_DEVICES = &#x27;all&#x27;&#xA;#     NV_NVPROF_VERSION = &#x27;11.2.152-1&#x27;&#xA;#     NV_LIBCUSPARSE_VERSION = &#x27;11.4.1.1152-1&#x27;&#xA;#     DATALAB_SETTINGS_OVERRIDES = &#x27;{"kernelManagerProxyPort":6000,"kernelManagerProxyHost":"172.28.0.3","jupyterArgs":["--ip=172.28.0.2"],"debugAdapterMultiplexerPath":"/usr/local/bin/dap_multiplexer","enableLsp":true}&#x27;&#xA;#     NV_LIBCUBLAS_DEV_PACKAGE = &#x27;libcublas-dev-11-2=11.4.1.1043-1&#x27;&#xA;#     ENV = &#x27;/root/.bashrc&#x27;&#xA;#     PAGER = &#x27;cat&#x27;&#xA;#     NCCL_VERSION = &#x27;2.8.4-1&#x27;&#xA;#     TF_FORCE_GPU_ALLOW_GROWTH = &#x27;true&#x27;&#xA;#     JPY_PARENT_PID = &#x27;60&#x27;&#xA;#     NO_GCE_CHECK = &#x27;False&#x27;&#xA;#     PWD = &#x27;/content&#x27;&#xA;#     NVARCH = &#x27;x86_64&#x27;&#xA;#     NV_LIBCUSPARSE_DEV_VERSION = &#x27;11.4.1.1152-1&#x27;&#xA;#     HOME = &#x27;/root&#x27;&#xA;#     KMP_LISTEN_PORT = &#x27;6000&#x27;&#xA;#     LAST_FORCED_REBUILD = &#x27;20221021&#x27;&#xA;#     CLICOLOR = &#x27;1&#x27;&#xA;#     NV_LIBNCCL_PACKAGE_VERSION = &#x27;2.8.4-1&#x27;&#xA;#     NV_LIBNCCL_PACKAGE = &#x27;libnccl2=2.8.4-1&#x2B;cuda11.2&#x27;&#xA;#     DEBIAN_FRONTEND = &#x27;noninteractive&#x27;&#xA;#     NV_LIBNCCL_DEV_PACKAGE_NAME = &#x27;libnccl-dev&#x27;&#xA;#     NV_CUDA_LIB_VERSION = &#x27;11.2.2-1&#x27;&#xA;#     NV_LIBNPP_PACKAGE = &#x27;libnpp-11-2=11.3.2.152-1&#x27;&#xA;#     NV_LIBNCCL_PACKAGE_NAME = &#x27;libnccl2&#x27;&#xA;#     LIBRARY_PATH = &#x27;/usr/local/cuda/lib64/stubs&#x27;&#xA;#     NV_NVTX_VERSION = &#x27;11.2.152-1&#x27;&#xA;#     NV_LIBCUBLAS_VERSION = &#x27;11.4.1.1043-1&#x27;&#xA;#     NV_LIBCUBLAS_PACKAGE = &#x27;libcublas-11-2=11.4.1.1043-1&#x27;&#xA;#     GCE_METADATA_TIMEOUT = &#x27;3&#x27;&#xA;#     NV_CUDNN_VERSION = &#x27;8.1.1.33&#x27;&#xA;#     VM_GCE_METADATA_HOST = &#x27;169.254.169.254&#x27;&#xA;#     NV_CUDA_CUDART_DEV_VERSION = &#x27;11.2.152-1&#x27;&#xA;#     KMP_TARGET_PORT = &#x27;9000&#x27;&#xA;#     GLIBCPP_FORCE_NEW = &#x27;1&#x27;&#xA;#     TBE_CREDS_ADDR = &#x27;172.28.0.1:8008&#x27;&#xA;#     TERM = &#x27;xterm-color&#x27;&#xA;#     SHELL = &#x27;/bin/bash&#x27;&#xA;#     GCS_READ_CACHE_BLOCK_SIZE_MB = &#x27;16&#x27;&#xA;#     NV_NVML_DEV_VERSION = &#x27;11.2.152-1&#x27;&#xA;#     PYTHONWARNINGS = &#x27;ignore:::pip._internal.cli.base_command&#x27;&#xA;#     MPLBACKEND = &#x27;module://ipykernel.pylab.backend_inline&#x27;&#xA;#     CUDA_VERSION = &#x27;11.2.2&#x27;&#xA;#     NV_LIBCUBLAS_PACKAGE_NAME = &#x27;libcublas-11-2&#x27;&#xA;#     NVIDIA_DRIVER_CAPABILITIES = &#x27;compute,utility&#x27;&#xA;#     TBE_RUNTIME_ADDR = &#x27;172.28.0.1:8011&#x27;&#xA;#     SHLVL = &#x27;1&#x27;&#xA;#     PYTHONPATH = &#x27;/env/python&#x27;&#xA;#     NV_LIBCUBLAS_DEV_PACKAGE_NAME = &#x27;libcublas-dev-11-2&#x27;&#xA;#     NVIDIA_REQUIRE_CUDA = (&#x27;cuda>=11.2 brand=tesla,driver>=418,driver&lt;419 &#x27;&#xA; &#x27;brand=tesla,driver>=450,driver&lt;451&#x27;)&#xA;#     NV_LIBNPP_DEV_VERSION = &#x27;11.3.2.152-1&#x27;&#xA;#     TBE_EPHEM_CREDS_ADDR = &#x27;172.28.0.1:8009&#x27;&#xA;#     NV_CUDA_CUDART_VERSION = &#x27;11.2.152-1&#x27;&#xA;#     NV_CUDNN_PACKAGE_NAME = &#x27;libcudnn8&#x27;&#xA;#     GLIBCXX_FORCE_NEW = &#x27;1&#x27;&#xA;#     PATH = &#x27;/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/opt/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin&#x27;&#xA;#     NV_LIBNCCL_DEV_PACKAGE_VERSION = &#x27;2.8.4-1&#x27;&#xA;#     LD_PRELOAD = &#x27;/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4&#x27;&#xA;#     NV_CUDNN_PACKAGE = &#x27;libcudnn8=8.1.1.33-1&#x2B;cuda11.2&#x27;&#xA;#     GIT_PAGER = &#x27;cat&#x27;&#xA;#     _ = &#x27;/usr/local/bin/buildozer&#x27;&#xA;#     PACKAGES_PATH = &#x27;/root/.buildozer/android/packages&#x27;&#xA;#     ANDROIDSDK = &#x27;/root/.buildozer/android/platform/android-sdk&#x27;&#xA;#     ANDROIDNDK = &#x27;/root/.buildozer/android/platform/android-ndk-r23b&#x27;&#xA;#     ANDROIDAPI = &#x27;30&#x27;&#xA;#     ANDROIDMINAPI = &#x27;21&#x27;&#xA;# &#xA;# Buildozer failed to execute the last command&#xA;# The error might be hidden in the log above this error&#xA;# Please read the full log, and search for it before&#xA;# raising an issue with buildozer itself.&#xA;# In case of a bug report, please add a full log with log_level = 2&#xA;</module>

    &#xA;

    kindly help me anyone would be very appreciate thank you.

    &#xA;

  • ffmpeg encoding leaves me with blank space at the end where the video pauses and there is nothing ahead

    6 novembre 2022, par Nisarg Desai

    I was trying to slice some of the video being played and clip it in mpv.net using a .lua script which uses ffmpeg to encode the webm output. ffmpeg sometimes leaves some seconds blank and without any video/audio ahead while clipping from source. Is there any solution to this ?

    &#xA;

    The code for the script is given below (was taken from here https://github.com/occivink/mpv-scripts) :

    &#xA;

    local utils = require "mp.utils"&#xA;local msg = require "mp.msg"&#xA;local options = require "mp.options"&#xA;&#xA;local ON_WINDOWS = (package.config:sub(1,1) ~= "/")&#xA;&#xA;local start_timestamp = nil&#xA;local profile_start = ""&#xA;&#xA;-- implementation detail of the osd message&#xA;local timer = nil&#xA;local timer_duration = 2&#xA;&#xA;-- folder creation if it doesnt exist&#xA;function exists(file)&#xA;   local ok, err, code = os.rename(file, file)&#xA;   if not ok then&#xA;      if code == 13 then&#xA;         return true&#xA;      end&#xA;   end&#xA;   return ok, err&#xA;end&#xA;&#xA;--- Check if a directory exists in this path&#xA;function create_dir(path)&#xA;    local dir = "\"" .. path .. "\""&#xA;    if not exists(path .."/") then&#xA;        os.execute("mkdir " .. dir)&#xA;    end&#xA;end&#xA;&#xA;function append_table(lhs, rhs)&#xA;    for i = 1,#rhs do&#xA;        lhs[#lhs&#x2B;1] = rhs[i]&#xA;    end&#xA;    return lhs&#xA;end&#xA;&#xA;function file_exists(name)&#xA;    local f = io.open(name, "r")&#xA;    if f ~= nil then&#xA;        io.close(f)&#xA;        return true&#xA;    else&#xA;        return false&#xA;    end&#xA;end&#xA;&#xA;function get_extension(path)&#xA;    local candidate = string.match(path, "%.([^.]&#x2B;)$")&#xA;    if candidate then&#xA;        for _, ext in ipairs({ "mkv", "webm", "mp4", "avi" }) do&#xA;            if candidate == ext then&#xA;                return candidate&#xA;            end&#xA;        end&#xA;    end&#xA;    return "mkv"&#xA;end&#xA;&#xA;function get_output_string(dir, format, input, extension, title, from, to, profile)&#xA;    local res = utils.readdir(dir)&#xA;    if not res then&#xA;        return nil&#xA;    end&#xA;    local files = {}&#xA;    for _, f in ipairs(res) do&#xA;        files[f] = true&#xA;    end&#xA;    local output = format&#xA;    output = string.gsub(output, "$f", function() return input end)&#xA;    output = string.gsub(output, "$t", function() return title end)&#xA;    output = string.gsub(output, "$s", function() return seconds_to_time_string(from, true) end)&#xA;    output = string.gsub(output, "$e", function() return seconds_to_time_string(to, true) end)&#xA;    output = string.gsub(output, "$d", function() return seconds_to_time_string(to-from, true) end)&#xA;    output = string.gsub(output, "$x", function() return extension end)&#xA;    output = string.gsub(output, "$p", function() return profile end)&#xA;    if ON_WINDOWS then&#xA;        output = string.gsub(output, "[/\\|&lt;>?:\"*]", "_")&#xA;    end&#xA;    if not string.find(output, "$n") then&#xA;        return files[output] and nil or output&#xA;    end&#xA;    local i = 1&#xA;    while true do&#xA;        local potential_name = string.gsub(output, "$n", tostring(i))&#xA;        if not files[potential_name] then&#xA;            return potential_name&#xA;        end&#xA;        i = i &#x2B; 1&#xA;    end&#xA;end&#xA;&#xA;function get_video_filters()&#xA;    local filters = {}&#xA;    for _, vf in ipairs(mp.get_property_native("vf")) do&#xA;        local name = vf["name"]&#xA;        name = string.gsub(name, &#x27;^lavfi%-&#x27;, &#x27;&#x27;)&#xA;        local filter&#xA;        if name == "crop" then&#xA;            local p = vf["params"]&#xA;            filter = string.format("crop=%d:%d:%d:%d", p.w, p.h, p.x, p.y)&#xA;        elseif name == "mirror" then&#xA;            filter = "hflip"&#xA;        elseif name == "flip" then&#xA;            filter = "vflip"&#xA;        elseif name == "rotate" then&#xA;            local rotation = vf["params"]["angle"]&#xA;            -- rotate is NOT the filter we want here&#xA;            if rotation == "90" then&#xA;                filter = "transpose=clock"&#xA;            elseif rotation == "180" then&#xA;                filter = "transpose=clock,transpose=clock"&#xA;            elseif rotation == "270" then&#xA;                filter = "transpose=cclock"&#xA;            end&#xA;        end&#xA;        filters[#filters &#x2B; 1] = filter&#xA;    end&#xA;    return filters&#xA;end&#xA;&#xA;function get_input_info(default_path, only_active)&#xA;    local accepted = {&#xA;        video = true,&#xA;        audio = not mp.get_property_bool("mute"),&#xA;        sub = mp.get_property_bool("sub-visibility")&#xA;    }&#xA;    local ret = {}&#xA;    for _, track in ipairs(mp.get_property_native("track-list")) do&#xA;        local track_path = track["external-filename"] or default_path&#xA;        if not only_active or (track["selected"] and accepted[track["type"]]) then&#xA;            local tracks = ret[track_path]&#xA;            if not tracks then&#xA;                ret[track_path] = { track["ff-index"] }&#xA;            else&#xA;                tracks[#tracks &#x2B; 1] = track["ff-index"]&#xA;            end&#xA;        end&#xA;    end&#xA;    return ret&#xA;end&#xA;&#xA;function seconds_to_time_string(seconds, full)&#xA;    local ret = string.format("%02d:%02d.%03d"&#xA;        , math.floor(seconds / 60) % 60&#xA;        , math.floor(seconds) % 60&#xA;        , seconds * 1000 % 1000&#xA;    )&#xA;    if full or seconds > 3600 then&#xA;        ret = string.format("%d:%s", math.floor(seconds / 3600), ret)&#xA;    end&#xA;    return ret&#xA;end&#xA;&#xA;function start_encoding(from, to, settings)&#xA;    local args = {&#xA;        settings.ffmpeg_command,&#xA;        "-loglevel", "panic", "-hide_banner",&#xA;    }&#xA;    local append_args = function(table) args = append_table(args, table) end&#xA;&#xA;    local path = mp.get_property("path")&#xA;    local is_stream = not file_exists(path)&#xA;    if is_stream then&#xA;        path = mp.get_property("stream-path")&#xA;    end&#xA;&#xA;    local track_args = {}&#xA;    local start = seconds_to_time_string(from, false)&#xA;    local input_index = 0&#xA;    for input_path, tracks in pairs(get_input_info(path, settings.only_active_tracks)) do&#xA;       append_args({&#xA;            "-ss", start,&#xA;            "-i", input_path,&#xA;        })&#xA;        if settings.only_active_tracks then&#xA;            for _, track_index in ipairs(tracks) do&#xA;                track_args = append_table(track_args, { "-map", string.format("%d:%d", input_index, track_index)})&#xA;            end&#xA;        else&#xA;            track_args = append_table(track_args, { "-map", tostring(input_index)})&#xA;        end&#xA;        input_index = input_index &#x2B; 1&#xA;    end&#xA;&#xA;    append_args({"-to", tostring(to-from)})&#xA;    append_args(track_args)&#xA;&#xA;    -- apply some of the video filters currently in the chain&#xA;    local filters = {}&#xA;    if settings.preserve_filters then&#xA;        filters = get_video_filters()&#xA;    end&#xA;    if settings.append_filter ~= "" then&#xA;        filters[#filters &#x2B; 1] = settings.append_filter&#xA;    end&#xA;    if #filters > 0 then&#xA;        append_args({ "-filter:v", table.concat(filters, ",") })&#xA;    end&#xA;&#xA;    -- split the user-passed settings on whitespace&#xA;    for token in string.gmatch(settings.codec, "[^%s]&#x2B;") do&#xA;        args[#args &#x2B; 1] = token&#xA;    end&#xA;&#xA;    -- path of the output&#xA;    local output_directory = mp.get_property("options/screenshot-directory")&#xA;    -- local checkbool = exists(output_directory.."/")&#xA;    -- mp.osd_message("" .. type(checkbool), timer_duration)&#xA;    -- if not checkbool then    &#xA;    --     os.execute("mkdir" .. output_directory)&#xA;    -- end&#xA;    if output_directory == "" then&#xA;        if is_stream then&#xA;            output_directory = "."&#xA;        else&#xA;            output_directory, _ = utils.split_path(path)&#xA;        end&#xA;    else&#xA;        output_directory = string.gsub(output_directory, "^~", os.getenv("HOME") or "~")&#xA;    end&#xA;    local input_name = mp.get_property("filename/no-ext") or "encode"&#xA;    local title = mp.get_property("media-title")&#xA;    local extension = get_extension(path)&#xA;    local output_name = get_output_string(output_directory, settings.output_format, input_name, extension, title, from, to, settings.profile)&#xA;    if not output_name then&#xA;        mp.osd_message("Invalid path " .. output_directory)&#xA;        return&#xA;    end&#xA;    args[#args &#x2B; 1] = utils.join_path(output_directory, output_name)&#xA;&#xA;    if settings.print then&#xA;        local o = ""&#xA;        -- fuck this is ugly&#xA;        for i = 1, #args do&#xA;            local fmt = ""&#xA;            if i == 1 then&#xA;                fmt = "%s%s"&#xA;            elseif i >= 2 and i &lt;= 4 then&#xA;                fmt = "%s"&#xA;            elseif args[i-1] == "-i" or i == #args or args[i-1] == "-filter:v" then&#xA;                fmt = "%s &#x27;%s&#x27;"&#xA;            else&#xA;                fmt = "%s %s"&#xA;            end&#xA;            o = string.format(fmt, o, args[i])&#xA;        end&#xA;        print(o)&#xA;    end&#xA;    if settings.detached then&#xA;        utils.subprocess_detached({ args = args })&#xA;    else&#xA;        local res = utils.subprocess({ args = args, max_size = 0, cancellable = false })&#xA;        if res.status == 0 then&#xA;            mp.osd_message("Finished encoding succesfully")&#xA;        else&#xA;            mp.osd_message("Failed to encode, check the log")&#xA;        end&#xA;    end&#xA;end&#xA;&#xA;function clear_timestamp()&#xA;    timer:kill()&#xA;    start_timestamp = nil&#xA;    profile_start = ""&#xA;    mp.remove_key_binding("encode-ESC")&#xA;    mp.remove_key_binding("encode-ENTER")&#xA;    mp.osd_message("", 0)&#xA;end&#xA;&#xA;function set_timestamp(profile)&#xA;    if not mp.get_property("path") then&#xA;        mp.osd_message("No file currently playing")&#xA;        return&#xA;    end&#xA;    if not mp.get_property_bool("seekable") then&#xA;        mp.osd_message("Cannot encode non-seekable media")&#xA;        return&#xA;    end&#xA;    create_dir(mp.get_property("options/screenshot-directory"))&#xA;    if not start_timestamp or profile ~= profile_start then&#xA;        profile_start = profile&#xA;        start_timestamp = mp.get_property_number("time-pos")&#xA;        local msg = function()&#xA;            mp.osd_message(&#xA;                string.format("encode [%s]: waiting for end timestamp", profile or "default"),&#xA;                timer_duration&#xA;            )&#xA;        end&#xA;        msg()&#xA;        timer = mp.add_periodic_timer(timer_duration, msg)&#xA;        mp.add_forced_key_binding("ESC", "encode-ESC", clear_timestamp)&#xA;        mp.add_forced_key_binding("ENTER", "encode-ENTER", function() set_timestamp(profile) end)&#xA;    else&#xA;        local from = start_timestamp&#xA;        local to = mp.get_property_number("time-pos")&#xA;        if to &lt;= from then&#xA;            mp.osd_message("Second timestamp cannot be before the first", timer_duration)&#xA;            timer:kill()&#xA;            timer:resume()&#xA;            return&#xA;        end&#xA;        clear_timestamp()&#xA;        mp.osd_message(string.format("Encoding from %s to %s"&#xA;            , seconds_to_time_string(from, false)&#xA;            , seconds_to_time_string(to, false)&#xA;        ), timer_duration)&#xA;        -- include the current frame into the extract&#xA;        local fps = mp.get_property_number("container-fps") or 30&#xA;        to = to &#x2B; 1 / fps / 2&#xA;        local settings = {&#xA;            detached = false,&#xA;            container = "",&#xA;            only_active_tracks = false,&#xA;            preserve_filters = true,&#xA;            append_filter = "",&#xA;            codec = "-c:v libvpx-vp9 -lossless 1 -b:v 1000k -deadline good",&#xA;            output_format = "$f_$n.webm",&#xA;            output_directory = "",&#xA;            ffmpeg_command = "ffmpeg",&#xA;            print = true,&#xA;        }&#xA;        if profile then&#xA;            options.read_options(settings, profile)&#xA;            if settings.container ~= "" then&#xA;                msg.warn("The &#x27;container&#x27; setting is deprecated, use &#x27;output_format&#x27; now")&#xA;                settings.output_format = settings.output_format .. "." .. settings.container&#xA;            end&#xA;            settings.profile = profile&#xA;        else&#xA;            settings.profile = "default"&#xA;        end        &#xA;        start_encoding(from, to, settings)&#xA;    end&#xA;end&#xA;&#xA;mp.add_key_binding(nil, "set-timestamp", set_timestamp)&#xA;

    &#xA;