<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>2017/01/18 on Yano&#39;s digital garage</title>
    <link>https://www.bravotouring.com/~yano/archives/2017/01/18/</link>
    <description>Recent content in 2017/01/18 on Yano&#39;s digital garage</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 18 Jan 2017 23:46:45 +0900</lastBuildDate>
    <atom:link href="https://www.bravotouring.com/~yano/archives/2017/01/18/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>GstreamerとVAAPI</title>
      <link>https://www.bravotouring.com/~yano/diary/it/20170118_gstreamer.htm</link>
      <pubDate>Wed, 18 Jan 2017 23:46:45 +0900</pubDate>
      <guid>https://www.bravotouring.com/~yano/diary/it/20170118_gstreamer.htm</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.bravotouring.com/~yano/diary/it/20170112_vaapi.htm&#34;&gt;宿題&lt;/a&gt;を残したQSVハードウェアエンコード環境。&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.gearsongallium.com/?p=3135&#34;&gt;Intel VAAPI h264 encoding: gstreamer vs ffmpeg\avconv&lt;/a&gt;などによるとVAAPI対応の選択肢としてGStreamerもあるようなので、試してみた。&#xA;&lt;blockquote class=&#34;Log&#34;&gt;&#xA;yano@haswell:~/gst-test$ sudo apt-get install gstreamer1.0-vaapi*&lt;br/&gt;&#xA;yano@haswell:~/gst-test$ gst-inspect-1.0 vaapi&lt;br/&gt;&#xA;Plugin Details:&lt;br/&gt;&#xA;  Name                     vaapi&lt;br/&gt;&#xA;  Description              VA-API based elements&lt;br/&gt;&#xA;  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so&lt;br/&gt;&#xA;  Version                  0.5.7&lt;br/&gt;&#xA;  License                  LGPL&lt;br/&gt;&#xA;  Source module            gstreamer-vaapi&lt;br/&gt;&#xA;  Binary package           gstreamer-vaapi&lt;br/&gt;&#xA;  Origin URL               gwenole.beauchesne@intel.com&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;  vaapidecode: VA-API decoder&lt;br/&gt;&#xA;  vaapipostproc: VA-API video postprocessing&lt;br/&gt;&#xA;  vaapisink: VA-API sink&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;  3 features:&lt;br/&gt;&#xA;  +-- 3 elements&lt;br/&gt;&lt;br/&gt;&#xA;yano@haswell:~/gst-test$&#xA;&lt;/blockquote&gt;&#xA;との事。&lt;a href=&#34;https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-vaapi-plugins/html/&#34;&gt;GStreamer VA-API Plugins 1.0 Plugins Reference Manual&lt;/a&gt;を見る限り「VA-API based H.264 video encoder」がありそうなのだが、どうやらubuntu 14.04の公式パッケージはデコーダ未対応の旧版な雰囲気だ。&lt;/p&gt;&#xA;&lt;p&gt;というわけで、必然的に最新版をソースコードからbuildする方向にハンドルを切るわけだが、その前にGstreamerの独特な作法に馴染むべく、取り敢えずx264で試行錯誤してmp4のファイル出力にトライ。&#xA;&lt;blockquote class=&#34;Log&#34;&gt;&#xA;yano@haswell:~/gst-test$ ffmpeg -i ~/20161210_2313_28_GRhd.ts -map 0:0 -map 0:1 \&lt;br/&gt;  -vcodec copy -acodec copy ./input.ts&lt;br/&gt;&#xA;yano@haswell:~/gst-test$ gst-launch-1.0 \&lt;br/&gt;&#xA;  filesrc location=./input.ts ! progressreport ! tsdemux name=demuxer demuxer. ! queue ! \&lt;br/&gt;&#xA;  aacparse ! avdec_aac ! audioresample ! audioconvert dithering=0 ! voaacenc bitrate=25800 ! mux. \&lt;br/&gt;&#xA;  mp4mux name=mux ! filesink location=./gst-x264-`date +%Y%m%d_%H%M`.mp4 demuxer. ! queue ! mpegvideoparse ! mpeg2dec ! \&lt;br/&gt;&#xA;  videoconvert ! x264enc pass=quant ! video/x-h264,stream-format=byte-stream,profile=high ! h264parse ! mux.&lt;br/&gt;&#xA;Got EOS from element &#34;pipeline0&#34;.&lt;br/&gt;&#xA;Setting pipeline to PAUSED ...&lt;br/&gt;&#xA;Pipeline is PREROLLING ...&lt;br/&gt;&#xA;Redistribute latency...&lt;br/&gt;&#xA;Redistribute latency...&lt;br/&gt;&#xA;Pipeline is PREROLLED ...&lt;br/&gt;&#xA;Setting pipeline to PLAYING ...&lt;br/&gt;&#xA;New clock: GstSystemClock&lt;br/&gt;&#xA;progressreport0 (00:00:05): 4869200 / 250449088 bytes ( 1.9 %)&lt;br/&gt;&#xA;progressreport0 (00:00:10): 8648000 / 250449088 bytes ( 3.5 %)&lt;br/&gt;&#xA;～中略～&lt;br/&gt;&#xA;progressreport0 (00:04:15): 241937200 / 250449088 bytes (96.6 %)&lt;br/&gt;&#xA;progressreport0 (00:04:20): 246054400 / 250449088 bytes (98.2 %)&lt;br/&gt;&#xA;Execution ended after 0:04:27.257661620&lt;br/&gt;&#xA;Setting pipeline to PAUSED ...&lt;br/&gt;&#xA;Setting pipeline to READY ...&lt;br/&gt;&#xA;Setting pipeline to NULL ...&lt;br/&gt;&#xA;Freeing pipeline ...&lt;br/&gt;&#xA;yano@haswell:~/gst-test$ &lt;br/&gt;&#xA;&lt;/blockquote&gt;&#xA;ちなみに生のTSをそのまま喰わせると&lt;blockquote class=&#34;Log&#34;&gt;ERROR: from element /GstPipeline:pipeline0/GstTSDemux:demuxer: Internal data stream error.&lt;/blockquote&gt;と言われるので、ffmpegでVideo/Audio Streamをそれぞれ1つずつ分離しているのだが、変換元が「20161215_0012_28_GRhd.ts」だと2段目の&#34;Redistribute latency...&#34;が出ずにダンマリになってしまうので、まだちょっと怪しい。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
