0

I am trying to find/use a Java Library that wraps around FFMPEG to create HLS compatible segments and metadata files along with a master metadata file.

Most existing libraries perform encoding just fine and allow extra functions for additional audio/video parameters. But I could not find a good way for using them to create a master metadata file and other resolution/bandwidth/bitrate based metadata + segments.

One way that I am planning to go about it is running the piece of code that performs HLS for me multiple times to suit the different bitrates and then programmatically look at the metadata files to compose the master metadata file. But that adds room for errors.

If you know of an existing library that can do it for me. Please share the details. It would really help out.

Libraries:

Documentation (see Section Master Playlist) https://developer.apple.com/library/content/referencelibrary/GettingStarted/AboutHTTPLiveStreaming/about/about.html

FFMPEG command line code that works for me

ffmpeg -loglevel debug -threads 4 -vsync 1 -i 'id.mp4' -vf yadif -g 29.97 -r 29.97 -b:v:0 5250k -c:v libx264 -rc:v vbr_hq -pix_fmt yuv420p -profile:v main -level 4.1 -rc-lookahead 32 -forced-idr 1 -b:v:1 4200k -c:v libx264 -rc:v vbr_hq -pix_fmt yuv420p -profile:v main -level 4.1 -rc-lookahead 32 -forced-idr 1 -b:v:1 3150k -c:v libx264 -rc:v vbr_hq -pix_fmt yuv420p -profile:v main -level 4.1 -rc-lookahead 32 -forced-idr 1 -b:a:0 256k -b:a:0 192k -b:a:0 128k -c:a aac -ar 48000  -map 0:v -map 0:a:0 -map 0:v -map 0:a:0 -map 0:v -map 0:a:0 -f hls -var_stream_map "v:0,a:0  v:1,a:1 v:2,a:2" -master_pl_name  master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size 0 -master_pl_publish_rate 10 -hls_flags delete_segments+discont_start+split_by_time "vs%v_manifest.m3u8"

Any help would be appreciated. Thanks in advance.

Caffeinated Coder
  • 670
  • 1
  • 8
  • 24

0 Answers0