Open sasquatch74 opened 6 years ago
@sasquatch74 I'm facing the same issue. Did you find a solution/workaround?
To be honest, this isn't a scenario I have tested (different frame rates). So it may very well be an issue with the Bento4 packager. I will try this use case and followup.
@barbibulle thanks :)
Up until now, we had all our videos up to 1080p, all being 30fps and a fixed 60 frames keyframe interval, but now we're trying to add 1080p@60 and 1440p@60 with a 120 frame keyframe interval to the mix, but with them added, mp4dash complains about the alignment. I tried forcing mp4fragment to a 2s segment size for both, but with the same result. As far as I understand, both align at 2s, despite the different framerate.
@maetthu We couldn't make Bento4 packager work when source mp4 files had different frame rates. We used a different packager (the one from Unified Streaming - this is not free) to get it to work.
@barbibulle Did you have a chance to look into this? No worries if not, it's just that we will start with our encoding project soon and it would be nice to know if multiple framerates is something you'd consider worth supporting in the Bento4 packager.
@maetthu Sorry for not having looked at this earlier. Would it be possible for send me a link to some sample files that I could use to easily replicate the issue on my side? This would save me some time. Thanks.
@barbibulle sure! thanks for looking at it :slightly_smiling_face:
These are streaming versions I transcoded from 1080p@60fps version of the Big Buck Bunny video:
Steps to reproduce:
$ mp4fragment 1080p_60.mp4 1080p_60.fmp4
found regular I-frame interval: 120 frames (at 60.000 frames per second)
$ mp4fragment 720p_30.mp4 720p_30.fmp4
found regular I-frame interval: 60 frames (at 30.000 frames per second)
$ mp4dash -o out/ -f --mpd-name=master.mpd --hls *.fmp4
Parsing media file 1: 1080p_60.fmp4
Parsing media file 2: 720p_30.fmp4
WARNING: video sample count mismatch between "File 2#2" and "File 1#2"
ERROR: video tracks are not aligned ("File 2#2" differs from File 1#2)
@barbibulle did you have a chance looking into it?
I have fixed this on master (still haven't pushed a new set of pre-compiled binaries). Let me know if this works for you.
@barbibulle Thanks for the fix on this. I'm however facing this issue when running mp4dash
for 360, 480 and 720p renditions of my mp4 file to generate an ABR stream. I'm using the latest binaries for macOS but still facing this issue. What can I do to run it successfully?
Same issue here
Same problem here, the last Linux release returns the same error.
Facing the same issue. can someone help me? not sure how and what to fix FFmpeg Transcoding:
ffmpeg -loglevel error -i source.mp4 \ -map 0:v \ -movflags +faststart -vsync 1 \ -c:v libx264 \ -s 256x144 \ -g 30 \ -profile:v main \ -b:v 244894 \ -y 1.mp4
ffmpeg -loglevel error -i source.mp4 \ -map 0:v \ -movflags +faststart -vsync 1 \ -c:v libx264 \ -s 416x234 \ -b:v 424101 \ -g 30 \ -profile:v main \ -y 2.mp4
ERROR: video tracks are not aligned ("File 2#1" differs from File 1#1)
debug output of mp4dash: Segment Count = 56 Type = video Sample Count = 2767 Average segment bitrate = 253547 Max segment bitrate = 645680 Required bandwidth = 386983 Average segment duration = 2.001481481481483
Segment Count = 56
Type = video
Sample Count = 2767
Average segment bitrate = 439965
Max segment bitrate = 1136650
Required bandwidth = 721261
Average segment duration = 2.001481481481483
Hi @baloda. I solved the problem with a fixed fps (24FPS) and segments of two seconds (gop = 2 * 24 = 48). My FFMPEG parameters are:
-c:v libx264 -preset faster -x264opts keyint=48:min-keyint=48:no-scenecut -strict -2 -r 24
In mp4fragment, I also used the parameter --fragment-duration 2000
Issue should be due to GOP Misalignment
Adding following options to ffmpeg
command solved my issue
-keyint_min 48 -g 48 -sc_threshold 0
What these do? -keyint_min 48: keyint represents the key frame (IDR frame) interval. This option limits the IDR frame interval to a minimum of 48 frames, which is the same length as the previously set GOP. -sc_threshold 0: Disable scene recognition, that is, disable automatic addition of IDR frames
Any solve ?
I am facing the following issue:
I understand that mp4dash requires the key-frames to align, but when you have files with different frame rates, the key frames do not align by frame count but they do align if you consider the time in seconds or milliseconds.
What am I doing wrong?