Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    哪吒D1使用gstreamer硬解码 (转)

    MR Series
    1
    2
    2736
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dreamer LV 4 last edited by

      D1的tina系统支持了libcedar的openmax接口 使得gstreamer可以用gst-omx插件调用libcedar进行视频硬解码
      再加上tina支持了gst-aw插件 提供了gst的一个元件sunxifbsink 就是一个可以进行硬件转换YV12->RGB的硬件图层插件 即DE的应用
      这样一来 D1使用gst进行播放视频 效果会非常流畅

      演示环境搭建
      用PhoenixSuit.exe烧录flash镜像
      附件提供了flash镜像

      把视频文件用adb发送到D1 附件中提供了测试视频文件

      adb push D:\bad_apple.mp4 /root/
      

      使用playbin元件自动寻找元件播放音视频

      gst-launch-1.0 playbin uri=file:///root/bad_apple.mp4
      

      因为加了一些同类的元件 为了调试方便 再写几条用来测试的命令
      使用decodebin元件自动寻找解码器 指定fb元件播放视频

      gst-launch-1.0 filesrc location=bad_apple.mp4 ! qtdemux ! decodebin ! sunxifbsink
      

      指定硬解码器 指定fb元件播放视频

      gst-launch-1.0 filesrc location=bad_apple.mp4 ! qtdemux ! h264parse ! omxh264dec ! sunxifbsink
      

      指定元件播放音视频

      gst-launch-1.0 filesrc location=bad_apple.mp4 ! qtdemux name=demux demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! alsasink demux.video_0 ! queue ! h264parse ! omxh264dec ! sunxifbsink
      

      演示效果

      配置流程
      首先 SDK版本为tina1.01要打上0730补丁 要配置HDMI作为fb输出

      SDK配置

      make menuconfig
      -- libcedarx
      Select cedarx configuration options --->
      (拉到最后)
      {
      } Add for openmax support

      Multimedia --->

      <> gst-omx
      -
      - gstreamer1-libs
      Select GStreamer libraries --->
      { }Include all GStreamer1 core libraries
      *** Libraries ***
      -- GStreamer core library libgstreamer1
      -
      - GStreamer core library libgst1check
      -- GStreamer core library libgst1controller
      -
      - GStreamer core library libgst1net

      <*> gst1-libav(这个不是用来软解视频的 而是用来软解音频)

      <> gstreamer1-plugins-aw
      Select GStreamer aw modules --->
      { } Include all GStreamer aw plugins
      *** Modules ***
      <
      > GStreamer fbdev2sink module
      <> GStreamer sunxifbsink module
      {
      } sunxi g2d rotation support
      *** Libraries ***
      -*- GStreamer framebuffersink library

      <> gstreamer1-plugins-bad
      Select GStreamer bad modules and libraries --->
      <
      > GStreamer fbdevsink module
      <> GStreamer id3tag module(MP3的id3信息封装)
      <
      > GStreamer videoparsersbad module
      -*- GStreamer codecparsers library

      -- gstreamer1-plugins-base
      Select GStreamer base modules and libraries --->
      -
      - GStreamer alsa module
      <> GStreamer audioconvert module
      <
      > GStreamer audiorate module
      <> GStreamer audioresample module
      <
      > GStreamer audiotestsrc module
      <> GStreamer playback module (playbin元件 自动寻找连接元件)
      <
      > GStreamer typefindfunctions module (这个是给playbin自动寻找解封装元件 之前不知道 导致playbin播不了)

      <> GStreamer videoconvert module
      <
      > GStreamer videorate module
      <> GStreamer videoscale module
      <
      > GStreamer videotestsrc module
      -- GStreamer allocators library
      -
      - GStreamer app library
      -- GStreamer audio library
      -
      - GStreamer pbutils library
      -- GStreamer riff library
      -
      - GStreamer rtp library
      -- GStreamer tag library
      -
      - GStreamer video library

      <> gstreamer1-plugins-good
      Select GStreamer good modules --->
      <
      > GStreamer audioparsers module
      <> GStreamer flv module
      <
      > GStreamer id3demux module(MP3的id3信息解封装)
      <> GStreamer matroska module(mkv文件解封装)
      <
      > GStreamer isomp4 module(mp4文件解封装)
      <*> GStreamer soup module

      <*> gstreamer1-utils

      附件提供SDK配置的config文件 方便出问题排查
      配置完成后编译打包就可以了 如果编译报错 主要检查补丁有没生效

      文件下载: 哪吒D1使用gstreamer硬解码附件.zip

      转载地址: https://whycan.com/t_7078.html
      原作者: @逸俊晨晖

      1 Reply Last reply Reply Quote Share 1
      • D
        dreamer LV 4 last edited by

        1 Reply Last reply Reply Quote Share 0
        • Referenced by  E eddardzhu 
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策