<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">Den 12.02.2024 00:07, skrev Andrew
Randrianasulu:<br>
</div>
<blockquote type="cite"
cite="mid:CA+rFky7c-K8upUxDMtKeO4oRSDaWQEXJn0EgTMMS7CHZpNQFLQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div><br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">пн, 12 февр. 2024 г.,
02:02 Terje J. Hanssen <<a
href="mailto:terjejhanssen@gmail.com"
moz-do-not-send="true" class="moz-txt-link-freetext">terjejhanssen@gmail.com</a>>:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> <br>
<br>
<div>Den 11.02.2024 04:36, skrev Terje J. Hanssen:<br>
</div>
<blockquote type="cite"> <br>
<br>
<div>Den 11.02.2024 00:57, skrev Andrew Randrianasulu:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div><br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">сб, 10 февр.
2024 г., 21:10 Terje J. Hanssen via Cin <<a
href="mailto:cin@lists.cinelerra-gg.org"
target="_blank" rel="noreferrer"
moz-do-not-send="true"
class="moz-txt-link-freetext">cin@lists.cinelerra-gg.org</a>>:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> There are two things I want to add to
my current intermediate DVD mpg video
files created with ffmpeg, and/or to the
DVD tree structure created with DeVeDeNG:<br>
<blockquote>1. Create and add a Navigation
menu in the beginning<br>
This will be an upcoming, separate topic<br>
<br>
2. Create and add Soft Subtitles as
simple text info commentaries to the
video content<br>
This is the topic for this post.<br>
</blockquote>
<br>
The reason that I want <b>Soft</b>
Subtitles as a separate text file stream
related to timing, is because this should
be possible to <b>add</b> or import to an
existing video file without the need to
re-encode. It should also be flexible to
display on or off during playback, if I
have understood this correct so far.<br>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">IIRC you can't add text-based
subtitles to DVD video. Blu-ray yes, dvd no
(both can use palletized reduced-color graphical
subtitles) ... so at least rendering text as
palletized picture and then muxing it into mpeg
stream is unavoidable step,as far as I
understand.</div>
</div>
</blockquote>
<br>
I have prepared a new video file and will try to add
sub-titles to-morrow <br>
<a
href="http://www.g-raffa.eu/Cinelerra/HOWTO/subtitles.html#_how_to_create_soft_subtitles"
target="_blank" rel="noreferrer"
moz-do-not-send="true" class="moz-txt-link-freetext">http://www.g-raffa.eu/Cinelerra/HOWTO/subtitles.html#_how_to_create_soft_subtitles</a><br>
<br>
<br>
</blockquote>
<br>
There are written several articles and answers to forum
topics about adding soft subtitles to video. <br>
My best but only partly working attempt so far, is by
applying this solution on StackOverflow: <br>
<br>
<i>Use ffmpeg to add text subtitles: NOTE: This solution
adds the subtitles to the video as a separate optional
(and user-controlled) subtitle track.<br>
<a
href="https://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles"
target="_blank" rel="noreferrer"
moz-do-not-send="true" class="moz-txt-link-freetext">https://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles</a><br>
<br>
</i>1) First I created a DVD-video compliant MPG file
with pcm audio from DV source (as previously)<br>
<br>
<font face="Courier New, Courier, monospace">ffmpeg
-hide_banner -i DV09-1993.dv -f dvd -target pal-dvd
-aspect 4:3 -b:v 8M -maxrate 8M -minrate 8M -bufsize
20M -muxrate 20M -mbd rd -trellis 1 -cmp 0 -subcmp 2
-c:a pcm_dvd DV09-1993.mpg</font><br>
<br>
<br>
2) Created the attached srt subtitle file: <br>
<blockquote><font face="Courier New, Courier, monospace">DVD-09-1993_subtitle.srt</font><br>
</blockquote>
<br>
<br>
3) Added (muxed) the soft, external subtitle file (2) as
a separate track to the mpg video file (1)<br>
<br>
<font face="Courier New, Courier, monospace">ffmpeg
-hide_banner -i DV09-1993.mpg -i
DVD-09-1993_subtitle.srt -c:v copy -c:a copy -c:s copy
DV09-1993+srt.mpg<br>
</font>
<blockquote><font face="Courier New, Courier, monospace">[mpeg
@ 0x55aac13139c0] start time for stream 0 is not set
in estimate_timings_from_pts</font><br>
<font face="Courier New, Courier, monospace">Input #0,
mpeg, from 'DV09-1993.mpg':</font><br>
<font face="Courier New, Courier, monospace">
Duration: 00:28:04.44, start: 0.540000, bitrate:
9701 kb/s</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:0[0x1bf]: Data: dvd_nav_packet</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps,
25 tbr, 90k tbn</font><br>
<font face="Courier New, Courier, monospace"> Side
data:</font><br>
<font face="Courier New, Courier, monospace">
cpb: bitrate max/min/avg: 9000000/0/0 buffer size:
1835008 vbv_delay: N/A</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16,
1536 kb/s</font><br>
<font face="Courier New, Courier, monospace">Input #1,
srt, from 'DVD-09-1993_subtitle.srt':</font><br>
<font face="Courier New, Courier, monospace">
Duration: N/A, bitrate: N/A</font><br>
<font face="Courier New, Courier, monospace"> Stream
#1:0: Subtitle: subrip</font><br>
<br>
<font face="Courier New, Courier, monospace">[mpeg @
0x55aac134b140] pcm_dvd in MPEG-1 system streams is
not widely supported, consider using the vob or the
dvd muxer to force a MPEG-2 program stream.</font><br>
<font face="Courier New, Courier, monospace">Output
#0, mpeg, to 'DV09-1993+srt.mpg':</font><br>
<font face="Courier New, Courier, monospace">
Metadata:</font><br>
<font face="Courier New, Courier, monospace">
encoder : Lavf60.16.100</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:0: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x576 [SAR 16:15 DAR 4:3], q=2-31,
25 fps, 25 tbr, 90k tbn</font><br>
<font face="Courier New, Courier, monospace"> Side
data:</font><br>
<font face="Courier New, Courier, monospace">
cpb: bitrate max/min/avg: 9000000/0/0 buffer size:
1835008 vbv_delay: N/A</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:1: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536
kb/s</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:2: Subtitle: subrip</font><br>
<font face="Courier New, Courier, monospace">Stream
mapping:</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:1 -> #0:0 (copy)</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:2 -> #0:1 (copy)</font><br>
<font face="Courier New, Courier, monospace"> Stream
#1:0 -> #0:2 (copy)</font><br>
<font face="Courier New, Courier, monospace">Press [q]
to stop, [?] for help</font><br>
<font face="Courier New, Courier, monospace">[out#0/mpeg
@ 0x55aac134af80] video:1644910kB audio:316303kB
subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.561824%</font><br>
<font face="Courier New, Courier, monospace">size=
1972232kB time=00:28:04.44 bitrate=9591.6kbits/s
speed= 378x </font><br>
</blockquote>
<font face="Courier New, Courier, monospace"><br>
</font>4) Successful Playback of the final video and
Audio with subtitles using a "reinforced" FFplay command
- also found on StackOverflow<br>
<a
href="https://stackoverflow.com/questions/50175075/can-ffplay-view-subtitles"
target="_blank" rel="noreferrer"
moz-do-not-send="true" class="moz-txt-link-freetext">https://stackoverflow.com/questions/50175075/can-ffplay-view-subtitles</a><br>
<br>
<font face="Courier New, Courier, monospace">ffplay
-hide_banner -vf subtitles=DVD-09-1993_subtitle.srt
DV09-1993+srt.mpg<br>
</font></div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">isn't this command just uses external srt and
not muxed one?</div>
</div>
</blockquote>
<br>
Yes, I think you'r right, and I wondered a bit about it, but had no
keyboard shortcut for ffplay to test switching subtitles on and off.<br>
<br>
So, afterwards I was more convinced - and fooled, when both Gnome
Media player (Totem) and SMplayer automatically displayed the
subtitles.<br>
But that was when the srt subtitle file had the same name as the mpg
video file and was located in the same directory. But this worked as
well with the first mpg file (1).<br>
<br>
The command line "vlc dvd.mpg dvd.srt" also worked with audio. Why
both VLC and MPlayer lost the audio with the srt muxed mpg file I
have no idea about.<br>
-----------------------------<br>
<br>
From your first reply: <br>
<blockquote>rendering text as palletized picture and then muxing it
into mpeg stream is unavoidable step,as far as I understand.<br>
But may be those DVD creation guis can do srt => dvd_sub
conversion for you ?<br>
</blockquote>
<br>
Andrey mentioned the "srt2vobsub" program, which seems to the same
as the "srt2vob" script for DVD and "2dsub" for BD vobsub<br>
<a class="moz-txt-link-freetext" href="https://web.archive.org/web/20130728210155/https://code.google.com/p/srt2vob">https://web.archive.org/web/20130728210155/https://code.google.com/p/srt2vob</a><br>
<br>
<br>
And from my reference to g-raffa: <br>
<blockquote>PRE-RENDERED SUBTITLES<br>
they are added (muxed) to the video stream as images with
minimal information but can be separated (demuxed) when needed.
They are used in DVDs and they can be turned on and off.<br>
Most DVD authoring applications are capable of transcoding
external subtitles to pre-rendered subtitles and of muxing them to
the video stream.<br>
</blockquote>
<br>
Regarding the last sentece, this article describes the wanted
solution - but on Linux ...?<br>
<a class="moz-txt-link-freetext" href="https://robots.net/tech/how-to-burn-dvd-with-subtitles-srt/">https://robots.net/tech/how-to-burn-dvd-with-subtitles-srt/</a><br>
<br>
while another article points on Handbrake as the best solution for
most users (?)<br>
<a class="moz-txt-link-freetext" href="https://helpdeskgeek.com/how-to/how-to-burn-a-dvd-disc-with-subtitles/">https://helpdeskgeek.com/how-to/how-to-burn-a-dvd-disc-with-subtitles/</a><br>
<br>
<br>
Re 8) above<br>
I also send a request to Raster soft why DeVeDeNG exits with an
error before finishing the mpg video file and creating the iso.<br>
<br>
<blockquote type="cite"
cite="mid:CA+rFky7c-K8upUxDMtKeO4oRSDaWQEXJn0EgTMMS7CHZpNQFLQ@mail.gmail.com">
<div dir="auto"><br>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font face="Courier New, Courier, monospace"> </font>
<blockquote><font face="Courier New, Courier, monospace">Input
#0, mpeg, from 'DV09-1993+srt.mpg':= 0KB sq=
0B f=0/0 </font><br>
<font face="Courier New, Courier, monospace">
Duration: 00:28:04.45, start: 0.540000, bitrate:
9591 kb/s</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps,
25 tbr, 90k tbn</font><br>
<font face="Courier New, Courier, monospace"> Side
data:</font><br>
<font face="Courier New, Courier, monospace">
cpb: bitrate max/min/avg: 9000000/0/0 buffer size:
1835008 vbv_delay: N/A</font><br>
<font face="Courier New, Courier, monospace"> Stream
#0:1[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16,
1536 kb/s</font><br>
<font face="Courier New, Courier, monospace">[Parsed_subtitles_0
@ 0x7f7368464340] Shaper: FriBidi 0.19.6 (SIMPLE)
HarfBuzz-ng 3.4.0 (COMPLEX)</font><br>
<font face="Courier New, Courier, monospace">[Parsed_subtitles_0
@ 0x7f7368464340] Using font provider fontconfig</font><br>
<font face="Courier New, Courier, monospace">[Parsed_subtitles_0
@ 0x7f7368464340] fontselect: (Arial, 400, 0) ->
/usr/share/fonts/truetype/LiberationSans-Regular.ttf, 0, LiberationSans</font><br>
<font face="Courier New, Courier, monospace"> 39.75
A-V: 0.002 fd= 0 aq= 190KB vq= 1222KB sq= 0B
f=0/0 </font><br>
</blockquote>
<br>
5) Playback using VLC<br>
<ul>
<li>OK playback of video and subtitles when adding the
subtitle file</li>
<li>BUT: The AUDIO is lost in VLC !? </li>
<li>Have looked into several menu items (unmute and
force volume on)</li>
</ul>
<br>
Additional I wonder:<br>
<br>
du -sh DV*.mpg<br>
<blockquote>2,0G DV09-1993.mpg (1)<br>
1,9G DV09-1993+srt.mpg (3)<br>
</blockquote>
6) Why is the merged (subtitled) file (3) smaller than
the initial file (1)?<br>
Even that the srt file is very small, it should rather
be opposite .........<br>
<br>
7) And why the ffmpeg output (3), when the initial input
mpg file (1) was created using "-f dvd -target pal-dvd",
which I thought was just MPEG-2 and vob?<br>
<blockquote><font face="Courier New, Courier, monospace">[mpeg
@ 0x55aac134b140] pcm_dvd in MPEG-1 system streams
is not widely supported, consider using the vob or
the dvd muxer to force a MPEG-2 program stream.</font><br>
</blockquote>
<br>
8) DevedeNG got so far an error while creating the DVD
iso from (3) <br>
Tested the movie file in the tree structure with VLC,
and also that without audio..... <br>
<br>
<br>
<br>
<blockquote type="cite">
<blockquote type="cite">
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">But may be those DVD creation guis
can do srt => dvd_sub conversion for you ?</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> <br>
2.1 Preferably I want to add/import
subtitles as fast and easy using GUI
interactive tools like DeVeDeNG or VLC if
possible?<br>
Next thereafter could be using the more
time consuming ffmpeg<br>
<a
href="https://www.baeldung.com/linux/subtitles-ffmpeg#how-to-add-soft-subtitles"
rel="noreferrer noreferrer"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://www.baeldung.com/linux/subtitles-ffmpeg#how-to-add-soft-subtitles</a><br>
<br>
2.2 So is the question if learning a
special subtitle editor is necessary to
create the text file easier, like one of
these 5<br>
<a
href="https://www.debugpoint.com/3-great-subtitle-editors-in-linux-systems/"
rel="noreferrer noreferrer"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://www.debugpoint.com/3-great-subtitle-editors-in-linux-systems/</a><br>
<br>
Tip, suggestions or experience how to do
this?<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
-- <br>
Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org"
rel="noreferrer noreferrer"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">Cin@lists.cinelerra-gg.org</a><br>
<a
href="https://lists.cinelerra-gg.org/mailman/listinfo/cin"
rel="noreferrer noreferrer noreferrer"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</blockquote>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>