zmwangx / caterpillar

Hardened HLS merger
MIT License
51 stars 9 forks source link

trun track id unknown, no tfhd was found, error reading header #7

Open zmwangx opened 4 years ago

zmwangx commented 4 years ago
$ caterpillar https://p-events-delivery.akamaized.net/2010ayctcrodak763xivpxn4htcuhco9/vod_yNERgMqbdpzDszTARXB7y674TmVQ4Yvu/avc_720p_4500/prog_index.m3u8 apple.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x556f47038080] [warning] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x556f47038080] [warning] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x556f47038080] [error] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x556f47038080] [error] error reading header
[error] apple/1.m3u8: Invalid data found when processing input
[ERROR] ffmpeg failed with exit status 1
[ERROR] unknown error occurred during merging
[WARNING] retrying (1/2) in 5 seconds...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x562dab1ed080] [warning] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x562dab1ed080] [warning] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x562dab1ed080] [error] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x562dab1ed080] [error] error reading header
[error] apple/1.m3u8: Invalid data found when processing input
[ERROR] ffmpeg failed with exit status 1
[ERROR] unknown error occurred during merging
[WARNING] retrying (2/2) in 5 seconds...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55cc937a6080] [warning] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55cc937a6080] [warning] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55cc937a6080] [error] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55cc937a6080] [error] error reading header
[error] apple/1.m3u8: Invalid data found when processing input
[ERROR] ffmpeg failed with exit status 1
[CRITICAL] unknown error occurred during merging

This is a problem with the individual chunks:

$ ffprobe 0.ts
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56317e7bda00] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56317e7bda00] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56317e7bda00] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56317e7bda00] error reading header
0.ts: Invalid data found when processing input

mpv could play the m3u8 feed but dumps a shit ton of error messages and seems to have problems with seeking (edit: a shit ton of error messages only on Windows, not macOS):

$ mpv https://p-events-delivery.akamaized.net/2010ayctcrodak763xivpxn4htcuhco9/vod_yNERgMqbdpzDszTARXB7y674TmVQ4Yvu/avc_720p_4500/prog_index.m3u8
 (+) Video --vid=1 (h264 1280x720 29.970fps)
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: DTS 300000 < 343043 out of order
[ffmpeg/demuxer] hls: DTS 300000 < 343043 out of order
[lavf] Edit lists are not correctly supported (FFmpeg issue).
<repeated a billion times>
...

It couldn't even play the individual chunks:

$ mpv https://p-events-delivery.akamaized.net/2010ayctcrodak763xivpxn4htcuhco9/vod_yNERgMqbdpzDszTARXB7y674TmVQ4Yvu/avc_720p_4500/avc_720p_4500_1.mp4
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: could not find corresponding trex (id 1)
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: could not find corresponding track id 0
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: trun track id unknown, no tfhd was found
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: error reading header
[lavf] avformat_open_input() failed
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: could not find corresponding trex (id 1)
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: could not find corresponding track id 0
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: trun track id unknown, no tfhd was found
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: error reading header
[lavf] avformat_open_input() failed
Failed to recognize file format.

Exiting... (Errors when loading file)

Not sure what can be done.

zmwangx commented 4 years ago

(Of course, in this specific case the solution is to download from YouTube instead...)