-1

I am trying to add a textoverlay to an mp4 movie with gstreamer-0.10. Yes I know its old but I only need to do few changes to the mp4. I know how to do it with gst-launch-0.10:

gst-launch-0.10 filesrc location=input.mp4 name=src ! decodebin name=demuxer demuxer. ! queue ! textoverlay text="My Text" ! x264enc ! muxer. demuxer. ! queue ! audioconvert ! voaacenc ! muxer. mp4mux name=muxer ! filesink location=output.mp4

This creates a text overlay movie for me. But now I need to add the textoverlay in the following bin in cpp - this is my working pipeline creating an mp4:

QGst::BinPtr m_encBin = QGst::Bin::fromDescription( 
   "filesrc location=\""+path+"videoname.raw.mkv\" ! queue ! matroskademux name=\"demux\" " 
   "demux.video_00 ! queue ! ffmpegcolorspace ! queue ! x264enc ! queue ! mux.video_00 " 
   "demux.audio_00 ! queue ! audioconvert ! queue ! faac ! queue ! mux.audio_00 " 
   "mp4mux name=\"mux\" ! queue ! filesink name=\"filesink\" sync=false ",
   QGst::Bin::NoGhost);

Anyone knows how I can add the textoverlay into the bin? Cheers Fredrik

nayana
  • 3,787
  • 3
  • 20
  • 51
Freddy
  • 1,022
  • 9
  • 16
  • wow would be nice to know why downvote. simply tell my when I am on the wrong way... – Freddy Nov 05 '15 at 17:37
  • Okay I made it - here is the simple text overlay BIN but without audio - if there is someone who knows how to create and insert an empty aac audio you are welcome! gst-launch-0.10 filesrc location=in.mp4 name=src ! decodebin ! textoverlay text="I am a video overlay text" ! x264enc ! h264parse ! mp4mux ! filesink location=out.mp4 – Freddy Nov 05 '15 at 23:45
  • but you wanted c++ right? some pipeline you already had (first part of your question) – nayana Nov 06 '15 at 11:59
  • yes c++ - I simply dont know how to integrate the textoverlay pipeline into the QGst:Bin. Apart from that the textoverlay pipeline in the first part of my question is not working fine. see my above comment for the working textoverlay pipeline. Well in the end I switched to a python gst-launch call for doing the text overlay for the mp4. that works now fine but i would be happy to know how to add an empty audio so that I can concat the movies together with ffmpeg. Well thanks anyway for reading. – Freddy Nov 06 '15 at 13:53

1 Answers1

0

I think you should add queue and textoverlay elements to your pipeline description between ffmpegcolorspace and queue elements:

QGst::BinPtr m_encBin = QGst::Bin::fromDescription( 
   "filesrc location=\""+path+"videoname.raw.mkv\" ! queue ! matroskademux name=\"demux\" " 
   "demux.video_00 ! queue ! ffmpegcolorspace ! queue ! textoverlay text=\"My Text\" ! queue ! x264enc ! queue ! mux.video_00 " 
   "demux.audio_00 ! queue ! audioconvert ! queue ! faac ! queue ! mux.audio_00 " 
   "mp4mux name=\"mux\" ! queue ! filesink name=\"filesink\" sync=false ",
   QGst::Bin::NoGhost);

I think you received downvote because you didn't try to understand GStreamer pipelines description and asked for ready-to-use solution.

Kyrylo Polezhaiev
  • 1,626
  • 11
  • 18
  • yes this is what i tried - but it didn't work. i get en empty movie file output then. yes i don't understand a lot about gstreamer pipelines but i read some stuff and tried it. all was working fine except the text overlay. well and also i have a special situation that i have to work with a really outdated version. Thanks for your suggestions anyway. – Freddy Nov 09 '15 at 22:46
  • Can you please share your input asset so I can re-play with pipeline below? – Kyrylo Polezhaiev Nov 10 '15 at 09:27
  • Do you mean the mkv movie? – Freddy Nov 11 '15 at 13:14
  • Sure. The input file. – Kyrylo Polezhaiev Jan 06 '16 at 10:30