Sample Header Ad - 728x90

How to have the subtitles occupy full screen for an ogg audio file with an srt subtitles files converted into an mp4 video file?

1 vote
0 answers
50 views
I can embed an mp4 file from an ogg file with embedded subtitles from an srt file alright, thanks to stack*** forums and other internet resources, in two steps: First create a black png file for background against white subtitle. Then join the audio with 1 pic to create an mp4 file. ffmpeg -loop 1 -i 1.png -i input.ogg -shortest output.mp4 On the second round, use that mp4 file and hard embed the subtitles into the file. ffmpeg -i output.mp4 -vf subtitles=input.srt out.mp4 My next objective would have been to combine the two steps into one. There are some resources that are available on the internet, notably, Linux Subtitles ffmpeg , from which I have the code: ffmpeg -i input.ogg -loop 1 -i 1.png -c:v libx264 -r 24000/1001 -vf "srt='input.srt'" -pix_fmt yuv240p -c:a copy -map 1:v -map 0:a -shortest output.mp4 There are errors: ffmpeg version 4.3.5-0+deb11u1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 10 (Debian 10.2.1-6) configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, ogg, from 'input.ogg': Duration: 00:09:56.73, start: 0.000000, bitrate: 53 kb/s Stream #0:0: Audio: vorbis, 44100 Hz, mono, fltp, 140 kb/s Input #1, png_pipe, from '1.png': Duration: N/A, bitrate: N/A Stream #1:0: Video: png, rgba(pc), 639x288, 25 fps, 25 tbr, 25 tbn, 25 tbc File 'output.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #1:0 -> #0:0 (png (native) -> h264 (libx264)) Stream #0:0 -> #0:1 (copy) Press [q] to stop, [?] for help [AVFilterGraph @ 0x5623a8c54480] No such filter: 'srt' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #1:0 Conversion failed! I am sure that an expert will easily be able to solve the problem faced, by suitably correcting the above line of code. But my final objective is still beyond: Since my input content file is only an audio file, I want to have the subtitles spread out across the entire screen, not restricted only to the bottom of the screen. I have seen such videos on YouTube, but the resources and code presently evade me.
Asked by Rajibando (69 rep)
Dec 6, 2023, 08:10 AM
Last activity: Jun 2, 2024, 03:12 PM