Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (69)

  • 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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (12952)

  • FFMpeg C++ encoder fails with hardware acceleration quick sync intel

    28 août 2022, par teals

    I am trying to debug an issue I have with a simple C++ encoder using FFMmpeg. The following code below works correctly on these other hardware acceleration systems/platforms :

    


      

    • Mac/VideoToolbox,
    • 


    • Cuda/NVEnc
    • 


    • Raspberry pi/h264_v4l2m2m.
    • 


    


    It fails on intel quick sync at avcodec_open2. I'm using Ubuntu 22.04. I built FFMpeg from source with the Intel Media SDK installed and configured. I verified that the QuickSync install works. I also have a corresponding decoder implementation that works correctly using intel quick sync. So I know everything properly installed. I am also running this on an 11th Gen Intel CPU.

    


    [hevc_qsv @ 0x564b0d34f0c0] Low power mode is unsupported (This sometimes shows up)
[hevc_qsv @ 0x563691234000] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height


    


    This is the only error that I get and I haven't found any helpful resources. I tried playing around with different parameters but nothing seems to work. Any help or insight would be extremely helpful.

    


    bool VideoEncoder::create() {&#xA;    char const* outfile = filePath.c_str();&#xA;&#xA;     // open output format context&#xA;    int ret = avformat_alloc_output_context2(&amp;ofctx, nullptr, nullptr, outfile);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avformat_alloc_output_context2(" &lt;&lt; outfile &lt;&lt; "): ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // create new video stream&#xA;    const AVCodec* codec = avcodec_find_encoder_by_name(encoderName.c_str());&#xA;    vstrm = avformat_new_stream(ofctx, codec);&#xA;    if (!vstrm) {&#xA;        std::cerr &lt;&lt; "fail to avformat_new_stream";&#xA;        return false;&#xA;    }&#xA;&#xA;    // open video encoder&#xA;    cctx = avcodec_alloc_context3(codec);&#xA;    if (!vstrm) {&#xA;        std::cerr &lt;&lt; "fail to avcodec_alloc_context3";&#xA;        return false;&#xA;    }&#xA;    const AVRational dst_fps = {fps, 1};&#xA;    cctx->width = width;&#xA;    cctx->height = height;&#xA;    if(pixel_format != AV_PIX_FMT_NONE) {&#xA;        cctx->pix_fmt = pixel_format;&#xA;    }&#xA;    else {&#xA;        cctx->pix_fmt = codec->pix_fmts[0];&#xA;    }&#xA;    cctx->time_base = av_inv_q(dst_fps);&#xA;    cctx->framerate = dst_fps;&#xA;    cctx->bit_rate = bitrate * 1000000;&#xA;&#xA;&#xA;    AVDictionary* options = nullptr;&#xA;    if(gpu_id >= 0) {&#xA;        av_dict_set_int(&amp;options, "gpu", gpu_id, 0);&#xA;    }&#xA;&#xA;    &#xA;    if (ofctx->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;        cctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;    ret = avcodec_open2(cctx, codec, &amp;options);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avcodec_open2: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;    avcodec_parameters_from_context(vstrm->codecpar, cctx);&#xA;&#xA;    //For mac/quicktime we need to add hvc1 tag.&#xA;    if (encoderName.find("hevc") != std::string::npos) {&#xA;        vstrm->codecpar->codec_tag = MKTAG(&#x27;h&#x27;, &#x27;v&#x27;, &#x27;c&#x27;, &#x27;1&#x27;);&#xA;    }&#xA;&#xA;    /*&#xA;    std::cout&#xA;        &lt;&lt; "outfile: " &lt;&lt; outfile &lt;&lt; "\n"&#xA;        &lt;&lt; "format:  " &lt;&lt; ofctx->oformat->name &lt;&lt; "\n"&#xA;        &lt;&lt; "vcodec:  " &lt;&lt; codec->name &lt;&lt; "\n"&#xA;        &lt;&lt; "size:    " &lt;&lt; width &lt;&lt; &#x27;x&#x27; &lt;&lt; height &lt;&lt; "\n"&#xA;        &lt;&lt; "fps:     " &lt;&lt; av_q2d(cctx->framerate) &lt;&lt; "\n"&#xA;        &lt;&lt; "pixfmt:  " &lt;&lt; av_get_pix_fmt_name(cctx->pix_fmt) &lt;&lt; "\n"&#xA;        &lt;&lt; std::flush;*/&#xA;&#xA;    // initialize sample scaler&#xA;    swsCtx = sws_getContext(&#xA;        width, height, AV_PIX_FMT_BGR24,&#xA;        width, height, cctx->pix_fmt,&#xA;        SWS_BILINEAR, nullptr, nullptr, nullptr);&#xA;    if (!swsCtx) {&#xA;        std::cerr &lt;&lt; "fail to sws_getContext";&#xA;        return false;&#xA;    }&#xA;&#xA;    // allocate frame buffer for encoding&#xA;    frame = av_frame_alloc();&#xA;    frame->width = width;&#xA;    frame->height = height;&#xA;    frame->format = static_cast<int>(cctx->pix_fmt);&#xA;    ret = av_frame_get_buffer(frame, 32);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to av_frame_get_buffer: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // allocate packet to retrive encoded frame&#xA;    pkt = av_packet_alloc();&#xA;    // open output IO context&#xA;    ret = avio_open2(&amp;ofctx->pb, outfile, AVIO_FLAG_WRITE, nullptr, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avio_open2: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // write media container header (if any)&#xA;    ret = avformat_write_header(ofctx, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avformat_write_header: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;</int>

    &#xA;

  • Concatenate chunk containg headers to another chunk in h264

    18 novembre 2014, par Ortixx

    I’m trying to extract thumbnails from a torrent stream by downloading the first couple of chunks to get the headers, another set of chunks from the middle and then concat them to have a single video file.

    For this I’m using nodejs but I’m having trouble with the concatenation part. Obviously the headers include the length of the video so if I simply concat another chunk to the end of the headers chunk, it won’t work.

    In other words, I have 2 chunks of a video file : The first one contains the headers and some material and the other one is fully composed of a video stream. I want to combine the two to form a single video file
    So my question is how can I make this work properly if at all ?

  • exo player mp2, aac audio format and avi video format [closed]

    27 mai 2020, par Muhammet
    &#xD;&#xA;
    &#xD;&#xA;
    /*&#xD;&#xA; * Copyright (C) 2016 The Android Open Source Project&#xD;&#xA; *&#xD;&#xA; * Licensed under the Apache License, Version 2.0 (the "License");&#xD;&#xA; * you may not use this file except in compliance with the License.&#xD;&#xA; * You may obtain a copy of the License at&#xD;&#xA; *&#xD;&#xA; *      http://www.apache.org/licenses/LICENSE-2.0&#xD;&#xA; *&#xD;&#xA; * Unless required by applicable law or agreed to in writing, software&#xD;&#xA; * distributed under the License is distributed on an "AS IS" BASIS,&#xD;&#xA; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#xD;&#xA; * See the License for the specific language governing permissions and&#xD;&#xA; * limitations under the License.&#xD;&#xA; */&#xD;&#xA;package com.google.android.exoplayer2.ext.ffmpeg;&#xD;&#xA;&#xD;&#xA;import android.os.Handler;&#xD;&#xA;import androidx.annotation.Nullable;&#xD;&#xA;import com.google.android.exoplayer2.C;&#xD;&#xA;import com.google.android.exoplayer2.ExoPlaybackException;&#xD;&#xA;import com.google.android.exoplayer2.Format;&#xD;&#xA;import com.google.android.exoplayer2.audio.AudioProcessor;&#xD;&#xA;import com.google.android.exoplayer2.audio.AudioRendererEventListener;&#xD;&#xA;import com.google.android.exoplayer2.audio.AudioSink;&#xD;&#xA;import com.google.android.exoplayer2.audio.DefaultAudioSink;&#xD;&#xA;import com.google.android.exoplayer2.audio.SimpleDecoderAudioRenderer;&#xD;&#xA;import com.google.android.exoplayer2.drm.DrmSessionManager;&#xD;&#xA;import com.google.android.exoplayer2.drm.ExoMediaCrypto;&#xD;&#xA;import com.google.android.exoplayer2.util.Assertions;&#xD;&#xA;import com.google.android.exoplayer2.util.MimeTypes;&#xD;&#xA;import java.util.Collections;&#xD;&#xA;import org.checkerframework.checker.nullness.qual.MonotonicNonNull;&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * Decodes and renders audio using FFmpeg.&#xD;&#xA; */&#xD;&#xA;public final class FfmpegAudioRenderer extends SimpleDecoderAudioRenderer {&#xD;&#xA;&#xD;&#xA;  /** The number of input and output buffers. */&#xD;&#xA;  private static final int NUM_BUFFERS = 16;&#xD;&#xA;  /** The default input buffer size. */&#xD;&#xA;  private static final int DEFAULT_INPUT_BUFFER_SIZE = 960 * 6;&#xD;&#xA;&#xD;&#xA;  private final boolean enableFloatOutput;&#xD;&#xA;&#xD;&#xA;  private @MonotonicNonNull FfmpegDecoder decoder;&#xD;&#xA;&#xD;&#xA;  public FfmpegAudioRenderer() {&#xD;&#xA;    this(/* eventHandler= */ null, /* eventListener= */ null);&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  /**&#xD;&#xA;   * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be&#xD;&#xA;   *     null if delivery of events is not required.&#xD;&#xA;   * @param eventListener A listener of events. May be null if delivery of events is not required.&#xD;&#xA;   * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.&#xD;&#xA;   */&#xD;&#xA;  public FfmpegAudioRenderer(&#xD;&#xA;          @Nullable Handler eventHandler,&#xD;&#xA;          @Nullable AudioRendererEventListener eventListener,&#xD;&#xA;          AudioProcessor... audioProcessors) {&#xD;&#xA;    this(&#xD;&#xA;            eventHandler,&#xD;&#xA;            eventListener,&#xD;&#xA;            new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),&#xD;&#xA;            /* enableFloatOutput= */ false);&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  /**&#xD;&#xA;   * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be&#xD;&#xA;   *     null if delivery of events is not required.&#xD;&#xA;   * @param eventListener A listener of events. May be null if delivery of events is not required.&#xD;&#xA;   * @param audioSink The sink to which audio will be output.&#xD;&#xA;   * @param enableFloatOutput Whether to enable 32-bit float audio format, if supported on the&#xD;&#xA;   *     device/build and if the input format may have bit depth higher than 16-bit. When using&#xD;&#xA;   *     32-bit float output, any audio processing will be disabled, including playback speed/pitch&#xD;&#xA;   *     adjustment.&#xD;&#xA;   */&#xD;&#xA;  public FfmpegAudioRenderer(&#xD;&#xA;          @Nullable Handler eventHandler,&#xD;&#xA;          @Nullable AudioRendererEventListener eventListener,&#xD;&#xA;          AudioSink audioSink,&#xD;&#xA;          boolean enableFloatOutput) {&#xD;&#xA;    super(&#xD;&#xA;            eventHandler,&#xD;&#xA;            eventListener,&#xD;&#xA;            /* drmSessionManager= */ null,&#xD;&#xA;            /* playClearSamplesWithoutKeys= */ false,&#xD;&#xA;            audioSink);&#xD;&#xA;    this.enableFloatOutput = enableFloatOutput;&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  @Override&#xD;&#xA;  @FormatSupport&#xD;&#xA;  protected int supportsFormatInternal(&#xD;&#xA;          @Nullable DrmSessionManager<exomediacrypto> drmSessionManager, Format format) {&#xD;&#xA;    Assertions.checkNotNull(format.sampleMimeType);&#xD;&#xA;    if (!FfmpegLibrary.isAvailable()) {&#xD;&#xA;      return FORMAT_UNSUPPORTED_TYPE;&#xD;&#xA;    } else if (!FfmpegLibrary.supportsFormat(format.sampleMimeType) || !isOutputSupported(format)) {&#xD;&#xA;      return FORMAT_UNSUPPORTED_SUBTYPE;&#xD;&#xA;    } else if (!supportsFormatDrm(drmSessionManager, format.drmInitData)) {&#xD;&#xA;      return FORMAT_UNSUPPORTED_DRM;&#xD;&#xA;    } else {&#xD;&#xA;      return FORMAT_HANDLED;&#xD;&#xA;    }&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  @Override&#xD;&#xA;  @AdaptiveSupport&#xD;&#xA;  public final int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {&#xD;&#xA;    return ADAPTIVE_NOT_SEAMLESS;&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  @Override&#xD;&#xA;  protected FfmpegDecoder createDecoder(Format format, @Nullable ExoMediaCrypto mediaCrypto)&#xD;&#xA;          throws FfmpegDecoderException {&#xD;&#xA;    int initialInputBufferSize =&#xD;&#xA;            format.maxInputSize != Format.NO_VALUE ? format.maxInputSize : DEFAULT_INPUT_BUFFER_SIZE;&#xD;&#xA;    decoder =&#xD;&#xA;            new FfmpegDecoder(&#xD;&#xA;                    NUM_BUFFERS, NUM_BUFFERS, initialInputBufferSize, format, shouldUseFloatOutput(format));&#xD;&#xA;    return decoder;&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  @Override&#xD;&#xA;  public Format getOutputFormat() {&#xD;&#xA;    Assertions.checkNotNull(decoder);&#xD;&#xA;    int channelCount = decoder.getChannelCount();&#xD;&#xA;    int sampleRate = decoder.getSampleRate();&#xD;&#xA;    @C.PcmEncoding int encoding = decoder.getEncoding();&#xD;&#xA;    return Format.createAudioSampleFormat(&#xD;&#xA;            /* id= */ null,&#xD;&#xA;            MimeTypes.AUDIO_RAW,&#xD;&#xA;            /* codecs= */ null,&#xD;&#xA;            Format.NO_VALUE,&#xD;&#xA;            Format.NO_VALUE,&#xD;&#xA;            channelCount,&#xD;&#xA;            sampleRate,&#xD;&#xA;            encoding,&#xD;&#xA;            Collections.emptyList(),&#xD;&#xA;            /* drmInitData= */ null,&#xD;&#xA;            /* selectionFlags= */ 0,&#xD;&#xA;            /* language= */ null);&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  private boolean isOutputSupported(Format inputFormat) {&#xD;&#xA;    return shouldUseFloatOutput(inputFormat)&#xD;&#xA;            || supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_16BIT);&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  private boolean shouldUseFloatOutput(Format inputFormat) {&#xD;&#xA;    Assertions.checkNotNull(inputFormat.sampleMimeType);&#xD;&#xA;    if (!enableFloatOutput || !supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_FLOAT)) {&#xD;&#xA;      return false;&#xD;&#xA;    }&#xD;&#xA;    switch (inputFormat.sampleMimeType) {&#xD;&#xA;      case MimeTypes.AUDIO_RAW:&#xD;&#xA;        // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit.&#xD;&#xA;        return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT&#xD;&#xA;                || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT&#xD;&#xA;                || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT;&#xD;&#xA;      case MimeTypes.AUDIO_AC3:&#xD;&#xA;        // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding.&#xD;&#xA;        return false;&#xD;&#xA;      default:&#xD;&#xA;        // For all other formats, assume that it&#x27;s worth using 32-bit float encoding.&#xD;&#xA;        return true;&#xD;&#xA;    }&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;}</exomediacrypto>

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

    I use exoplayer but no sound from mp2 and aac audio formats in android application.

    &#xA;&#xA;

    I get this error when I open mp2 and aac audio format videos "media includes audio tracks but none

    &#xA;&#xA;

    are playable by this device"and some are not working in .avi format, some are working please can you help me

    &#xA;&#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    /*&#xD;&#xA; * Copyright (C) 2016 The Android Open Source Project&#xD;&#xA; *&#xD;&#xA; * Licensed under the Apache License, Version 2.0 (the "License");&#xD;&#xA; * you may not use this file except in compliance with the License.&#xD;&#xA; * You may obtain a copy of the License at&#xD;&#xA; *&#xD;&#xA; *      http://www.apache.org/licenses/LICENSE-2.0&#xD;&#xA; *&#xD;&#xA; * Unless required by applicable law or agreed to in writing, software&#xD;&#xA; * distributed under the License is distributed on an "AS IS" BASIS,&#xD;&#xA; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#xD;&#xA; * See the License for the specific language governing permissions and&#xD;&#xA; * limitations under the License.&#xD;&#xA; */&#xD;&#xA;package com.google.android.exoplayer2.ext.ffmpeg;&#xD;&#xA;&#xD;&#xA;import androidx.annotation.Nullable;&#xD;&#xA;import com.google.android.exoplayer2.ExoPlayerLibraryInfo;&#xD;&#xA;import com.google.android.exoplayer2.util.LibraryLoader;&#xD;&#xA;import com.google.android.exoplayer2.util.Log;&#xD;&#xA;import com.google.android.exoplayer2.util.MimeTypes;&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * Configures and queries the underlying native library.&#xD;&#xA; */&#xD;&#xA;public final class FfmpegLibrary {&#xD;&#xA;&#xD;&#xA;  static {&#xD;&#xA;    ExoPlayerLibraryInfo.registerModule("goog.exo.ffmpeg");&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  private static final String TAG = "FfmpegLibrary";&#xD;&#xA;&#xD;&#xA;  private static final LibraryLoader LOADER =&#xD;&#xA;          new LibraryLoader("avutil", "swresample", "avcodec", "ffmpeg");&#xD;&#xA;&#xD;&#xA;  private FfmpegLibrary() {}&#xD;&#xA;&#xD;&#xA;  /**&#xD;&#xA;   * Override the names of the FFmpeg native libraries. If an application wishes to call this&#xD;&#xA;   * method, it must do so before calling any other method defined by this class, and before&#xD;&#xA;   * instantiating a {@link FfmpegAudioRenderer} instance.&#xD;&#xA;   *&#xD;&#xA;   * @param libraries The names of the FFmpeg native libraries.&#xD;&#xA;   */&#xD;&#xA;  public static void setLibraries(String... libraries) {&#xD;&#xA;    LOADER.setLibraries(libraries);&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  /**&#xD;&#xA;   * Returns whether the underlying library is available, loading it if necessary.&#xD;&#xA;   */&#xD;&#xA;  public static boolean isAvailable() {&#xD;&#xA;    return LOADER.isAvailable();&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  /** Returns the version of the underlying library if available, or null otherwise. */&#xD;&#xA;  public static @Nullable String getVersion() {&#xD;&#xA;    return isAvailable() ? ffmpegGetVersion() : null;&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  /**&#xD;&#xA;   * Returns whether the underlying library supports the specified MIME type.&#xD;&#xA;   *&#xD;&#xA;   * @param mimeType The MIME type to check.&#xD;&#xA;   */&#xD;&#xA;  public static boolean supportsFormat(String mimeType) {&#xD;&#xA;    if (!isAvailable()) {&#xD;&#xA;      return false;&#xD;&#xA;    }&#xD;&#xA;    String codecName = getCodecName(mimeType);&#xD;&#xA;    if (codecName == null) {&#xD;&#xA;      return false;&#xD;&#xA;    }&#xD;&#xA;    if (!ffmpegHasDecoder(codecName)) {&#xD;&#xA;      Log.w(TAG, "No " &#x2B; codecName &#x2B; " decoder available. Check the FFmpeg build configuration.");&#xD;&#xA;      return false;&#xD;&#xA;    }&#xD;&#xA;    return true;&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  /**&#xD;&#xA;   * Returns the name of the FFmpeg decoder that could be used to decode the format, or {@code null}&#xD;&#xA;   * if it&#x27;s unsupported.&#xD;&#xA;   */&#xD;&#xA;  /* package */ static @Nullable String getCodecName(String mimeType) {&#xD;&#xA;    switch (mimeType) {&#xD;&#xA;      case MimeTypes.AUDIO_AAC:&#xD;&#xA;        return "aac";&#xD;&#xA;      case MimeTypes.AUDIO_MPEG:&#xD;&#xA;      case MimeTypes.AUDIO_MPEG_L1:&#xD;&#xA;      case MimeTypes.AUDIO_MPEG_L2:&#xD;&#xA;        return "mp3";&#xD;&#xA;      case MimeTypes.AUDIO_AC3:&#xD;&#xA;        return "ac3";&#xD;&#xA;      case MimeTypes.AUDIO_E_AC3:&#xD;&#xA;      case MimeTypes.AUDIO_E_AC3_JOC:&#xD;&#xA;        return "eac3";&#xD;&#xA;      case MimeTypes.AUDIO_TRUEHD:&#xD;&#xA;        return "truehd";&#xD;&#xA;      case MimeTypes.AUDIO_DTS:&#xD;&#xA;      case MimeTypes.AUDIO_DTS_HD:&#xD;&#xA;        return "dca";&#xD;&#xA;      case MimeTypes.AUDIO_VORBIS:&#xD;&#xA;        return "vorbis";&#xD;&#xA;      case MimeTypes.AUDIO_OPUS:&#xD;&#xA;        return "opus";&#xD;&#xA;      case MimeTypes.AUDIO_AMR_NB:&#xD;&#xA;        return "amrnb";&#xD;&#xA;      case MimeTypes.AUDIO_AMR_WB:&#xD;&#xA;        return "amrwb";&#xD;&#xA;      case MimeTypes.AUDIO_FLAC:&#xD;&#xA;        return "flac";&#xD;&#xA;      case MimeTypes.AUDIO_ALAC:&#xD;&#xA;        return "alac";&#xD;&#xA;      case MimeTypes.AUDIO_MLAW:&#xD;&#xA;        return "pcm_mulaw";&#xD;&#xA;      case MimeTypes.AUDIO_ALAW:&#xD;&#xA;        return "pcm_alaw";&#xD;&#xA;      default:&#xD;&#xA;        return null;&#xD;&#xA;    }&#xD;&#xA;  }&#xD;&#xA;&#xD;&#xA;  private static native String ffmpegGetVersion();&#xD;&#xA;  private static native boolean ffmpegHasDecoder(String codecName);&#xD;&#xA;&#xD;&#xA;}

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

    [enter image description here][1]&#xA;[enter image description here][2]

    &#xA;