New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generation of corrupt assets, with conflicting number of subsegments #862
Comments
Hi, this issue is blocking our release at the moment, and happens with many input audio files on our end. Do you have any ideas that could help us figure out what could be happening? |
@ronak2121 @copo2496 It is hard to debug with just metadata. Are you able to generate a sample input that can re-produce the problem and send it to us at shaka-packager-issues@google.com? |
@kqyang we were able to reproduce the issue using a wave audio file, we've uploaded the file and made it publicly accessible here: https://audible-audio-production-samples.s3.amazonaws.com/shaka/shaka_test.mp4. Here was the output on OSX: in=shaka_test.mp4,stream=audio,output=testOut4.mp4,playlist_name=test4.m3u8 --hls_master_playlist_output test4_master.m3u8 --segment_duration 0.9752380952380952 --fragment_duration 0.9752380952380952 The file was not playable, and we see the "Number of subsegment ranges does not match the number of subsegments notified to" warning in the output. |
To note a fragment size of 9.752380952380952 seems to work, so it seems like there's some problem with math or something that's causing this. |
FYI that we found this is not caused by any incorrect math; but because of the limitation in the sidx atom that the reference_count be a short. This is causing you to drop all of the extra segments here. |
Question for you @kqyang when I specify to use the HLS LIVE manifest type, you still generate a sidx atom. Also, I see you have options to disable sidx generation for the DASH LIVE profile, but I don't see how to specify it. |
@ronak2121 The flag is |
Hey @kqyang I figured that out and have observed a few things:
in a command like so: packager-osx in=input.mp4,stream=audio,output=testOut4.mp4,playlist_name=test4.m3u8 --hls_master_playlist_output test4_master.m3u8 --segment_duration 0.9752380952380952 --fragment_duration 0.9752380952380952 --nogenerate_sidx_in_media_segments
How hard would it be for you to ignore sidx generation for HLS/FairPlay? Sidx isn't used by HLS/FairPlay, even in CMAF mode. We're getting ready to email you on the email alias above about this, but curious if you could help us here. |
What is the error you are seeing? It should work for both DASH or HLS. It could be caused by a different problem. There may be a rounding error when trying to generate the segments. Can you try setting |
The error we see is that you create only 991 segments when there should be more than 65k. I just tried your suggestion: packager-osx in=input.mp4,stream=audio,output=testOut4.mp4,playlist_name=test4.m3u8 --hls_master_playlist_output test4_master.m3u8 --segment_duration 0.9752380952380952 --fragment_duration 1 --hls_playlist_type LIVE --nogenerate_sidx_in_media_segments and packager-osx in=input.mp4,stream=audio,output=testOut4.mp4,playlist_name=test4.m3u8 --hls_master_playlist_output test4_master.m3u8 --segment_duration 0.9752380952380952 --fragment_duration 1 --nogenerate_sidx_in_media_segments and neither of them work to remove generation of sidx. Keep in mind that we want to generate VOD streams, not LIVE here. So if we switch to LIVE, it would be only a workaround for this issue. But with the downside of being very slow to segment our content. |
Hey @kqyang FYI that we've emailed you guys about this issue privately. Let's continue the conversation there. |
@ronak2121 Thanks for the detail information. You are right that
There are two options to workaround / fix the problem:
We will provide a fix soon. |
The reference count in 'sidx' box is a uint16 field, which allows at most 0xFFFF entries, i.e. at most 0xFFFF subsegments, which is roughly 18 hours for one second segments. Do not fail packaging when it happens. Instead, generate a warning and truncate the number of references to 0xFFFF instead. Note that the actual number of mp4 fragments in the mp4 file can still be more than 0xFFFF. The stream will not play to the end in DASH, but it will play successfully in HLS. Workarounds #862. Change-Id: Ib3930418d1528df1f9ea64cda0d0ebaa78d26abb
I.e. the flag --generate_sidx_in_media_segments, --nogenerate_sidx_in_media_segments work for both single-segment and multi-segment mode with this change. Related to #862. Change-Id: Icd27fd00e8e036ba0c4709b48650372429cc0351
System info
Operating System: Amazon Linux 2012 4.9 Kernel
Shaka Packager Version: v2.4.3 dd98700
Issue and steps to reproduce the problem
Packager Command: ./packager-linux in=[obfuscated].mp4,stream=audio,output=[obfuscated].mp4,playlist_name=[obfuscated].m3u8 --hls_master_playlist_output [obfuscated]_master.m3u8 --segment_duration 0.9752380952380952 --fragment_duration 0.9752380952380952
What is the expected result?
Generate an FMP4 asset which can be played
What happens instead?
The FMP4 asset is not playable and we get the following warning during packaging:
Number of subsegment ranges (13445) does not match the number of subsegments notified to OnNewSegment() (78981).
Input Files:
The file passed into the packager was proprietary and so we cannot share it, but we can share metadata about the file obtained using ffmpeg and ffprobe:
ffmpeg version 4.0.1 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '[obfuscated].mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2020-11-17T20:00:32.000000Z
Duration: 21:23:44.40, start: 0.000000, bitrate: 63 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 62 kb/s (default)
Metadata:
creation_time : 2020-11-17T20:00:25.000000Z
handler_name : aac@GPAC0.7.0-revrelease
Stream mapping:
Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
encoder : Lavf58.12.100
Stream #0:0(und): Audio: pcm_s16le, 22050 Hz, stereo, s16, 705 kb/s (default)
Metadata:
creation_time : 2020-11-17T20:00:25.000000Z
handler_name : aac@GPAC0.7.0-revrelease
encoder : Lavc58.18.100 pcm_s16le
size=N/A time=21:23:44.39 bitrate=N/A speed=1.88e+03x
video:0kB audio:6634328kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
ffprobe version 4.0.1 Copyright (c) 2007-2018 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '[obfuscated].mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2020-11-17T20:00:32.000000Z
Duration: 21:23:44.40, start: 0.000000, bitrate: 63 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 62 kb/s (default)
Metadata:
creation_time : 2020-11-17T20:00:25.000000Z
handler_name : aac@GPAC0.7.0-revrelease
The text was updated successfully, but these errors were encountered: