Hi everybody! Is it possible to stream a local file and a subtitle for that file (in srt or whatever format) so that in the final stream the subtitles can be switched on and off. My problem is that I want to stream to 'UDP multicast (224.1.1.1:1234)' Video + Audio in a Mkv container + Subtitle in .srt or .ass. But I need subtitles to be switched On and Off. Until now I have successfully manage to stream all the above transcoding to mpeg2video, using the dvbsub codec for subs. But using Vlc Player or a DVB-C STB I can receive the video stream with all audio streams and the DVB Subtitle stream, BUT it seems that the sub stream is empty. I have tried with ass subs but they are hardcoded with the -vf filter, and I want the subs to be Dvb Subtitles. This is what I am using: ffmpeg -re -i 'input.mpg' -i 'input.sub' -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 1:0 -vcodec mpeg2video -s 1280x720 -r 25 -b:v 9M -acodec mp2 -ac 2 -b:a 192k -scodec dvbsub -f mpegts udp://224.1.1.1:1234?pkt_size=1316 I am using latest Zeranoe 64bit build on Windows 7 64bit, but I'm willing to use it from Linux if it is a windows build problem. Anyone has the answer to this? -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/DVB-Subtitles-On-Off-tp4664943.html Sent from the FFmpeg-users mailing list archive at Nabble.com.
enri69 <priftien <at> hotmail.com> writes:
But using Vlc Player or a DVB-C STB I can receive the video stream with all audio streams and the DVB Subtitle stream, BUT it seems that the sub stream is empty.
Is this reproducible with file output? If yes, please provide your failing command line together with the complete, uncut console output. Carl Eugen
ffmpeg -re -i c:\simpson.mkv -i c:\simpson.sub -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 1:0 -vcodec mpeg2video -s 1280x720 -r 25 -b:v 9M -acodec mp2 -ac 2 -b:a 192k -scodec dvbsub -f mpegts udp://224.1.1.1:1234?pkt_size=1316 ffmpeg version N-62669-g443936d Copyright (c) 2000-2014 the FFmpeg developers built on Apr 23 2014 22:09:11 with gcc 4.8.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable -decklink --enable-zlib
Hi! Now that I am trying with a SUB subtitle which I got from converting a srt with txt2vobsub I am getting an error.... libavutil 52. 78.100 / 52. 78.100 libavcodec 55. 59.100 / 55. 59.100 libavformat 55. 37.101 / 55. 37.101 libavdevice 55. 13.100 / 55. 13.100 libavfilter 4. 4.100 / 4. 4.100 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 18.100 / 0. 18.100 libpostproc 52. 3.100 / 52. 3.100 Input #0, matroska,webm, from 'c:\simpson.mkv': Metadata: title : The Simpsons [Season 21] (2009) encoder : libebml v1.2.3 + libmatroska v1.3.0 creation_time : 2012-02-06 11:16:19 Duration: 00:21:31.46, start: 0.000000, bitrate: 4725 kb/s Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 2k tbc (default) Metadata: title : Release for HU Stream #0:1(ita): Audio: mp2, 48000 Hz, stereo, s16p, 224 kb/s (default) Metadata: title : Italisht Stream #0:2(rus): Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s Metadata: title : AC3 2.0 256 Kbps Stream #0:3(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s Metadata: title : AC3 5.1 384 Kbps Input #1, mpeg, from 'c:\simpson.sub': Duration: 00:19:20.98, start: 72.540000, bitrate: 6 kb/s Stream #1:0[0x20]: Subtitle: dvd_subtitle Output #0, mpegts, to 'udp://224.1.1.1:1234?pkt_size=1316': Metadata: title : The Simpsons [Season 21] (2009) - Release for HDClub encoder : Lavf55.37.101 Stream #0:0(eng): Video: mpeg2video, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q =2-31, 9000 kb/s, 90k tbn, 25 tbc (default) Metadata: title : Release for HU Stream #0:1(ita): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s (default) Metadata: title : Italisht Stream #0:2(rus): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s Metadata: title : AC3 2.0 256 Kbps Stream #0:3(eng): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s Metadata: title : AC3 5.1 384 Kbps Stream #0:4: Subtitle: dvb_subtitle (dvbsub), 1280x720 Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg2video) Stream #0:1 -> #0:1 (mp2 -> mp2) Stream #0:2 -> #0:2 (ac3 -> mp2) Stream #0:3 -> #0:3 (ac3 -> mp2) Stream #1:0 -> #0:4 (dvdsub -> dvbsub) Press [q] to stop, [?] for help [mpegts @ 00000000051fa6c0] Encoder did not produce proper pts, making some up. [mpegts @ 00000000051fa6c0] Application provided invalid, non monotonically incr easing dts to muxer in stream 4: 620640 >= 617130 av_interleaved_write_frame(): Invalid argument frame= 0 fps=0.0 q=0.0 Lsize= 6kB time=00:00:10.22 bitrate= 4.4kbits/ s video:0kB audio:1kB subtitle:6kB other streams:0kB global headers:0kB muxing ove rhead: unknown -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/DVB-Subtitles-On-Off-tp4664943p4664... Sent from the FFmpeg-users mailing list archive at Nabble.com.
enri69 <priftien <at> hotmail.com> writes:
Now that I am trying with a SUB subtitle which I got from converting a srt with txt2vobsub I am getting an error....
Is the problem reproducible with file output? Carl Eugen
ffmpeg -re -i c:\simpson.mkv -i c:\simpson.sub -map 0:0 -map 0:1 -map 1:0 -vcod ec mpeg2video -s 720x480 -r 25 -b:v 1M -acodec mp2 -ac 2 -b:a 192k -scodec dvbsu b -f mpegts c:\simp.ts ffmpeg version N-62669-g443936d Copyright (c) 2000-2014 the FFmpeg developers built on Apr 23 2014 22:09:11 with gcc 4.8.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable -decklink --enable-zlib
Yes. This is with file output libavutil 52. 78.100 / 52. 78.100 libavcodec 55. 59.100 / 55. 59.100 libavformat 55. 37.101 / 55. 37.101 libavdevice 55. 13.100 / 55. 13.100 libavfilter 4. 4.100 / 4. 4.100 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 18.100 / 0. 18.100 libpostproc 52. 3.100 / 52. 3.100 Input #0, matroska,webm, from 'c:\simpson.mkv': Metadata: title : The Simpsons [Season 21] (2009) encoder : libebml v1.3.0 + libmatroska v1.4.1 creation_time : 2014-04-26 18:22:05 Duration: 00:04:00.29, start: 0.000000, bitrate: 5555 kb/s Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 2k tbc (default) Metadata: title : Release for HU Stream #0:1(ita): Audio: mp2, 48000 Hz, stereo, s16p, 224 kb/s (default) Metadata: title : Italisht Input #1, mpeg, from 'c:\simpson.sub': Duration: 00:19:20.98, start: 72.540000, bitrate: 6 kb/s Stream #1:0[0x20]: Subtitle: dvd_subtitle File 'c:\simp.ts' already exists. Overwrite ? [y/N] y Output #0, mpegts, to 'c:\simp.ts': Metadata: title : The Simpsons [Season 21] (2009) encoder : Lavf55.37.101 Stream #0:0(eng): Video: mpeg2video, yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 1000 kb/s, 90k tbn, 25 tbc (default) Metadata: title : Release for HU Stream #0:1(ita): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s (default) Metadata: title : Italisht Stream #0:2: Subtitle: dvb_subtitle (dvbsub), 720x480 Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg2video) Stream #0:1 -> #0:1 (mp2 -> mp2) Stream #1:0 -> #0:2 (dvdsub -> dvbsub) Press [q] to stop, [?] for help [mpegts @ 0000000002aa55e0] Encoder did not produce proper pts, making some up. [mpegts @ 0000000002aa55e0] Application provided invalid, non monotonically incr easing dts to muxer in stream 2: 620640 >= 617130 av_interleaved_write_frame(): Invalid argument frame= 0 fps=0.0 q=0.0 Lsize= 6kB time=00:00:10.22 bitrate= 4.4kbits/ s video:0kB audio:1kB subtitle:6kB other streams:0kB global headers:0kB muxing ove rhead: unknown If I put a SRT file instead of a SUB it encodes the file but with empty DVB Subtream in VLC. Here is the file encoded https://www.wetransfer.com/downloads/33eee23e9b5b5627866c41d4f33ce01e2014042... -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/DVB-Subtitles-On-Off-tp4664943p4664... Sent from the FFmpeg-users mailing list archive at Nabble.com.
Hi, On Sat, Apr 26, 2014 at 13:23:18 -0700, enri69 wrote: [I have shorted this a slight bit]
Input #0, matroska,webm, from 'c:\simpson.mkv': Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709), 1280x720 [SAR Stream #0:1(ita): Audio: mp2, 48000 Hz, stereo, s16p, 224 kb/s (default) Input #1, mpeg, from 'c:\simpson.sub': Stream #1:0[0x20]: Subtitle: dvd_subtitle Output #0, mpegts, to 'c:\simp.ts': Stream #0:0(eng): Video: mpeg2video, yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 1000 kb/s, 90k tbn, 25 tbc (default) Stream #0:1(ita): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s (default) Stream #0:2: Subtitle: dvb_subtitle (dvbsub), 720x480 Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg2video) Stream #0:1 -> #0:1 (mp2 -> mp2) Stream #1:0 -> #0:2 (dvdsub -> dvbsub)
If I put a SRT file instead of a SUB it encodes the file but with empty DVB Subtream in VLC.
Can either of those formats even successfully be muxed into an MPEG-TS? https://wiki.videolan.org/MPEG/#Accepted_subtitle_codecs SRT shouldn't work at all, I wonder why ffmpeg doesn't refuse to do so. I was under the impression (from personal experience, not standards) that dvdsub shouldn't work, but dvbsub should. Caveat: ffmpeg could have problems of its own with the latter, see trac #2024. Moritz
I kinda did it with vobsub subtitle. The only problem now is that subs stream seems to start ahead of its time. But at least it is a DVB subtitle. it can be turned on and off on my HD STB. Just need to adjust timing. (VLC does this perfectly in time but has other issues) And also finding the right h264 transcode settings seems like a bit difficult. A lot of artifacts and freezing with high bitrate. -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/DVB-Subtitles-On-Off-tp4664943p4665... Sent from the FFmpeg-users mailing list archive at Nabble.com.
participants (3)
-
Carl Eugen Hoyos -
enri69 -
Moritz Barsnick