I downloaded this video using youtube-dl's HLS downloader. The video was being HLS streamed using AES-128. Even though I could view it perfectly fine when it was being streamed in the browser, VLC doesn't play the downloaded video file. It doesn't seem to contain any metadata or codec information either. It's actually a 2hr 49min 10sec long video.

I thought re-encoding it with ffmpeg might solve the issue. But ffmpeg throws these exceptions irrespective of the operation I try to perform:

[mov,mp4,m4a,3gp,3g2,mj2 @ 000002a477298a80] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002a477298a80] moov atom not found
4.mp4: Invalid data found when processing input

Google search led me to tools such qtfaststart and mp4box. But none of them seemed to solve the issue.

  • Running qtfaststart 4.mp4 41.mp4 throws the moov atom not found, is this a valid MOV/MP4 file? exception
  • Running MP4Box -add 4.mp4 41.mp4, MP4Box -inter 0 4.mp4 or MP4Box -add 4.h265 41.mp4 show exceptions such as:
    • Incomplete MDAT while file is not read-only
    • Invalid IsoMedia File
    • [MPEG-2 TS] TS Packet 1 is scrambled - not supported
    • [MPEG-2 TS] TS Packet 2 has error (PID could be 1792)
    • [MPEG-2 TS] TS Packet 3 does not start with sync marker
    • Error importing 4.mp4: Corrupted Data in file/stream
    • Cannot find HEVC start code
    • Error importing 4.h265: BitStream Not Compliant

A detailed log of my tryst with MP4box can be found here.

The logs of my tryst with ffmpeg can be found here.

Handbrake also refuses to process the file on account of moov atom not found.

How can I make this video download work?

  • 1
    The file is encrypted, so you'll need the decryption key. DId yt-dl download using ffmpeg or its native hls downloader?
    – Gyan
    Jul 21, 2019 at 7:42
  • The M3U8 manifest which I used to download this file is here: pastebin.com/Tqu9wbFJ
    – SOuser
    Jul 21, 2019 at 8:52
  • @Gyan it was the native HLS downloader with 2 extra lines of code to facilitate download of this video. Without these two extra lines of code, the video wasn't being downloaded. These two extra lines of code are as per this image: ibb.co/dbQmTN0
    – SOuser
    Jul 21, 2019 at 9:15
  • Use the ffmpeg downloader in yt-dl.
    – Gyan
    Jul 21, 2019 at 9:22
  • @Gyan I've tried using FFMPEG downloader for this website from where I'm downloading the video. However, it has never been able to download the videos completely. In most instances, it stops writing/appending the downloaded TS fregments to the output file. At other times, it simply refuses to download the TS fragments, throwing encryption-related errors. At most, it writes about 12 to 25 MB data of the over 600 or 700 MB data.
    – SOuser
    Jul 21, 2019 at 9:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.