Jump to content

Subtitles in transcoded streaming...


Recommended Posts

Anyone know that is it possible to show subtitles when using transcoded streaming?

How can I do so? It is really useful for me!!!

 

Tks!!

Morce

  • Like 1
Link to comment

A few years ago FFMPEG was not abled to keep either teletext or DVB subtitles while transcoding a stream. Dont know if anything has changed recently...dont think so! You could do some queries yourself to find out at the FFMPEG forum. Usually only hardcoded subs sticks when transcoding.

Link to comment

Tks majstang and epsy!!

But if I know the way to burn the subtitles into the video, how can I apply in the recording service?

Link to comment

If you have subtitles example .txt file, you can try it.

But it is different story, if you want burn teletext or dvb subtitles to stream.

 

How we can speed up recording service development?

I am so ready to pay extra money for recordingservice, if that helps.

Need support for android and wp too. Html5 stream?

 

Low-priced software is poor choise today...

Freeware, like xbmc, is so fast to develop, when there is many programmers.

Other choise is charge more, like videoredo do.

 

I really think that recordingservice is future, not DVBViewer.

Link to comment

How we can speed up recording service development?

Spend time an build changes you self :innocent: like mrphlox did with the Timline

http://www.DVBViewer.tv/forum/topic/47641-recording-service-verbesserungen-timeline/

 

Everyone can change the web interface and nearly all ffmpeg parameters. :fear:

 

 

Need support for android and wp too. Html5 stream?

HTML5 (mp4) live streaming only works with HLS LIVE and that is not well supported on Android.

http://adevendorf.github.io/android-html5-hls-compatibility/

Link to comment

Add this in the ffmpegprefs.ini and restart the Recording-Service:

[Medium 768 kbit - with Subtitle]
Cmd=-threads {threads} {offset} {realtime} -i "{infile}" -f flv -c:v libx264 -crf 21 -maxrate 650k -bufsize 1300k {framerate} -deinterlace -filter_complex "[0:v][0:s]overlay[v]" -map 0:[v]  -map 0:1  -preset {vpreset} -tune film -vprofile main -level 3.1 -acodec libmp3lame -ab 96k -ar 44100 -ac 2 -af volume=1.500000  -y "{outfile}"
maxWidth=640
maxHeight=480
MimeType=video/x-flv
Ext=.flv
Bitrate=600
Selected=1



 

And, you have to enable "DVB Subtitel" --> http://de.DVBViewer.tv/wiki/Optionen_Service_-_Web/UPnP

 

Problem:

- You can't Resize the Video. Videofilters won't work. I don't know why.

- No Video is shown when DVB-Stream has no DVB-Subtitle

Edited by epsy
Link to comment

Please try this:

[Medium 768 kbit - with Subtitle]
Cmd=-threads {threads} {offset} {realtime} -i "{infile}" -f flv -c:v libx264 -crf 21 -maxrate 650k -bufsize 1300k {framerate} -deinterlace -filter_complex "[0:v][0:s]overlay,scale={scalex}:{scaley}" -map 0:0 -map 0:1  -preset {vpreset} -tune film -vprofile main -level 3.1 -acodec libmp3lame -ab 96k -ar 44100 -ac 2 -af volume=1.500000  -y "{outfile}"
maxWidth=640
maxHeight=480
MimeType=video/x-flv
Ext=.flv
Bitrate=600
Selected=1
Link to comment

EPSY, i tried this:

 

Please try this:

[Medium 768 kbit - with Subtitle]
Cmd=-threads {threads} {offset} {realtime} -i "{infile}" -f flv -c:v libx264 -crf 21 -maxrate 650k -bufsize 1300k {framerate} -deinterlace -filter_complex "[0:v][0:s]overlay,scale={scalex}:{scaley}" -map 0:0 -map 0:1 -preset {vpreset} -tune film -vprofile main -level 3.1 -acodec libmp3lame -ab 96k -ar 44100 -ac 2 -af volume=1.500000 -y "{outfile}"
maxWidth=640
maxHeight=480
MimeType=video/x-flv
Ext=.flv
Bitrate=600
Selected=1

 

 

 

On an encripted channel its working BUT not on all channels, only on some of them. Its the first time that i see subtitles with ffmpeg:).

Now, on some channels i have 2 subtitles, one for hungarian, one for romanian. How could i choose which one to choose? i prefer romanian:)

Edited by bogdan1980
Link to comment

FOUND how to choose from multiples subtitles in flowplayer stream,

 

If you have multiple subtitle streams, you can select which one to use by replacing [0:s] with [0:s:0] to select the first subtitle stream or [0:s:1] to select the second subtitle stream, and so on

 

 

i simple replaced [0:s] with [0:s:1] in ffmpegprefs , in profile with subtitles.

 

Nice work

epsy

 

EDIT: If one canal has only one subtitle and you use stream profile with second subtitles([0:s:0]), you will get black screen( no image).

On these channels you need to use profile stream with [0:s]

Edited by bogdan1980
Link to comment
  • 3 months later...

I tried to make reference to the above setting for streaming live TV on iPad with embedded subtitle, but it does not work. (The ffmpeg does not run) Would any expert here show me a working entry for iPhone / iPad?

Link to comment
  • 1 month later...

I added the below lines in "ffmpegprefs.ini". Then, I can see the option "Medium 768 kbit - with Subtitle" but there is still no subtitle burned in the video viewing by DVBViewer Controller android app. Any clue?

 

EPSY, i tried this:

 

Please try this:

[Medium 768 kbit - with Subtitle]
Cmd=-threads {threads} {offset} {realtime} -i "{infile}" -f flv -c:v libx264 -crf 21 -maxrate 650k -bufsize 1300k {framerate} -deinterlace -filter_complex "[0:v][0:s]overlay,scale={scalex}:{scaley}" -map 0:0 -map 0:1 -preset {vpreset} -tune film -vprofile main -level 3.1 -acodec libmp3lame -ab 96k -ar 44100 -ac 2 -af volume=1.500000 -y "{outfile}"
maxWidth=640
maxHeight=480
MimeType=video/x-flv
Ext=.flv
Bitrate=600
Selected=1

Edited by hellomen
Link to comment

The App cant read the ffmpegprefs.ini file, there is no possibility for that, so the default presets are hardcoded in the app.

 

As a workaround you could add your subtitle preset as first preset in the ini file and then select the first preset in the app.

 

Ugly but it works.

Link to comment

Thanks very much for your reply!

 

But I still cannot make it to work in webinterface, iphone interface and the App. I'm not sure if you can post a workable ffmpegprefs.ini file here so that I may use it to test. Sorry for the trouble.

 

By the way, I want to know if this change in ffmpegprefs will affect webinterface only, or the iphone interface as well? Cuz I found another iphoneprefs.ini with similar settings there.

 

Thanks a lot!

 

The App cant read the ffmpegprefs.ini file, there is no possibility for that, so the default presets are hardcoded in the app.

 

As a workaround you could add your subtitle preset as first preset in the ini file and then select the first preset in the app.

 

Ugly but it works.

Edited by hellomen
Link to comment
  • 1 year later...

dvb sub work with ffmpegprefs.ini but subs are in left corner near the top. anyone know how to put it at the bottom?

 

edit: here is some of info regarding ffmpeg and subs:

https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options#Import_subtitle_and_re-encode_video.2Faudio_streams:

 

 

Also i did notice that on Android with latest Mxplayer 1.8.0 beta and Bsplayer( latest) dvb subtitles appear on live-stream.

So Mxplayer/Bsplayer they find an way to include dvb sub in live-tv.

Six month ago there wasnt working on them.

Edited by bogdan1980
Link to comment

I fix subtitle that appear in the left corner near the top, i download this:

 

https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20151116-git-1fe82ab-win32-static.7z

 

extract only FFmpeg.exe and put it in DVBViewer folder

 

add this profile for example in ffmpegprefs:

 

[Medium 768 kbit - with Subtitle TEST]
Cmd=-threads {threads} {offset} {realtime} -i "{infile}" -f flv -c:v libx264 -crf 21 -maxrate 650k -bufsize 1300k {framerate} -deinterlace -scodec dvbsub -preset {vpreset} -tune film -vprofile main -level 3.1 -acodec libmp3lame -ab 96k -ar 44100 -ac 2 -af volume=1.500000 -y "{outfile}"
maxWidth=640
maxHeight=480
MimeType=video/x-flv
Ext=.flv
Bitrate=600
Selected=1

 

 

now all dvb bitmap subtitles are ok in the bottom part, font are good, im glad i finally crack this.

Edited by bogdan1980
Link to comment

The solution above does not work here. Additionally you have removed all scaling, which is not so good. I think a better solution is to modify a standard preset from the ffmpegprefs.ini or iphoneprefs.ini and replace the video filter part beginning with -vf ".... by

 

-filter_complex "[0:v][0:s:0]overlay, yadif=0:-1:1, scale={scalex}:{scaley}"

 

You may use [0:s:0], [0:s:1], [0:s:2] etc for selecting different subtitle streams. The next RS version will support selection by URL parameter (subs=x).

 

The secret is to use an up-to-date FFmpeg version and to apply the subtitle overlay before scaling happens. It yields excellent results here. However, there is one drawback: If the channel provides no DVB subtitles FFmpeg stops and does nothing.

Link to comment

P.S. It may be necessary to disable Teletext in the RS Options -> Web/UPnP. We have encountered various problems if ffmpeg detects teletext in the input stream and tries to use it as subtitles.

Link to comment
  • 4 weeks later...

Now with new rec service all became easier.

 

I play with this: http://127.0.0.1:8089/tv.html?preset=WebM%20HD%203600%20kbit&ffpreset=fast&delay=3000&subs=1&chid=0 yesterday( put it instead of web page link)- read transcoding_params_en from DVBViewer rec service forum link.

 

Also in web interface stream page, you need to click Expert, to add subs=0 or subs=1 etc

 

On DVBViewer android app you will not get text subs till they update the app.

So you need to open ffmpegprefs( c program files x86 DVBViewer config location) and add an profile [Medium 768 kbit - with Subtitle TEST] AS AN FIRST PROFILE

Then start DVBViewer android app and choose 5120kb profile( this will became Medium 768 profile with subs).

If you do not put MEDIUM 768 profile as an first profile in ffmpegprefs you will not receive dvb subs.

 

 

 

Or use mine. If anyone have better one pls attach to test them.

With this profile when i use my android DVBViewer app to watch live tv i have subs on all channels, including text subs and subs that are coded into stream on romanian channels.

 

 

PS. My teletext is disabled in RS Options -> Web/UPnP.

ffmpegprefs.ini

Edited by bogdan1980
Link to comment
  • 1 month later...

Hi Bogdan,

 

i have installed the last version of DVBViewer and Recording Service but still no luck with the subtitles. in the new SR the stream profiles have been changed now we have 3 types (web, flash, TS) with several bandwidth values. quite different from the old RS.

 

i have checked the web application and also android app, no luck with subtitles.

 

appreciate if you can give me some pointers or guide me step by step

 

PS. i am using also Kodi 15.2 and there i can see the subtitle exist but i cannot see it

 

multumesc mult.

Constantin

Link to comment

Zwischenablage01.png

 

This wil let the first DVB subtitle stream show up. It works with all transcoded formats.

 

For more information about the subs parameter have a look at the text file that is attached here.

 

P.S. Please use the original ffmpegprefs.ini for it, not a third party replacement.

Edited by Griga
Link to comment

Hi Griga,

 

Thanks for your reply, now i can see the subtitles in the transcoded streams via Web Interface

 

i have read through the document you referenced and what i understood is that i need to revise the content of fmpegprefs.ini file and add "subs=0" on the stream profiles in order to have the subtitles working on streams via android app.

 

i will try and let you know.

 

thanks once again.

Edited by constantin2015
Link to comment
that i need to revise the content of fmpegprefs.ini file and add "subs=0" on the stream profiles in order to have the subtitles working on streams via android app.

 

No. Please don't. subs=0 must be added to the query part of URLs, not to the ffmpegprefs.ini content. I don't know exactly how the Android App works, but I think forcing subtitles requires the measures described above by Bogdan. Another possibility would be to enter URLs for certain channels manually in the Android Player / Android Browser and store them as bookmarks.

 

The iOS App already supports subtitles, and chances are that the Android App will support them in future...

Link to comment

Hi Griga,

 

Thanks a lot for your feedback. good i didn't change anything. :original:

 

i am using the Android app and i am looking forward for a release that will support subtitles. until then i will try Bogdan's method and see if i up to the task. :)

Link to comment

I can't offer much help but I can confirm that the Android app displays subtitles when using MX Player. (OnePlusOne 'phone running KitKat and Nexus 7 running Lollipop.)

 

My settings are fairly near default, I'm using the current versions of DVBv, RS and the app with a DVB-S2 tuner card and FreeSat and a DVB-T USB stick with FreeView in the UK. These are DVB-Sub subtitles but I also use MX Player for playing videos and it displays Teletext (.srt) subtitles without any problems as well.

 

If you're not using MX Player I suggest trying it, otherwise I would uninstall everything and start again from scratch.

Edited by SimonP
Link to comment

Hi Simon, thanks for your feedback.

 

happy to hear all is working as expected, also in my case most of settings are the default settings. this is a clean installation (win+DVBViewer) on the main computer used as a server. i am using the android app on a Samsung s5 and a Minix android box, i tried both MX Player and BS Player and in all cases/combinations i cannot see subtitles.

 

strange thing is that on Kodi i have the subtitles option enabled, i can see there is subtitles stream but subtitles are not visible.

 

i tried Bogdan's advice and is working, however i hope there will be a "cleaner" solution available.

 

Constantin

Link to comment

It's good to hear you have it working but I didn't have to do any of that, it pretty much worked "out of the box". Are you seeing subtitles in DVBViewer? Also did you select them in MX Player by selecting the text box at the top right of the screen? I can't think of anything else you'd have to configure to get them working.

 

I just checked Kodi on my 'phone and subtitles are working there too, obviously you have to download them but once that's done they were fine.

 

The only thing is that I don't think I'm transcoding, I only use it on the local network and my phone is 1080p so there's no need. Maybe that explains it?

Edited by SimonP
Link to comment

Hi Simon,

 

on DVBViewer (installed on the main computer that i used as a server) subtitles are ok. however when i am streaming live TV outside my home network, no matter i am using android DVBViewer app or kodi as clients, i cannot see subtitles.

 

in Kodi, i am streaming live TV so i'm not sure if there is any option to download DVB subtitles for the channel i am watching. i tried both MX player and BS player, i checked the subtitles option but the same issue.

 

as mentioned, i tried Bogdan's file and working well, now i am trying to build a new profile for better quality, curios to see if it will work ( i am a complete noob when is coming to streaming and networking but i am trying a bit of reverse engineering :pc: )

 

PS. just now i saw the big difference...you are using the direct stream and not transcoding....here is the difference! :oops: . on direct stream i am ok as well.

Edited by constantin2015
Link to comment
×
×
  • Create New...