Closed madhudvisa closed 7 years ago
Those bitrates are definitely way out, can you paste the command you used
Hi
The command is below.
I suspect the difference may be in the Apple standard they are considering the total bitrate [audio + video] but the script is just specifying the video bitrate without considering the audio bitrate.
So to get a stream that matches the current standards [which has different video and audio bitrates and framerates for the different streams, you would need to be able to specify:
for each variant.
HLS-Stream-Creator.sh -i 1.mp4 -s 10 -b 64,128,256
It is making ffmpeg commands like:
ffmpeg -i 1.mp4 -loglevel verbose -y -vcodec libx264 -acodec aac -threads 0 -map 0 -flags -global_header -f segment -segment_list ./output/1.mp4_64.m3u8 -segment_time 10 -segment_format mpeg_ts -b:v 64k ./output/1.mp464%05d.ts
ffmpeg -i 1.mp4 -loglevel verbose -y -vcodec libx264 -acodec aac -threads 0 -map 0 -flags -global_header -f segment -segment_list ./output/1.mp4_128.m3u8 -segment_time 10 -segment_format mpeg_ts -b:v 128k ./output/1.mp4128%05d.ts
ffmpeg -i 1.mp4 -loglevel verbose -y -vcodec libx264 -acodec aac -threads 0 -map 0 -flags -global_header -f segment -segment_list ./output/1.mp4_256.m3u8 -segment_time 10 -segment_format mpeg_ts -b:v 256k ./output/1.mp4256%05d.ts
The whole thing is below:
seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'sleep 1 ffmpeg version N-80054-gccc3f4e-syslintffmpeg version N-80054-gccc3f4e-syslintffmpeg version N-80054-gccc3f4e-syslint Copyright (c) 2000-2016 the FFmpeg developers Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) Copyright (c) 2000-2016 the FFmpeg developers configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint libavutil 55. 24.100 / 55. 24.100 libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 42.100 / 57. 42.100 libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 42.100 / 57. 42.100 libavformat 57. 36.100 / 57. 36.100 libavcodec 57. 42.100 / 57. 42.100 libavformat 57. 36.100 / 57. 36.100 libavdevice 57. 0.101 / 57. 0.101 libavformat 57. 36.100 / 57. 36.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4': Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4': Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4': Metadata: Metadata: Metadata: major_brand : major_brand : major_brand : M4V M4V M4V
minor_version : minor_version : minor_version : 000
compatible_brands: compatible_brands: compatible_brands: isomavc1M4V mp42M4A isomavc1M4V mp42M4A isomavc1M4V mp42M4A
creation_time : creation_time : creation_time : 2011-10-22 03:48:482011-10-22 03:48:482011-10-22 03:48:48
album : album : album : The Mac Video ArchiveThe Mac Video ArchiveThe Mac Video Archive
artist : artist : artist : Apple Computer // massanti.comApple Computer // massanti.comApple Computer // massanti.com
comment : comment : comment : Professionally encoded by Diego MassantiProfessionally encoded by Diego MassantiProfessionally encoded by Diego Massanti
date : date : 20072007 title : /home/ktube/off_web/1
Duration: title : 00:00:30.12/home/ktube/off_web/1, start: date : 0.0000002007 Duration: , bitrate: 00:00:30.12251 kb/s title : , start: /home/ktube/off_web/10.000000 , bitrate: Duration: 251 kb/s00:00:30.12 , start: 0.000000, bitrate: 251 kb/s Stream #0:0 Stream #0:0(eng)(eng): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p, 352x288 (0x0) [SAR 1:1 DAR 11:9], 202 kb/s: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p, 352x288 (0x0) [SAR 1:1 DAR 11:9], 202 kb/s, , Stream #0:0(eng): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p, 352x288 (0x0) [SAR 1:1 DAR 11:9], 202 kb/s, 30 fps, 30 fps, 30 tbr, 30 tbr, 30 fps, 30k tbn30k tbn30 tbr, (default) (default)30k tbn
(default) Metadata: Metadata:
creation_time : creation_time : Metadata: 2011-10-22 03:48:482011-10-22 03:48:48 creation_time :
2011-10-22 03:48:48 handler_name : handler_name : GPAC ISO Video HandlerGPAC ISO Video Handler handler_name :
GPAC ISO Video Handler Stream #0:1 Stream #0:1 Stream #0:1(eng)(eng)(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s: Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s: Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s (default) (default) (default)
Metadata:
Metadata:
Metadata:
creation_time : creation_time : creation_time : 2011-10-22 03:48:482011-10-22 03:48:482011-10-22 03:48:48
handler_name : handler_name : handler_name : GPAC ISO Audio HandlerGPAC ISO Audio HandlerGPAC ISO Audio Handler
[graph 0 input from stream 0:0 @ 0x12e10a0] [graph 0 input from stream 0:0 @ 0x84c0a0] w:352 h:288 pixfmt:yuv420p tb:1/30000 fr:30/1 sar:1/1 sws_param:flags=2 w:352 h:288 pixfmt:yuv420p tb:1/30000 fr:30/1 sar:1/1 sws_param:flags=2 [graph 0 input from stream 0:0 @ 0x23370a0] w:352 h:288 pixfmt:yuv420p tb:1/30000 fr:30/1 sar:1/1 sws_param:flags=2 [graph 1 input from stream 0:1 @ 0x84fbc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3 [graph 1 input from stream 0:1 @ 0x12e4bc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3 [graph 1 input from stream 0:1 @ 0x233abc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3 [libx264 @ 0x85f420] [libx264 @ 0x12f4420] using SAR=1/1 using SAR=1/1 [libx264 @ 0x234a420] using SAR=1/1 [libx264 @ 0x85f420] using cpu capabilities: none! [libx264 @ 0x12f4420] using cpu capabilities: none! [libx264 @ 0x234a420] using cpu capabilities: none! [libx264 @ 0x12f4420] profile High, level 1.3 [libx264 @ 0x85f420] profile High, level 1.3 [libx264 @ 0x234a420] profile High, level 1.3 [segment @ 0x12b2720] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Last message repeated 1 times [segment @ 0x12b2720] Selected stream id:0 type:video [segment @ 0x81d720] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Last message repeated 1 times [segment @ 0x81d720] Selected stream id:0 type:video [mpegts @ 0x1f4be00] muxrate VBR, pcr every 3 pkts, sdt every 200, pat/pmt every 40 pkts Output #0, segment, to './output/1.mp4256%05d.ts': Metadata: major_brand : M4V minor_version : 0 [mpegts @ 0x14b6e00] compatible_brands: muxrate VBR, isomavc1M4V mp42M4A pcr every 3 pkts, sdt every 200, pat/pmt every 40 pkts
title : Output #0, segment, to './output/1.mp4_128_%05d.ts':
/home/ktube/off_web/1 Metadata:
major_brand : album : M4V The Mac Video Archive
minor_version : artist : 0Apple Computer // massanti.com
compatible_brands: comment : isomavc1M4V mp42M4A Professionally encoded by Diego Massanti
title : date : /home/ktube/off_web/1
album : The Mac Video Archive2007
artist : encoder : Apple Computer // massanti.comLavf57.36.100
comment : Professionally encoded by Diego Massanti
date : 2007
encoder : Lavf57.36.100
Stream #0:0(eng): Video: h264, 1 reference frame, yuv420p, 352x288 (0x0) [SAR 1:1 DAR 11:9], q=2-31, 256 kb/s, 30 fps, 90k tbn Stream #0:0 (default)(eng)
: Video: h264, 1 reference frame, yuv420p, 352x288 (0x0) [SAR 1:1 DAR 11:9], q=2-31, 128 kb/s Metadata: , creation_time : 2011-10-22 03:48:48 30 fps, handler_name : 90k tbnGPAC ISO Video Handler (default)
encoder : Metadata:
Lavc57.42.100 libx264 creation_time : 2011-10-22 03:48:48 Side data:
handler_name : cpb: GPAC ISO Video Handlerbitrate max/min/avg: 0/0/256000 buffer size: 0 vbv_delay: -1
encoder : Lavc57.42.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/128000 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : Stream #0:12011-10-22 03:48:48(eng)
: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s handler_name : (default)GPAC ISO Audio Handler
Metadata:
encoder : creation_time : Lavc57.42.100 aac2011-10-22 03:48:48
Stream mapping: handler_name : GPAC ISO Audio Handler Stream #0:0 -> #0:0[segment @ 0x2308720] (h264 (native) -> h264 (libx264))Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. encoder : Stream #0:1 -> #0:1Last message repeated 1 times (aac (native) -> aac (native))Stream mapping:
Stream #0:0 -> #0:0 Last message repeated 1 times (h264 (native) -> h264 (libx264))Press [q] to stop, [?] for help [segment @ 0x2308720] Selected stream id:0 type:video Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help [mpegts @ 0x2fa1e00] muxrate VBR, pcr every 3 pkts, sdt every 200, pat/pmt every 40 pkts Output #0, segment, to './output/1.mp464%05d.ts': Metadata: major_brand : M4V minor_version : 0 compatible_brands: isomavc1M4V mp42M4A title : /home/ktube/off_web/1 album : The Mac Video Archive artist : Apple Computer // massanti.com comment : Professionally encoded by Diego Massanti date : 2007 encoder : Lavf57.36.100 Stream #0:0(eng): Video: h264, 1 reference frame, yuv420p, 352x288 (0x0) [SAR 1:1 DAR 11:9], q=2-31, 64 kb/s, 30 fps, 90k tbn (default) Metadata: creation_time : 2011-10-22 03:48:48 handler_name : GPAC ISO Video Handler encoder : Lavc57.42.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/64000 buffer size: 0 vbv_delay: -1 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: creation_time : 2011-10-22 03:48:48 handler_name : GPAC ISO Audio Handler encoder : Lavc57.42.100 aac Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help 2 dup! 2 dup! *** 2 dup! [segment @ 0x2308720] segment:'./output/1.mp4_64_00000.ts' starts with packet stream:0 pts:6000 pts_time:0.0666667 frame:0 [segment @ 0x81d720] segment:'./output/1.mp4_128_00000.ts' starts with packet stream:0 pts:6000 pts_time:0.0666667 frame:0 [segment @ 0x12b2720] segment:'./output/1.mp4_256_00000.ts' starts with packet stream:0 pts:6000 pts_time:0.0666667 frame:0 frame= 65 fps=0.0 q=52.0 size=N/A time=00:00:01.96 bitrate=N/A dup=2 drop=0 spframe= 61 fps=0.0 q=47.0 size=N/A time=00:00:01.87 bitrate=N/A dup=2 drop=0 spframe= 61 fps=0.0 q=40.0 size=N/A time=00:00:01.87 bitrate=N/A dup=2 drop=0 sp+ '[' 3 -ne 0 ']'
seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
'seq 0 $pid_length
' I suspect the difference may be in the Apple standard they are considering the total bitrate [audio + video] but the script is just specifying the video bitrate without considering the audio bitrate.
That's certainly a possibility, though from memory the spec specifies that they should be considered seperately.
Can you try re-running the transcode but pass in -C so that a constant bitrate is used (rather than an average). Although those numbers seem too high for it to be the case, one possibility is that the average br is correct.
Could you also provide a ffprobe of a couple of the chunks that were generated for each bitrate?
As I've not heard back, I'm going to close this off.
If it's still an issue, please re-open with the requested output.
Hi
It seems to work well but seems to be creating video files that are way bigger than the set bitrates:
I checked a stream made with this at http://krishnatube.com/output/1.mp4_master.m3u8 and the apple mediastreamvalidator is giving the following error messages:
Error: Measured peak bitrate compared to master playlist declared value exceeds error tolerance --> Detail: Measured: 222.58 kb/s, Master playlist: 28.00 kb/s, Error: 87.42% --> Source: http://krishnatube.com/output/1.mp4_master.m3u8 --> Compare: 1.mp4_28.m3u8
--> Detail: Measured: 344.47 kb/s, Master playlist: 128.00 kb/s, Error: 62.84% --> Source: http://krishnatube.com/output/1.mp4_master.m3u8 --> Compare: 1.mp4_128.m3u8
--> Detail: Measured: 270.08 kb/s, Master playlist: 64.00 kb/s, Error: 76.30% --> Source: http://krishnatube.com/output/1.mp4_master.m3u8 --> Compare: 1.mp4_64.m3u8
--> Detail: Measured: 512.63 kb/s, Master playlist: 256.00 kb/s, Error: 50.06% --> Source: http://krishnatube.com/output/1.mp4_master.m3u8 --> Compare: 1.mp4_256.m3u8
Also is there any chance of being able to specify the frame rate? If original video is 60 frames per second for example to change that to 25 frames per second, maybe even different frames per second for the different variants?