[FFmpeg-user] how to transcode mp4 file into hls stream

qw applemax82 at 163.com
Mon Apr 25 03:39:41 CEST 2016


Hi,
 
I use the following command to do transcoding from mp4 file into hls stream:
 
ffmpeg -y -i input.mp4 -vbsf h264_mp4toannexb -c:v libx264 -c:a libfdk_aac -f hls -hls_list_size 10 -hls_wrap 10 ./output.m3u8
 
Then ffmpeg outputs 10 ts files, but there is big different between the size of 10 ts files.
 
-rw-r--r--. 1 root root      381 Apr 25 09:37 output.m3u8
-rw-r--r--. 1 root root  1217112 Apr 25 09:37 output0.ts
-rw-r--r--. 1 root root   306252 Apr 25 09:37 output1.ts
-rw-r--r--. 1 root root   469812 Apr 25 09:37 output2.ts
-rw-r--r--. 1 root root   308508 Apr 25 09:37 output3.ts
-rw-r--r--. 1 root root   477708 Apr 25 09:37 output4.ts
-rw-r--r--. 1 root root   128968 Apr 25 09:37 output5.ts
-rw-r--r--. 1 root root   140812 Apr 25 09:37 output6.ts
-rw-r--r--. 1 root root   211500 Apr 25 09:37 output7.ts
-rw-r--r--. 1 root root   220900 Apr 25 09:37 output8.ts
-rw-r--r--. 1 root root   192512 Apr 25 09:37 output9.ts
-
How to make 10 ts files so that each ts file has almost same size?
 
Thanks!
 
B.R.
 
Andrew


More information about the ffmpeg-user mailing list