Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (81)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (11102)

  • Why does my script return 0 when it fails ? Bash, Whisper, ffmpeg

    30 avril 2024, par d-b

    I have a bash script that executes whisper on all sound files in a directory. Whisper uses ffmpeg to decode sound files to a format it can handle. One of the files in the directory was corrupt and caused ffmpeg to fail. The first time I executed my script it returned 1 when it hit that file but when I try to reproduce the error it always returns 0.

    


    Here is the log from the first run when 1 was returned :

    


    Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 48, in load_audio&#xA;    .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)&#xA;     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/ffmpeg/_run.py", line 325, in run&#xA;    raise Error(&#x27;ffmpeg&#x27;, out, err)&#xA;ffmpeg._run.Error: ffmpeg error (see stderr output for detail)&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/bin/whisper", line 8, in <module>&#xA;    sys.exit(cli())&#xA;             ^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 437, in cli&#xA;    result = transcribe(model, audio_path, temperature=temperature, **args)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 121, in transcribe&#xA;    mel = log_mel_spectrogram(audio, padding=N_SAMPLES)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 130, in log_mel_spectrogram&#xA;    audio = load_audio(audio)&#xA;            ^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 51, in load_audio&#xA;    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e&#xA;RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;/soundfile1.opus: Invalid data found when processing input&#xA;&#xA;&#xA;exit: 1 //this is my own output&#xA;</module>

    &#xA;

    and here is an example of when it returns 0 despite the input file is corrupt :

    &#xA;

    % whisper soundfile1.opus&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 58, in load_audio&#xA;    out = run(cmd, capture_output=True, check=True).stdout&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run&#xA;    raise CalledProcessError(retcode, process.args,&#xA;subprocess.CalledProcessError: Command &#x27;[&#x27;ffmpeg&#x27;, &#x27;-nostdin&#x27;, &#x27;-threads&#x27;, &#x27;0&#x27;, &#x27;-i&#x27;, &#x27;soundfile1.opus&#x27;, &#x27;-f&#x27;, &#x27;s16le&#x27;, &#x27;-ac&#x27;, &#x27;1&#x27;, &#x27;-acodec&#x27;, &#x27;pcm_s16le&#x27;, &#x27;-ar&#x27;, &#x27;16000&#x27;, &#x27;-&#x27;]&#x27; returned non-zero exit status 1.&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 597, in cli&#xA;    result = transcribe(model, audio_path, temperature=temperature, **args)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 133, in transcribe&#xA;    mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 140, in log_mel_spectrogram&#xA;    audio = load_audio(audio)&#xA;            ^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 60, in load_audio&#xA;    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e&#xA;RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;soundfile1.opus: Invalid data found when processing input&#xA;&#xA;Skipping soundfile1.opus due to RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;soundfile1.opus: Invalid data found when processing input&#xA;&#xA;% echo $?&#xA;0&#xA;

    &#xA;

    When I try to reproduce the behaviour I have both tried to execute the script as well as just running the actual line of code from the command prompt. The actual script looks like this :

    &#xA;

    if whisper "$file" >> "${directory}/../${transdir}/${name}.txt"; then&#xA;    whispersuccess=$?&#xA;    echo "exit code $whispersuccess"&#xA;else&#xA;    whispersuccess=$?&#xA;    echo "exit code: $whispersuccess"&#xA;

    &#xA;

    I want it to return ¬0 when something like this happens. How do I achieve this ?

    &#xA;

  • Python : Extracting device and lens information from video metadata

    14 mai 2023, par cat_got_my_tongue

    I am interested in extracting device and lens information from videos. Specifically, make and model of the device and the focal length. I was able to do this successfully for still images using the exifread module and extract a whole bunch of very useful information :

    &#xA;

    image type      : MPO&#xA;Image ImageDescription: Shot with DxO ONE&#xA;Image Make: DxO&#xA;Image Model: DxO ONE&#xA;Image Orientation: Horizontal (normal)&#xA;Image XResolution: 300&#xA;Image YResolution: 300&#xA;Image ResolutionUnit: Pixels/Inch&#xA;Image Software: V3.0.0 (2b448a1aee) APP:1.0&#xA;Image DateTime: 2022:04:05 14:53:45&#xA;Image YCbCrCoefficients: [299/1000, 587/1000, 57/500]&#xA;Image YCbCrPositioning: Centered&#xA;Image ExifOffset: 158&#xA;Thumbnail Compression: JPEG (old-style)&#xA;Thumbnail XResolution: 300&#xA;Thumbnail YResolution: 300&#xA;Thumbnail ResolutionUnit: Pixels/Inch&#xA;Thumbnail JPEGInterchangeFormat: 7156&#xA;Thumbnail JPEGInterchangeFormatLength: 24886&#xA;EXIF ExposureTime: 1/3&#xA;EXIF FNumber: 8&#xA;EXIF ExposureProgram: Aperture Priority&#xA;EXIF ISOSpeedRatings: 100&#xA;EXIF SensitivityType: ISO Speed&#xA;EXIF ISOSpeed: 100&#xA;EXIF ExifVersion: 0221&#xA;EXIF DateTimeOriginal: 2022:04:05 14:53:45&#xA;EXIF DateTimeDigitized: 2022:04:05 14:53:45&#xA;EXIF ComponentsConfiguration: CrCbY&#xA;EXIF CompressedBitsPerPixel: 3249571/608175&#xA;EXIF ExposureBiasValue: 0&#xA;EXIF MaxApertureValue: 212/125&#xA;EXIF SubjectDistance: 39/125&#xA;EXIF MeteringMode: MultiSpot&#xA;EXIF LightSource: Unknown&#xA;EXIF Flash: Flash did not fire&#xA;EXIF FocalLength: 1187/100&#xA;EXIF SubjectArea: [2703, 1802, 675, 450]&#xA;EXIF MakerNote: [68, 88, 79, 32, 79, 78, 69, 0, 12, 0, 0, 0, 21, 0, 3, 0, 5, 0, 2, 0, ... ]&#xA;EXIF SubSecTime: 046&#xA;EXIF SubSecTimeOriginal: 046&#xA;EXIF SubSecTimeDigitized: 046&#xA;EXIF FlashPixVersion: 0100&#xA;EXIF ColorSpace: sRGB&#xA;EXIF ExifImageWidth: 5406&#xA;EXIF ExifImageLength: 3604&#xA;Interoperability InteroperabilityIndex: R98&#xA;Interoperability InteroperabilityVersion: [48, 49, 48, 48]&#xA;EXIF InteroperabilityOffset: 596&#xA;EXIF FileSource: Digital Camera&#xA;EXIF ExposureMode: Auto Exposure&#xA;EXIF WhiteBalance: Auto&#xA;EXIF DigitalZoomRatio: 1&#xA;EXIF FocalLengthIn35mmFilm: 32&#xA;EXIF SceneCaptureType: Standard&#xA;EXIF ImageUniqueID: C01A1709306530020220405185345046&#xA;EXIF BodySerialNumber: C01A1709306530&#xA;

    &#xA;

    Unfortunately, I have been unable to extract this kind of info from videos so far.

    &#xA;

    This is what I have tried so far, with the ffmpeg module :

    &#xA;

    import ffmpeg&#xA;from pprint import pprint&#xA;&#xA;test_video = "my_video.mp4"&#xA;pprint(ffmpeg.probe(test_video)["streams"])&#xA;

    &#xA;

    And the output I get contains a lot of info but nothing related to the device or lens, which is what I am looking for :

    &#xA;

    [{&#x27;avg_frame_rate&#x27;: &#x27;30/1&#x27;,&#xA;  &#x27;bit_rate&#x27;: &#x27;1736871&#x27;,&#xA;  &#x27;bits_per_raw_sample&#x27;: &#x27;8&#x27;,&#xA;  &#x27;chroma_location&#x27;: &#x27;left&#x27;,&#xA;  &#x27;codec_long_name&#x27;: &#x27;H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10&#x27;,&#xA;  &#x27;codec_name&#x27;: &#x27;h264&#x27;,&#xA;  &#x27;codec_tag&#x27;: &#x27;0x31637661&#x27;,&#xA;  &#x27;codec_tag_string&#x27;: &#x27;avc1&#x27;,&#xA;  &#x27;codec_time_base&#x27;: &#x27;1/60&#x27;,&#xA;  &#x27;codec_type&#x27;: &#x27;video&#x27;,&#xA;  &#x27;coded_height&#x27;: 1088,&#xA;  &#x27;coded_width&#x27;: 1920,&#xA;  &#x27;display_aspect_ratio&#x27;: &#x27;16:9&#x27;,&#xA;  &#x27;disposition&#x27;: {&#x27;attached_pic&#x27;: 0,&#xA;                  &#x27;clean_effects&#x27;: 0,&#xA;                  &#x27;comment&#x27;: 0,&#xA;                  &#x27;default&#x27;: 1,&#xA;                  &#x27;dub&#x27;: 0,&#xA;                  &#x27;forced&#x27;: 0,&#xA;                  &#x27;hearing_impaired&#x27;: 0,&#xA;                  &#x27;karaoke&#x27;: 0,&#xA;                  &#x27;lyrics&#x27;: 0,&#xA;                  &#x27;original&#x27;: 0,&#xA;                  &#x27;timed_thumbnails&#x27;: 0,&#xA;                  &#x27;visual_impaired&#x27;: 0},&#xA;  &#x27;duration&#x27;: &#x27;20.800000&#x27;,&#xA;  &#x27;duration_ts&#x27;: 624000,&#xA;  &#x27;has_b_frames&#x27;: 0,&#xA;  &#x27;height&#x27;: 1080,&#xA;  &#x27;index&#x27;: 0,&#xA;  &#x27;is_avc&#x27;: &#x27;true&#x27;,&#xA;  &#x27;level&#x27;: 40,&#xA;  &#x27;nal_length_size&#x27;: &#x27;4&#x27;,&#xA;  &#x27;nb_frames&#x27;: &#x27;624&#x27;,&#xA;  &#x27;pix_fmt&#x27;: &#x27;yuv420p&#x27;,&#xA;  &#x27;profile&#x27;: &#x27;Constrained Baseline&#x27;,&#xA;  &#x27;r_frame_rate&#x27;: &#x27;30/1&#x27;,&#xA;  &#x27;refs&#x27;: 1,&#xA;  &#x27;sample_aspect_ratio&#x27;: &#x27;1:1&#x27;,&#xA;  &#x27;start_pts&#x27;: 0,&#xA;  &#x27;start_time&#x27;: &#x27;0.000000&#x27;,&#xA;  &#x27;tags&#x27;: {&#x27;creation_time&#x27;: &#x27;2021-05-08T13:23:20.000000Z&#x27;,&#xA;           &#x27;encoder&#x27;: &#x27;AVC Coding&#x27;,&#xA;           &#x27;handler_name&#x27;: &#x27;VideoHandler&#x27;,&#xA;           &#x27;language&#x27;: &#x27;und&#x27;},&#xA;  &#x27;time_base&#x27;: &#x27;1/30000&#x27;,&#xA;  &#x27;width&#x27;: 1920},&#xA; {&#x27;avg_frame_rate&#x27;: &#x27;0/0&#x27;,&#xA;  &#x27;bit_rate&#x27;: &#x27;79858&#x27;,&#xA;  &#x27;bits_per_sample&#x27;: 0,&#xA;  &#x27;channel_layout&#x27;: &#x27;stereo&#x27;,&#xA;  &#x27;channels&#x27;: 2,&#xA;  &#x27;codec_long_name&#x27;: &#x27;AAC (Advanced Audio Coding)&#x27;,&#xA;  &#x27;codec_name&#x27;: &#x27;aac&#x27;,&#xA;  &#x27;codec_tag&#x27;: &#x27;0x6134706d&#x27;,&#xA;  &#x27;codec_tag_string&#x27;: &#x27;mp4a&#x27;,&#xA;  &#x27;codec_time_base&#x27;: &#x27;1/48000&#x27;,&#xA;  &#x27;codec_type&#x27;: &#x27;audio&#x27;,&#xA;  &#x27;disposition&#x27;: {&#x27;attached_pic&#x27;: 0,&#xA;                  &#x27;clean_effects&#x27;: 0,&#xA;                  &#x27;comment&#x27;: 0,&#xA;                  &#x27;default&#x27;: 1,&#xA;                  &#x27;dub&#x27;: 0,&#xA;                  &#x27;forced&#x27;: 0,&#xA;                  &#x27;hearing_impaired&#x27;: 0,&#xA;                  &#x27;karaoke&#x27;: 0,&#xA;                  &#x27;lyrics&#x27;: 0,&#xA;                  &#x27;original&#x27;: 0,&#xA;                  &#x27;timed_thumbnails&#x27;: 0,&#xA;                  &#x27;visual_impaired&#x27;: 0},&#xA;  &#x27;duration&#x27;: &#x27;20.864000&#x27;,&#xA;  &#x27;duration_ts&#x27;: 1001472,&#xA;  &#x27;index&#x27;: 1,&#xA;  &#x27;max_bit_rate&#x27;: &#x27;128000&#x27;,&#xA;  &#x27;nb_frames&#x27;: &#x27;978&#x27;,&#xA;  &#x27;profile&#x27;: &#x27;LC&#x27;,&#xA;  &#x27;r_frame_rate&#x27;: &#x27;0/0&#x27;,&#xA;  &#x27;sample_fmt&#x27;: &#x27;fltp&#x27;,&#xA;  &#x27;sample_rate&#x27;: &#x27;48000&#x27;,&#xA;  &#x27;start_pts&#x27;: 0,&#xA;  &#x27;start_time&#x27;: &#x27;0.000000&#x27;,&#xA;  &#x27;tags&#x27;: {&#x27;creation_time&#x27;: &#x27;2021-05-08T13:23:20.000000Z&#x27;,&#xA;           &#x27;handler_name&#x27;: &#x27;SoundHandler&#x27;,&#xA;           &#x27;language&#x27;: &#x27;und&#x27;},&#xA;  &#x27;time_base&#x27;: &#x27;1/48000&#x27;}]&#xA;

    &#xA;

    Are these pieces of info available for videos ? Should I be using a different package ?

    &#xA;

    Thanks.

    &#xA;

    Edit :

    &#xA;

    pprint(ffmpeg.probe(test_video)["format"]) gives

    &#xA;

    {&#x27;bit_rate&#x27;: &#x27;1815244&#x27;,&#xA; &#x27;duration&#x27;: &#x27;20.864000&#x27;,&#xA; &#x27;filename&#x27;: &#x27;my_video.mp4&#x27;,&#xA; &#x27;format_long_name&#x27;: &#x27;QuickTime / MOV&#x27;,&#xA; &#x27;format_name&#x27;: &#x27;mov,mp4,m4a,3gp,3g2,mj2&#x27;,&#xA; &#x27;nb_programs&#x27;: 0,&#xA; &#x27;nb_streams&#x27;: 2,&#xA; &#x27;probe_score&#x27;: 100,&#xA; &#x27;size&#x27;: &#x27;4734158&#x27;,&#xA; &#x27;start_time&#x27;: &#x27;0.000000&#x27;,&#xA; &#x27;tags&#x27;: {&#x27;artist&#x27;: &#x27;Microsoft Game DVR&#x27;,&#xA;          &#x27;compatible_brands&#x27;: &#x27;mp41isom&#x27;,&#xA;          &#x27;creation_time&#x27;: &#x27;2021-05-08T12:12:33.000000Z&#x27;,&#xA;          &#x27;major_brand&#x27;: &#x27;mp42&#x27;,&#xA;          &#x27;minor_version&#x27;: &#x27;0&#x27;,&#xA;          &#x27;title&#x27;: &#x27;Snipping Tool&#x27;}}&#xA;

    &#xA;

  • FFMPEG with Gradle Experimental Android plugin

    12 avril 2016, par Spartan

    I extracted ffmpeg in ndk’s source folder then compiled it there only for that I followed this :http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/

    So I successfully(generated android folder with arm/lib and arm/include files).

    After that I created one Android.mk file in $NDK/sources/ffmpeg/android/arm and one Android.mk in my android project(src/main/jni folder).

    My src/main/jni/Android.mk is like this :

    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE    := tutorial01
    LOCAL_SRC_FILES := tutorial01.c
    LOCAL_LDLIBS := -llog -ljnigraphics -lz
    LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil

    include $(BUILD_SHARED_LIBRARY)
    $(call import-module,ffmpeg-3.0.1/android/arm)

    Now I stuck here and trying to put these details in build.gradle files like showing in this documentation :
    http://tools.android.com/tech-docs/new-build-system/gradle-experimental

    for example :

    model {

       repositories {

           libs(PrebuiltLibraries) {

               prebuilt {

                   headers.srcDir "path/to/headers"

                   binaries.withType(SharedLibraryBinary) {

                       sharedLibraryFile = file("lib/${targetPlatform.getName()}/prebuilt.so")

                   }

               }

           }

       }

       android.sources {
           main {
               jniLibs {
                   dependencies {
                       library "prebuilt"
                   }
               }
           }
       }
    }

    But not able transform exact Android.mk(src/main/jni) to this and apart from it I have one more Android.mk in my android/arm folder so how I can call this makefile or should I put that details also in my build.gradle like above.

    I tried like this and using ndk-build command successfully generated jniLibs with .so files but I am getting libavcodec/avcodec.h : No such file or directory while building project.

    android.sources {
       main {
           jni {
               source {
                   srcDirs = ['src/main/myJni']
               }

           }

       }

       main {
           jniLibs {
               source {
                   srcDirs = ['src/main/libs']
               }
           }
       }

    }