Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7323 closed defect (worksforme)

aac decoder - file with errors in console (plays fine though) - Telekom 360° Apple HLS stream

Reported by: Djfe Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

If you look at the German Telekom's HLS streams with ffmpeg, then you can see:
The Main stream (2D) can be saved/played just fine.
If you look at one of the 2 360° streams, then ffmpeg's aac decoder errors, because the encoder seems to have used some still unknown features.
I'll leave it as defect though for now, since I can't be sure.
The audio plays fine in VLC and AIMP.
FFmpeg still shows errors when I try to copy again, after downloading and saving. (I haven't tested reencoding, yet)

The URLs might change till Monday, but you can get the most up-to-date URL at:
https://www.magenta-musik-360.de/parookaville-2018-4886
(Inspect the page with your browser and use the network tab to get the m3u8 address)

ffmpeg -i "https://streaming-magenta-music-360.akamaized.net/hls/live/573873/mm360_vr1/index.m3u8" -map 0:p:3 -c copy .\file.mp4
ffmpeg -i "https://streaming-magenta-music-360.akamaized.net/hls/live/573874/mm360_vr2/index.m3u8" -map 0:p:3 -c copy file.mp4

I'll attach the files and the (verbose) console logs.
Hopefully, they will help you in getting ffmpeg to support these kind of aac streams in the future :)

The errors I'm seeing:

aac container

[adts @ 0000026004067040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 34080 >= 34080

ts container

[mpegts @ 000001da3ba5d280] AAC bitstream not in ADTS format and extradata missing

mp4 container

[mp4 @ 000001df2d2cb600] aac bitstream error

in-case my attached aac streams are faulty (because ffmpeg doesn't support them, yet), then you still have some time to save some yourself/test on the live streams :)

Regards
Djfe

Attachments (7)

aac log.txt (10.9 KB ) - added by Djfe 6 years ago.
AAC Container Log
aac_log.txt (678.4 KB ) - added by Djfe 6 years ago.
AAC Container Log (the correct one)
PV1.aac (909.2 KB ) - added by Djfe 6 years ago.
AAC Container
mp4_low_log.txt (535.1 KB ) - added by Djfe 6 years ago.
MP4 Container Log (720p)
mp4_high_log.txt (215.7 KB ) - added by Djfe 6 years ago.
MP4 Container Log (2160p)
ts_low_log.txt (496.4 KB ) - added by Djfe 6 years ago.
TS Container Log (720p)
ts_high_log.txt (204.7 KB ) - added by Djfe 6 years ago.
TS Container Log (2160p)

Change History (16)

by Djfe, 6 years ago

Attachment: aac log.txt added

AAC Container Log

comment:1 by Djfe, 6 years ago

ups, I uploaded the wrong log, ignore the log before this comment pls

by Djfe, 6 years ago

Attachment: aac_log.txt added

AAC Container Log (the correct one)

by Djfe, 6 years ago

Attachment: PV1.aac added

AAC Container

by Djfe, 6 years ago

Attachment: mp4_low_log.txt added

MP4 Container Log (720p)

by Djfe, 6 years ago

Attachment: mp4_high_log.txt added

MP4 Container Log (2160p)

by Djfe, 6 years ago

Attachment: ts_low_log.txt added

TS Container Log (720p)

by Djfe, 6 years ago

Attachment: ts_high_log.txt added

TS Container Log (2160p)

comment:2 by Djfe, 6 years ago

The video files have been submitted by https://streams.videolan.org/upload/
(Too big for trac file size limit)

I made a few mistakes while uploading :/
The "Parookaville2.mp4" doesn't correspond to any logs here.
The real files are called PV1 or PV2 (.ts/.mp4)

And 2 or 3 files still had VideoLAN selected instead (I uploaded them again with ffmpeg selected)

If you have access, then you can just delete the VideoLAN files (sry for asking you to clean up after me; I'll try to be more careful next time)

Regards
Djfe

comment:3 by Djfe, 6 years ago

reencoding the aac file doesn't seem to cause issues, but reencoding the audio from the mp4 or ts containers leads to errors:

PV1.mp4 to opus

[aac @ 0000028cf3386000] Number of bands (57) exceeds limit (47).

PV2.mp4 to opus

[aac @ 000001eaf3abb680] channel element 2.9 is not allocated

PV1.ts to opus

[aac @ 0000029318d6c380] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0000029318d6c380] decode_pce: Input buffer exhausted before END element found
Error while decoding stream #0:1: Invalid data found when processing input

PV2.ts to opus

[aac @ 000001eeba6be000] channel element 3.14 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input

PV1 is ts program/channel 0 from the stream
PV2 is number 3
I haven't recorded 1 and 2

comment:4 by Carl Eugen Hoyos, 6 years ago

Keywords: hls added
Resolution: worksforme
Status: newclosed

First: FFmpeg is not a downloading tool, it is a transcoder. In this specific case, it is very easy to download the short transport streams: You choose one of the four resolutions in the first m3u8 file, download the next m3u8 (with wget, curl or your favorite tool) and find four streams. Each of the four streams will show the "issues" you report: Damaged audio frame in the beginning of the file and a damaged audio frame at the end (I don't know if this is allowed in hls but this doesn't matter). If you concatenate the files, you still see the error at the beginning of the resulting larger file (and the end) but not the concatenation points.
In general, it is not always possible to remux damaged streams, in this case, the resulting files in my tests play exactly as good as the original files, so I don't think there is an issue, feel free to correct me - no network input necessary, you can simply download the original files.

comment:5 by Carl Eugen Hoyos, 6 years ago

And please test the patch in ticket #6279.

comment:6 by Djfe, 6 years ago

Sry for not answering on that ticket, yet.
I haven't managed to setup a build environment back then :/ (crosscompilation etc.; I'm running Windows because installing Linux on my System failed back when I tried it, currently I can run Linux only in a VM)
I can try compiling again (might take some time for me to figure out how).

anyways, about this ticket:
I see, so it's their fault.
that reminds me of AVCHD on camcorders:
They also split at fixed sizes, so that video and audio frames can end up spread over two segments.

It's probably not following the spec, because it doesn't make sense for streaming (especially adaptive streaming) to split audio frames.
They are the first HLS streams, I came across that even do it.

Thx a lot for the tip with curl/wget.

I mostly looked at the stream with ffmpeg, because I wanted to probe it.
I then did a test download just for fun and to see whether there was something unknown in the container. There was something unknown, so I took a sample, because it looked like a bug/unimplemented feature.

I got this in the older version I was using before doing the bug report (when saving as mkv), forgot to mention that.

[aac @ 0000023ddfa2f780] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0000023ddfa2f780] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0000023ddfa2f780] Inconsistent channel configuration.
[aac @ 0000023ddfa2f780] get_buffer() failed
[aac @ 0000023ddfa2f780] channel element 2.7 is not allocated

anyways thx for taking a look and finding this out :)

in reply to:  6 comment:7 by Carl Eugen Hoyos, 6 years ago

Replying to Djfe:

anyways, about this ticket:
I see, so it's their fault.

Maybe having incomplete aac frames at the beginning and end of each file is allowed for hls, I don't know.

comment:8 by Djfe, 6 years ago

I know I'm kind of hijacking this bug report right now, so sry for that.

Unless it's an actual issue though, I probably shouldn't open another ticket for it

Opening/probing transportstreams from the following livestream's ts files results in a lot of timestamp errors, even though the resulting file and the stream are playable
https://tomorrowland18-live.secure.footprint.net/egress/ahandler/tomorrowland18/madness/madness.isml/madness.m3u8

Do you think that's a bug that should be fixed? (in that case I'll open a ticket)

An small extract from the console:

[mpegts @ 000001d270a8ac00] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=737
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=3, pts=5463336416, dts=5463340016, size=975
[mpegts @ 000001d2710e4800] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=1397
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=5, pts=5463336416, dts=5463340016, size=1249
[mpegts @ 000001d271518240] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=1733
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=7, pts=5463336416, dts=5463340016, size=1561
[mpegts @ 000001d271e1bec0] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=2178
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=9, pts=5463336416, dts=5463340016, size=2585
[mpegts @ 000001d2725da040] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=3581
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=11, pts=5463336416, dts=5463340016, size=5929
[mpegts @ 000001d2729ab980] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=8349
[mpegts @ 000001d270a8ac00] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=1011
[mpegts @ 000001d2710e4800] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=1671
[mpegts @ 000001d271518240] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=2102
[mpegts @ 000001d271e1bec0] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=2766
[mpegts @ 000001d2725da040] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=4407
[mpegts @ 000001d2729ab980] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=9679
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=1, pts=5463343616, dts=5463347216, size=737
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=3, pts=5463343616, dts=5463347216, size=1397
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=5, pts=5463343616, dts=5463347216, size=1733
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=7, pts=5463343616, dts=5463347216, size=2178
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=9, pts=5463343616, dts=5463347216, size=3581
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=11, pts=5463343616, dts=5463347216, size=8349
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=1, pts=5463347216, dts=5463350816, size=1011
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=3, pts=5463347216, dts=5463350816, size=1671
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=5, pts=5463347216, dts=5463350816, size=2102
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=7, pts=5463347216, dts=5463350816, size=2766
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=9, pts=5463347216, dts=5463350816, size=4407
[hls,applehttp @ 000001d27030dbc0] Invalid timestamps stream=11, pts=5463347216, dts=5463350816, size=9679

comment:9 by Djfe, 6 years ago

Without HLS

[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441218016, dts=5441221616, size=15994
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441225216, dts=5441228816, size=16406
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441228816, dts=5441232416, size=18167
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441236016, dts=5441239616, size=14371
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441239616, dts=5441243216, size=15688
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441246816, dts=5441250416, size=19452
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441250416, dts=5441254016, size=18423
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441257616, dts=5441261216, size=23583
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441261216, dts=5441264816, size=20551
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441268416, dts=5441272016, size=21498
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441272016, dts=5441275616, size=19207
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441279216, dts=5441282816, size=16302
[mpegts @ 000001801b46db00] Invalid timestamps stream=1, pts=5441282816, dts=5441286416, size=15501
Note: See TracTickets for help on using tickets.