Discussion:
[FFmpeg-user] Pipe subtitles to ffmpeg exe
Sylvain
2013-12-29 12:08:44 UTC
Permalink
HI,

I am using ffmpeg to encode and mux a SPTS mpeg-ts with H264 video. I provide the input pictures thru a pipe ,and it works fine. But i need to add some DVB subtitles to the SPTS stream, and i am searching a way to provide the subtiles thru another pipe/named FIFO.

Despite mutiple trials, i am not able to generate the subtitles in this way. Note that the subtitles are generated by my own application, so i can format them in any needed format.

The command i use for the video :
ffmpeg -re -r 25 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -s 720x576 -i - -an -vcodec libx264 -tune zerolatency -preset veryfast -x264opts intra-refresh:keyint=12:fps=25:bitrate=1800 -f mpegts -muxrate 1800K udp://localhost:54320?pkt_size=1316

Ideally, i would like to add another input for subtitles like this :
mkfido subtitles.fifo
ffmpeg... -i subtitles.fifo -scodec dvbsub ....

So what could be the format of the data pushed into subtitles.fifo ?

Thanks for your help,

Regards, SF
Carl Eugen Hoyos
2013-12-29 12:46:37 UTC
Permalink
Post by Sylvain
Note that the subtitles are generated by my own
application, so i can format them in any needed format.
Then please use mpeg-ts which is the only format that
makes sense for dvbsub.
Why don't you let FFmpeg create the subtitles?

You do know that the mpeg-ts muxer (contrary to most/all
other parts of FFmpeg) is known to have problems creating
compliant streams?
This is particularly true for dvbsubs, this is currently
tried to being fixed, please help if you can, see for
example ticket #2989.

Carl Eugen
Sylvain
2013-12-29 15:28:27 UTC
Permalink
Thanks for your response.

So, if i undestand well, you recommand to create a mpeg-ts with only 1 subtitle stream in my application, then to remux it using the input pipe in the final command. Correct ?

I was not aware of the bug, i will look deeper into the code to see what is happening.

Regards, SF
Post by Carl Eugen Hoyos
Post by Sylvain
Note that the subtitles are generated by my own
application, so i can format them in any needed format.
Then please use mpeg-ts which is the only format that
makes sense for dvbsub.
Why don't you let FFmpeg create the subtitles?
You do know that the mpeg-ts muxer (contrary to most/all
other parts of FFmpeg) is known to have problems creating
compliant streams?
This is particularly true for dvbsubs, this is currently
tried to being fixed, please help if you can, see for
example ticket #2989.
Carl Eugen
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Carl Eugen Hoyos
2013-12-29 15:33:57 UTC
Permalink
Post by Sylvain
So, if i undestand well, you recommand to create a mpeg-ts
with only 1 subtitle stream in my application, then to
remux it using the input pipe in the final command.
I would recommend it if remuxing dvbsub would generally work.

Please explain why you cannot create dvbsubs with FFmpeg, we
like problem reports.

Please do not top-post here, it is considered rude.

Carl Eugen
Sylvain
2013-12-29 15:46:20 UTC
Permalink
Post by Carl Eugen Hoyos
I would recommend it if remuxing dvbsub would generally work.
OK, understood.
Post by Carl Eugen Hoyos
Please explain why you cannot create dvbsubs with FFmpeg, we
like problem reports.
I was trying to guess how to provide the input subtitles, hence my question.

As i have now a hint, i am coding a test to
generate a "mpeg-ts subtitles only stream", and then try to remux it.

I will probably encounter the #2989, so i wil try to fix it, or at least understand
what is going on
Post by Carl Eugen Hoyos
Please do not top-post here, it is considered rude.
Oops, sorry, i missed that.


Rgds, SF.
Carl Eugen Hoyos
2013-12-29 15:51:29 UTC
Permalink
Post by Sylvain
Post by Carl Eugen Hoyos
Please explain why you cannot create dvbsubs with
FFmpeg, we like problem reports.
I was trying to guess how to provide the input subtitles,
hence my question.
As i have now a hint, i am coding a test to generate a
"mpeg-ts subtitles only stream", and then try to remux it.
As said, this unfortunately does not work currently
(it should though and it may be possible to fix).
Post by Sylvain
Note that the subtitles are generated by my own application
I am curious why you don't create the dvb subtitles with
the FFmpeg dvbsub encoder.

Carl Eugen
Sylvain
2013-12-31 12:35:42 UTC
Permalink
Post by Carl Eugen Hoyos
I am curious why you don't create the dvb subtitles with
the FFmpeg dvbsub encoder.
I think there is a misunderstanding here.
In a first approach, i was thinking that it was possible to provide
a pipe to create subtitles, with a particular picture format.
Hence my sentence, saying that my application will provide the
Subtiles. In fact, the correct sentence would be ;
"my application will provide the input pictures
used to build the subtiltes".

Right now, i stopped using the ffmpeg binary solution, and i am
calling directly from my application the libavcodec/libavformat
API.

I am able to generate a MPTS with H264+subtitles, but when i
replay it, I am facing issues with the framerate and PTS/DTS.
I will post a separate mail on this.

Regards (and happy new year), SF.

Loading...