Body: <p>I downloaded <a href="https://drive.google.com/open?id=1M8gJMd_-OhX6qJD5KTxBHkavU64w-_WY" rel="nofollow noreferrer">this video</a> 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.</p>
  
  <p>I thought re-encoding it with ffmpeg might solve the issue. But ffmpeg throws these exceptions irrespective of the operation I try to perform:</p>
  
  <pre><code>[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
  </code></pre>
  
  <p>Google search led me to tools such qtfaststart and mp4box. But none of them seemed to solve the issue.</p>
  
  <ul>
  <li>Running <code>qtfaststart 4.mp4 41.mp4</code> throws the <code>moov atom not found, is this a valid MOV/MP4 file?</code> exception</li>
  <li>Running <code>MP4Box -add 4.mp4 41.mp4</code>, <code>MP4Box -inter 0 4.mp4</code> or <code>MP4Box -add 4.h265 41.mp4</code> show exceptions such as:
  
  <ul>
  <li>Incomplete MDAT while file is not read-only</li>
  <li>Invalid IsoMedia File</li>
  <li>[MPEG-2 TS] TS Packet 1 is scrambled - not supported</li>
  <li>[MPEG-2 TS] TS Packet 2 has error (PID could be 1792)</li>
  <li>[MPEG-2 TS] TS Packet 3 does not start with sync marker</li>
  <li>Error importing 4.mp4: Corrupted Data in file/stream</li>
  <li>Cannot find HEVC start code</li>
  <li>Error importing 4.h265: BitStream Not Compliant</li>
  </ul></li>
  </ul>
  
  <p>A detailed log of my tryst with MP4box can be found <a href="https://pastebin.com/u97hZvBS" rel="nofollow noreferrer">here</a>.</p>
  
  <p>The logs of my tryst with ffmpeg can be found <a href="https://pastebin.com/E6XFztmn" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Handbrake also refuses to process the file on account of <code>moov atom not found</code>.</p>
  
  <p>How can I make this video download work?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T07:42:08.183Z
Comments.Text: The file is encrypted, so you'll need the decryption key. DId yt-dl download using ffmpeg or its native hls downloader?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T08:52:39.353Z
Comments.Text: The M3U8 manifest which I used to download this file is here: https://pastebin.com/Tqu9wbFJ
Comments.UserDisplayName: SOuser
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T09:15:54.573Z
Comments.Text: @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: https://ibb.co/dbQmTN0
Comments.UserDisplayName: SOuser
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T09:22:21.513Z
Comments.Text: Use the ffmpeg downloader in yt-dl.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T09:34:23.663Z
Comments.Text: @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.
Comments.UserDisplayName: SOuser
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T09:39:52.030Z
Comments.Text: @Gyan I must apologize. The M3U8 manifest mentioned earlier wasn't the correct one. I don't have the correct one now.
Comments.UserDisplayName: SOuser
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T09:49:41.923Z
Comments.Text: @Gyan I think you'd be able to get more clarity by going through this issue: https://github.com/ytdl-org/youtube-dl/issues/21806
Comments.UserDisplayName: SOuser
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-21T12:57:35.043Z
Comments.Text: @Gyan another issue with using the FFMPEG downloader in yt-dl or otherwise was this with this video stream, it was never able to resume the download from the last fragment. It mostly never was able to resume the download, in fact.
Comments.UserDisplayName: SOuser
Tags: <ffmpeg><codec><mp4><handbrake><hls>
Title: moov atom not found
UserDisplayName: SOuser
ThreadText: # moov atom not found
  
  (Asked by: username_0 on 2019-07-21)
  
  I downloaded [this video](https://drive.google.com/open?id=1M8gJMd_-OhX6qJD5KTxBHkavU64w-_WY) 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](https://pastebin.com/u97hZvBS).
  
  The logs of my tryst with ffmpeg can be found [here](https://pastebin.com/E6XFztmn).
  
  Handbrake also refuses to process the file on account of `moov atom not found`.
  
  How can I make this video download work?
  
  **Tags:** ffmpeg, codec, mp4, handbrake, hls
  
  > **Comments:**
  > **username_1**: The file is encrypted, so you'll need the decryption key. DId yt-dl download using ffmpeg or its native hls downloader?  
  > **username_0**: The M3U8 manifest which I used to download this file is here: https://pastebin.com/Tqu9wbFJ  
  > **username_0**: @username_1 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: https://ibb.co/dbQmTN0  
  > **username_1**: Use the ffmpeg downloader in yt-dl.  
  > **username_0**: @username_1 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.  
  > **username_0**: @username_1 I must apologize. The M3U8 manifest mentioned earlier wasn't the correct one. I don't have the correct one now.  
  > **username_0**: @username_1 I think you'd be able to get more clarity by going through this issue: https://github.com/ytdl-org/youtube-dl/issues/21806  
  > **username_0**: @username_1 another issue with using the FFMPEG downloader in yt-dl or otherwise was this with this video stream, it was never able to resume the download from the last fragment. It mostly never was able to resume the download, in fact.  
  
  ---
  
  ## 0 answers
  
  