GStreamer에서 OSD 출력하는 방법

klara의 이미지

Qt 4.4 TP1의 Phonon GStreamer backend 를 이용해서 간단한 동영상 플레이어를 만들고 있습니다.

화면에 시간 정보라든가 brightness라든가 하는 정보를 출력하기 위해서 OSD를 이용할려고 하는데요...

현재로썬 Phonon에서 OSD를 위한 API를 제공하지 않기 때문에, GStreamer용 backend에 약간의 수정을 가해서 gstreamer의 pipeline을 가져와서 pipeline에서 직접 작업을 하면되지 않을까..라고 생각하여 pipeline을 가져오는 것까진 성공하였습니다.

그런데 문제는 여기부터 막히네요..

Gtk는 전혀 해본적도 없고...당연히 GStreamer도 전혀 모릅니다.

그래도 나름 검색을 열심히 해보니 textoverlay라는 걸 이용하면 글을 쓸수 있다고 합니다.

그래서 만든 코드가

MediaObject *media = (Phonon의 클래스);
...(media에 필요한 작업(경로나 오디오 출력등 설정)하기
 
GstElement *pipeline = (media의 pipeline가져오기);
 
overlay = gst_element_factory_make ("textoverlay", "overlay");
g_object_set(G_OBJECT(overlay), "text", "test text", NULL);
g_object_set(G_OBJECT(overlay), "halignment", 2, NULL);
g_object_set(G_OBJECT(overlay), "valignment", 1, NULL);
g_object_set(G_OBJECT(overlay), "font-desc", "Sans 24", NULL);
gst_bin_add(GST_BIN(pipeline), overlay);
 
media->play();

이런 식인데요...
에러는 안나지만 그냥 동영상만 나올뿐 "test text"라는 글을 출력되지 않네요.
GStreamer에 대해 잘아시는분, gstreamer에서 화면에 텍스트를 출력하려면 어떻게 해야 할지 알려주시면 감사하겠습니다.

ganadist의 이미지

텍스트 오버레이 엘레먼트는 비디오 소스와 텍스트 소스를 받아서 비디오 싱크로 출력합니다.

커맨드 라인에서 gst-inspect-0.10 textoverlay 로 확인해보세요.

아마 기존의 파이프 라인은 비디오 소스와 비디오 싱크가 바로 연결되어 있을 듯 한데요, 그 사이에 textoverlay를 끼워 넣어야 할 것 같습니다.

----
Do not feed troll!

----
데스크탑 프로그래머를 꿈꾸는 임베디드 삽질러

klara의 이미지

답변감사합니다.
gst-inspect-0.10 textoverlay 라고 쳐보니 뭔가 레퍼런스 같은 내용이 나오는데요...
레퍼런스를 참고로 하란 말씀이신가요...?
죄송하지만, GStreamer를 이용해본적이 없어서 예제가 없이 레퍼런스만 봐도 어떻게 손을 대야 할지 모르겠습니다.
말씀 하신 "기존의 파이프라인의 비디오 소스와 비디오 싱크사이에 textoverlay를 끼워 넣는 방법"에 대해 좀더 자세히 설명해주실수 없을까요...?

ganadist의 이미지

저도 제대로 파고 들지는 않았고 overview만 대충 봤습니다.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html

핵심적인 내용은 3장 Foundation 에 다 나와 있고요.

조작 하는 부분은 Pipeline manipulation 을 보시면 될 것 같습니다.

----
Do not feed troll!

----
데스크탑 프로그래머를 꿈꾸는 임베디드 삽질러

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.