Python, composing srt file with mp4 - mp4

I am trying to automate subtitles . I have the subtitles but I don't know how can I compose it with video with a script( Normally I use VLC). Any API or library for that?

Maybe you can write something to use tha Handbrake command line instructions:
https://handbrake.fr/docs/en/1.3.0/cli/command-line-reference.html
-F, --subtitle-forced[=string]

Related

Merge multiple fragments of video and mux it to normal video format

i want to ask if there is any option to just merge multiple fragments downloaded from HBO GO app and mux it to some normal format like mkv or mp4??? Because these fragments has no file type. Some script, program, guide ??? It looks like this
for video: Fragments(video=0), Fragments(video=10000000), Fragments(video=20000000), Fragments(video=30000000), Fragments(video=40000000), Fragments(video=50000000)
...for audio Fragments(audio_eng_st_dub=0), Fragments(audio_eng_st_dub=20201361), Fragments(audio_eng_st_dub=40402721), Fragments(audio_eng_st_dub=60604082)
...for text is simillar.
youtube-dl doesnt support HBO GO direct download so if anybody can help me with it ???
Thank you
They are probably fragmented mp4, You can just concat them with the init fragment and many players can play it.
However HBO use DRM, so you will never be able to play these files.

How to download and join a movie in vlc

I know how to download a streaming movie with VLC but I have a problem. When it comes to a movie that comes in sequencial links like movie_part_1 , movie_part_2, etc, how can I download all of the parts and joint them together?
Thank you!
multiple mpg files can be combined into one output file using command line tool ffmpeg
ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg
see details at https://trac.ffmpeg.org/wiki/Concatenate

How to programmatically output fragmented mp4 file using libavformat?

I want to use mp4 file format for live streaming, which is not possible with an unfragmented mp4 file, as the moov atom is generally written at the end of the file. I need to generate a fragmented mp4 file to transfer it over a network for live streaming. I am using libavformat. The problem is, I can write unfragmented mp4 files easily with libavformat, but I don't know how to write a fragmented mp4 file. So, how to write a fragmented mp4 file using libavformat?
I don't think you are looking for fragmented mp4 (FYI a fragmented mp4 is usually called .ismv) ISMV requires a media server and specialized client to stream.
I think what you are looking for is faststart. This simply moves the moov atom to the start of the file. ffmpeg comes with a qt-faststart utility that will do this for you. Check you distrobution.
You can use Bento4 library to do this easily. Download from here http://www.bento4.com/downloads/ and use the binary mp4fragment.
mp4fragment sourcefile destinatiofile

Save video read from VirtualDubMod to file using command line only?

I want to compile several video clips using Avisynth on a server. I generate the .avs file and let VirtualDubMod read the file.
How do I save the video read from VirtualDubMod to an avi file using the command line only? If I open VirtualDubMod then I can choose save as but I am putting this on a server so no GUI will be available and it should be automatic.
EDIT:
After looking some more I found this. Is this a recommended approach?

How to create quicktime movie from a sequence of images via perl?

I would like to create a quicktime movie from a sequence of still frames via perl. It seems like there should be a relatively simple way to do this, but so far I have not found it. Things I've tried:
Reading the Quicktime file spec and creating the movie file from scratch. This low level approach has worked well for me in the past with TIFF and PDF file formats, but Quicktime seems dauntingly complicated.
Looking at the various quicktime-related perl modules. So far I haven't found one that lets me do what I want (images --> movie) with a minimum of fuss.
Using Applescript and Quicktime Player. This would probably work if I paid for Quicktime Pro, but I'd prefer not to do that.
I'm interested in any suggestions (even non-perl-based ones) for a relatively simple way to assemble a sequence of images into a quicktime movie.
Video encoding isn't really an ideal job for perl -- there are a lot of pieces to put together. I would suggest just using mencoder -- you can use an input of e.g. -mf type=png:fps=30 mf://frame*.png, and an output format of e.g. -of lavf -ovc lavc -lavcopts vcodec=libx264 -o whatever.mov. If you want to dub in audio you can use -audiofile whatever.mp3, and then either -acodec copy if you want it to be MP3 in the movie as well, or perhaps -acodec faac (and -faacopts) if the audio format in the movie needs to be AAC. There are lots of different options to tweak and things to learn but it's pretty much the ideal tool for the job. FFmpeg is nicer to use in a lot of ways, but it doesn't have the mf:// input mode, which makes assembling a video from frames a lot more painful.