7
I have some subtitle files that are separate from their respective videos, and I would like to join them using the code below:
ffmpeg -i videoSemLegenda.mp4 -i legenda.vtt -c copy -c:s mov_text videoComLegenda.mp4
When getting the output in videoComLegenda using ffmpeg -i videoComLegenda.mp4
ffmpeg output shows that the caption is along with the video, but when trying to play the video in the tag <video>
caption is not shown. How do I force the caption to be written inside the video?
This is the output ffmpeg for a file whose subtitles were put through the above code:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x960 [SAR 1:1 DAR 4:3], 1459 kb/s, 29.97 fps, 29.97 tbr, 16k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(por): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 256 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(und): Subtitle: mov_text (tx3g / 0x67337874) (default)
Metadata:
handler_name : SubtitleHandler
read the answers to this question in the OS: Use ffmpeg to add text Subtitles
– David
The commands there passed work the same way, put the subtitle file inside the container but they do not appear in the player
– Leo Letto
I can’t vote to close your question because she’s got an active reward. But I think it’s not part of the scope of the site because it’s not about programming (it’s about using software).
– Luiz Vieira
I was left with a question, you want to "embeddar" the caption so that it is rendered next to the video, add as track inside the container or simply play a subtitled video using the native <video player> ?
– Leandro Angelo
But @Luizvieira despite the question referring to a software, the doubt applies rendering a caption inside the video to be displayed within a <video> tag, so I don’t believe it runs away from the scope of the site, and in the OS there are several questions regarding the same software, so I don’t believe there is any problem.
– Leo Letto
@Leandroangelo I want the caption to be rendered together with video when it is played in an HTML player
– Leo Letto
@Leoletto Yes, it applies to rendering the caption inside the video. Or, in other words, a use of ffmpeg that has nothing to do with programming. There may be questions regarding the use of the same software in a programming context (how to automate, how to integrate, etc). If not, I would also vote to close them.
– Luiz Vieira
Being a Command-line software I think that includes it a little in the programming category.
– Leo Letto
@Leoletto If by any chance your intention is to do this in an automated way within a website (in PHP, maybe?) for the video to be presented correctly to the HTML client, make that clear in the question. Then I think she would be part of the scope of the site. :)
– Luiz Vieira
I disagree. Otherwise, any software would fall into the programming category.
– Luiz Vieira
@Leoletto Cara, have you ever tried to include the caption as an external file even using <track>, as in the element reference? http://www.w3schools.com/TAgs/att_track_kind.asp
– Leandro Angelo
Yes @Leandroangelo calling the same via an external file works perfectly, but for curiosity I was wondering if it is possible to just embed it in the video
– Leo Letto
@Leoletto Then just re-encounter the video and actually render the text together with the image. I had to do it about three years ago and with DRM-protected media, I was the only way.
– Leandro Angelo
Look at this, Leo, how easily you can make your question within the scope, based on what colleague @Leandroangelo mentions. I think it’s just a matter of you editing the question and improving it by including this information from what you’ve already tried (and you might even mention that your search for embedding is about curiosity - although the issue of DRM protection is very relevant). If you edit in this sense, by the way, you get my +1. :)
– Luiz Vieira
I have no intention of doing this to protect the files, I see no need to edit the question by changing the meaning of it, ta simple and objective so that I also expect a simple answer, and I do not see why the factor of being a question just by "curiosity" should influence the response. Anyway I’m not going to discuss until why it’s forbidden to turn comments into chat. I’m sorry to those who didn’t like the scope covered in the question.
– Leo Letto