Create a m3u8 file with several qualities using ffmpeg? - ffmpeg

I would like to create a m3u8 file like this one using ffmpeg (with all its qualities)
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=590000,RESOLUTION=480x270,CODECS="mp4a.40.2,avc1.77.30",CLOSED-CAPTIONS=NONE
https://videos-f.jwpsrv.com/content/conversions/LOPLPiDX/videos/jumBvHdL-24721146.mp4.m3u8?token=0_5b217886_0x0f48d5705daaf23a9dec01a5ef8298523a0565df
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4300000,RESOLUTION=1920x1080,CODECS="mp4a.40.2,avc1.77.30",CLOSED-CAPTIONS=NONE
https://videos-f.jwpsrv.com/content/conversions/LOPLPiDX/videos/jumBvHdL-24721151.mp4.m3u8?token=0_5b217886_0xdc0d89087f519e76b149d7524f1ace8b2cde710f
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2050000,RESOLUTION=1280x720,CODECS="mp4a.40.2,avc1.77.30",CLOSED-CAPTIONS=NONE
https://videos-f.jwpsrv.com/content/conversions/LOPLPiDX/videos/jumBvHdL-24721148.mp4.m3u8?token=0_5b217886_0x6bda9f1d380f2a579f3afe5fa771782112210d4a
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=920000,RESOLUTION=720x406,CODECS="mp4a.40.2,avc1.77.30",CLOSED-CAPTIONS=NONE
https://videos-f.jwpsrv.com/content/conversions/LOPLPiDX/videos/jumBvHdL-24721147.mp4.m3u8?token=0_5b217886_0xadf9ee242ffa3ffa30103f2178d9274bd63f0184
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=330000,RESOLUTION=320x180,CODECS="mp4a.40.2,avc1.77.30",CLOSED-CAPTIONS=NONE
https://videos-f.jwpsrv.com/content/conversions/LOPLPiDX/videos/jumBvHdL-24721145.mp4.m3u8?token=0_5b217886_0x7379ef13ee1e9ae13bb015966c2167293eefb451
Does anyone know the magic order? (I use a vps that is under ubuntu)
Thank you in advance for any help

Related

End Part of .WAV file is not converted to .MP3 file

As you can see the in the above image, the end part of the .wav file is not represented in the mp3 file. Here, I am making use of avcodec_decode_audio4() api to decode each packet, and using lame_encode_buffer() api to encode it in mp3 format. Here, I am seeing this issue for MONO streams( 1.wav -> 1.mp3 ). I just wanted to know why is this occuring, even when I am providing all the .wav file content. I am suspecting there is some caching that is happening, due to which I am unable to get whole data into the mp3 file. Any help here would be appreciated.
Add a section of silence at the end of the WAV file then reconvert to mp3

I want to implement picture-in-picture function with ffmpeg, can anyone help me?

in ffmpeg command, it's very simple:
ffmpeg.exe -i input.mp4 -i timer.mp4 -filter_complex "[1:v]crop=w=160:h=110:x=650:y=300[timer4.mp4]; [timer4.mp4]scale=30:30[timer-30m30.mp4]; [0][timer-30m30.mp4]overlay=W-w:10" output-video-overlay.mp4
but now I need to implement with the ffmpeg api, I have searched all day, but still not found any useful impormation, can any one help me? thank you very much.
There is not really "an API" to do this. It is a few dozen lines of code. ffmpeg supplies examples fo how to use the filter graph in the examples folder included in the source code.
see: https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/filtering_video.c

FFmpeg concatenate with seeking and no re-encoding

Is it possible to concatenate several .ts files while applying seek --s to one of the input files ? I'm trying to achieve this without re-encoding.
Any ideas will be appreciated
Thanks

Merge two or more video files of any format using FFmpeg in iPhone

Is there any direct command in FFmpeg to merge videos in iPhone. I need to do this programmatically by setting the command line argument to the FFmpeg containing the input movie files to merge and the output file name.
I just wanted to merge two .mov movie files using FFmpeg. I was trying to do this in iPhone where I was creating a command line argument containing two video fies to merge as an input parameter and the destination video file as output parameter and then calling main method of FFmpeg. But for merging videos using FFmpeg first we need to convert it to mpg format and then pass the movie files in mpg format in the command line format. This is the only way found to merge the video using FFmpeg as far as I know. Is there anybody out there done this in a different way?
To paraphrase the FFmpeg FAQ entry "How can I join video files?"
Transcode to a format that supports direct concatenation (MPEG-1, MPEG-2 PS, DV) and then back to the desired format.
Use the concat protocol to get the same effect without the intermediate files.
Use named pipes to avoid the intermediate files.
Do any of the above with the lossless yuv4mpegpipe or raw formats.

What's the VOBsub subtitle format?

Where can I find documentation/sample code of the VOBsub subtitles format? The one that's an .idx and a .sub file.
I need to create a program that generates those subtitles. I've been looking on Google but only found how to rip them from DVD.
Thanks
VOBsub extracts the DVD subtitles raw PES from a DVD and dumps this to a .sub file. It also creates a .idx Index file with the times and byteoffsets for each and every single subtitle. The format has support for multiple tracks and can also be embedded in MP4 (by Nero) and Matroska files.
Technical specs vobsub
Technical specs from Matroska.org
Example files: Specs_and_idx-sub_files.rar
Have a look at these open source implementations:
BDSup2Sub (Java)
Subtitle Edit (C#)
guliverkli by gabest (C++) check out VSFilter and VSRip; original implementation
Son2VobSub.rar (C++)
And then there are the media players like VLC. You can also check out these threads on doom9:
http://forum.doom9.org/archive/index.php/t-87171.html
http://forum.doom9.org/archive/index.php/t-99815.html
I think your best approach would be to have a look at the sourcecode of some of the open-source media players. Some of them will have the code to interpret an .idx or .sub subtitle file.
This might be a useful starting point:
http://sourceforge.net/projects/guliverkli/

Resources