Hi:
I have a large number of videos I am converting to a standardized HLS video
with a particular format and frame rate and I’ve automated the process. The
source videos are in many different formats (16:9, 4:3), densities 720, 1080,
480 and frame rates.
After it completed and I tested the videos I found that about 6% of them were
shortened and lost audio/video sync in the conversion. They also take an
inordinately long time to start streaming.
Examining the source videos, it seems that many of them were at unusual frame
rates (like15, 24, 25…)
I’ve put a test mp4 that I sourced from and the resulting m3u8 video up in
http://ipziptv.com/testing/test.mp4 and http://iziptv.com/testing/video.m3u8
Below is mediainfo on the source video (263.8 seconds long) and the converted
m3u8 video (220 seconds long), the script I converted with and the ffmpeg
output.
Any advice on how I can successfully convert these would be appreciated.
==Start of
output=
Here is mediainfo’s view of that mp4. You can see that (for some reason) it is
at 25FPS.
mediainfo test.mp4
General
Complete name: test.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size: 46.9 MiB
Duration : 4 min 23 s
Overall bit rate : 1 491 kb/s
Writing application : Lavf57.83.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames: 4 frames
Codec ID : avc1
Codec ID/Info: Advanced Video Coding
Duration : 4 min 23 s
Bit rate : 1 354 kb/s
Width: 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth: 8 bits
Scan type: Progressive
Bits/(Pixel*Frame) : 0.059
Stream size : 42.6 MiB (91%)
Writing library : x264 core 148 r2795 aaa9aa8
Encoding settings: cabac=1 / ref=3 / deblock=1:0:0 /
analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 /
me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 /
fast_pskip=1 / chroma_qp_offset=-2 / threads=22 / lookahead_threads=3 /
sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 /
constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1
/ weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40
/ intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60
/ qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 4 min 23 s
Bit rate mode: Constant
Bit rate : 132 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate: 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 4.10 MiB (9%)
Language : English
Default : Yes
Alternate group : 1
Here is mediainfo’s view of the first segment of the m3u8. You can see that it
is at 29.97FPS.
mediainfo video.ts
General
ID : 1 (0x1)
Complete name: video.ts
Format : MPEG-TS
File size: 1.53 MiB
Duration : 5 s 939 ms
Overall bit rate mode: Variable
Overall bit rate : 2 143 kb/s
Video
ID