HLS Stream
HLS Stream
Hello Steipal,
Wanted to create segmented HLS stream with m3u8 and ts files but not able to get proper command, can you please help?
Our requirement is to create file with three different bit rates and resolution (360x240_300Kbps, 640x480_600Kbps and 800x600_1Mbps), not sure this can be done through FFMPEG.
Need your suggestion.
Thanks
Vijay
Wanted to create segmented HLS stream with m3u8 and ts files but not able to get proper command, can you please help?
Our requirement is to create file with three different bit rates and resolution (360x240_300Kbps, 640x480_600Kbps and 800x600_1Mbps), not sure this can be done through FFMPEG.
Need your suggestion.
Thanks
Vijay
Re: HLS Stream
I have not tried creating HLS with ffmpeg but a quick google search indicate that this is possible. What have you tried with ffmpeg so far?
-steipal
-steipal
Re: HLS Stream
I had tried below commands.
-c:v libx264 -b:v 128k -flags -global_header -map 0 -f segment -segment_time 10 -segment_list test.m3u8 -segment_format mpegts
If I used above command with extension .ts, file get transcoded with .ts output without segmented. I am getting only one file in TS format. If I used m3u8 extension, FFAStrans showing error. Not sure about how to add three different bit rate and resolution.
-c:v libx264 -crf 18 -profile:v baseline -maxrate 1000k -bufsize 1835k -pix_fmt yuv420p -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1
I had also tried above command. I am confused about how to use the proper command.
Vijay
-c:v libx264 -b:v 128k -flags -global_header -map 0 -f segment -segment_time 10 -segment_list test.m3u8 -segment_format mpegts
If I used above command with extension .ts, file get transcoded with .ts output without segmented. I am getting only one file in TS format. If I used m3u8 extension, FFAStrans showing error. Not sure about how to add three different bit rate and resolution.
-c:v libx264 -crf 18 -profile:v baseline -maxrate 1000k -bufsize 1835k -pix_fmt yuv420p -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1
I had also tried above command. I am confused about how to use the proper command.
Vijay
Re: HLS Stream
Usually, when a custom command fail in FFAStrans, it's because ffmpeg fail and 99 times out of 100 it's because the user has supplied invalid ffmpeg options that FFAStrans can not fix. I have tried your command and and it seem your initial issue is with ffmpeg, not FFAStrans. Now, I don't have the time or resources to google around to find the correct ffmpeg-options for you, so I need you to supply a working example of what you want to acomplish using only ffmpeg.exe in command prompt. Once you have that working, I will surely assist you in getting it to work in FFAStrans. Using the "Custom FFmpeg"-encoder in FFAStrans presupposes good knowledge of using ffmpeg. So your mantra should always be to test your ffmpeg options with ffmpeg.exe in command prompt before adopting it to FFAStrans.
You can find ffmpeg.exe in your "FFAStrans\Processors\FFmpeg" folder.
-steipal
You can find ffmpeg.exe in your "FFAStrans\Processors\FFmpeg" folder.
-steipal
Re: HLS Stream
Hi Steipal,
I am able to create HLS stream using below command.
-c:v libx264 -s 320x240 -b:v 300k -maxrate 300k -bufsize 400k -pix_fmt yuv420p -refs 1 -profile:v baseline -level 3 -g 36 -sc_threshold 0 -flags -global_header -movflags +faststart -c:a aac -strict experimental -ar 48000 -b:a 64000 -ac 2 -map 0 -f segment -segment_time 10 -segment_list "C:\Test\CA Test\HLS\Outbox\300Kbps\300.m3u8" -segment_format mpegts "C:\Test\CA Test\HLS\Outbox\300Kbps\300_%05d.ts"
I have created three adaptive bitrates using three different workflows as per below. I am getting three m3u8 files along with .ts files in three particular folder.
Now I am facing one more issue, as per the HLS package requirement I need to create main m3u8 file which can play three adaptive bitrate as per the net speed. Do you suggest on this.
I am able to create HLS stream using below command.
-c:v libx264 -s 320x240 -b:v 300k -maxrate 300k -bufsize 400k -pix_fmt yuv420p -refs 1 -profile:v baseline -level 3 -g 36 -sc_threshold 0 -flags -global_header -movflags +faststart -c:a aac -strict experimental -ar 48000 -b:a 64000 -ac 2 -map 0 -f segment -segment_time 10 -segment_list "C:\Test\CA Test\HLS\Outbox\300Kbps\300.m3u8" -segment_format mpegts "C:\Test\CA Test\HLS\Outbox\300Kbps\300_%05d.ts"
I have created three adaptive bitrates using three different workflows as per below. I am getting three m3u8 files along with .ts files in three particular folder.
Now I am facing one more issue, as per the HLS package requirement I need to create main m3u8 file which can play three adaptive bitrate as per the net speed. Do you suggest on this.
- Attachments
-
- HLS.jpg (45 KiB) Viewed 16336 times
Re: HLS Stream
Ok, now I think see where you're trying to accomplish. HLS is not something I'm very familiar with but googling around it seems you want to create a m3u8 text file that looks something like this example? (Might that be a correct assumption?)
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=921600,RESOLUTION=1280x720
900.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=614400,RESOLUTION=640x360
600.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=307200,RESOLUTION=320x240
300.m3u8
-steipal
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=921600,RESOLUTION=1280x720
900.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=614400,RESOLUTION=640x360
600.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=307200,RESOLUTION=320x240
300.m3u8
-steipal
Re: HLS Stream
One more problem is when I put extension .ts, I am getting one more file with .ts extension as per source duration. This file actually not require. If I haven't put anything in the extension I am getting file with .avi extension.
Re: HLS Stream
Well, I have one bad and one good news for you.
The bad: You cannot create this file using just the built in features of the current version.
The good: The upcoming version 0.7.0 features a text-file generator. With this you can generate a text file with the content you require.
The "Custom FFmpeg"-encoder is hardcoded to output a destination file with the same name as the original. But this not what you want so the next version will omit this if no extension is entered in the extension field. This will solve the problem with the extra avi-file creation.
-steipal
The bad: You cannot create this file using just the built in features of the current version.
The good: The upcoming version 0.7.0 features a text-file generator. With this you can generate a text file with the content you require.
The "Custom FFmpeg"-encoder is hardcoded to output a destination file with the same name as the original. But this not what you want so the next version will omit this if no extension is entered in the extension field. This will solve the problem with the extra avi-file creation.
-steipal
Re: HLS Stream
Hi Steipal,
I have downloaded the version 0.7.0, really appreciate your hardwork
Please suggest how can I create m3u8 text file as you mentioned.
Thanks
Vijay
I have downloaded the version 0.7.0, really appreciate your hardwork
Please suggest how can I create m3u8 text file as you mentioned.
Thanks
Vijay