Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Downloaded video file unplayable. #25

Closed
DhanrajHira opened this issue Jul 7, 2020 · 19 comments
Closed

Downloaded video file unplayable. #25

DhanrajHira opened this issue Jul 7, 2020 · 19 comments
Labels
bug Something isn't working downloads For issues related to the download functionality offered by the API

Comments

@DhanrajHira
Copy link
Collaborator

DhanrajHira commented Jul 7, 2020

The download completes without issues but the resultant .mp4 file is unplayable.

My guess

Skiping the first chunk (intro) causes this issue.

@DhanrajHira
Copy link
Collaborator Author

Looks like my guess was correct, I commented out the code that was supposed to remove the intro chunk from the file and the video is playable now. Either the way we check for the first chunk removes some required data or the first chunk contains some meta data required by the player.

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

Huh the complete opposite is the case for me

@DhanrajHira
Copy link
Collaborator Author

Do you mean that including the intro chunk breaks your video file?

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

That's correct

@DhanrajHira
Copy link
Collaborator Author

Well this is wierd, if I remember correctly, the M3U8 object had an is_independent_chunks property. Maybe different streams are encoded differently. We'll have to look into this, can you tell me the anime ID and episode number of any other anime that you were able to download while removing the intro?

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

I was able to download everything i tried, for example you can try the example in readme

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

Also i just tried downloading the anime you previously mentioned in the other issue and its unplayable with the intro

@DhanrajHira
Copy link
Collaborator Author

Okay I'll try the one included in the README file. Just to make sure, you downloaded the ld quality right?

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

I downloaded all the qualities when i was testing, but i mostly download fullhd

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

Also when i try to use ffmpeg with the intro chunk it says [png_pipe @ 00000147ba5acf80] Stream #0: not enough frames to estimate rate; consider increasing probesize
and then video:198927kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000411% basically saying there's no audio

@DhanrajHira
Copy link
Collaborator Author

The intro chunk is a gif so that's probably why there is no audio.

@DhanrajHira
Copy link
Collaborator Author

Ignore my previous comment I don't know what I was thinking.

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

aaf71c7

@DhanrajHira DhanrajHira added bug Something isn't working downloads For issues related to the download functionality offered by the API labels Jul 7, 2020
@DhanrajHira
Copy link
Collaborator Author

DhanrajHira commented Jul 7, 2020

I have tried both the default windows player and VLC.

Here's what I found:

Somali to Mori no Kamisama (2069)

With intro:

VLC: Broken
Default Windows Player: Working

Without intro:

VLC: Working
Default Windows Player: Working

God of High School (2506)

With intro:

VLC: Broken (10 seconds of nothing and that too only audio)
Default Windows Player: Working

Without intro:

VLC: Working
Default Windows Player: Broken

@DhanrajHira
Copy link
Collaborator Author

DhanrajHira commented Jul 7, 2020

Inference

Looks like VLC works consistently when there is no intro, while the default player works consistently when the intro chunk is present. Further testing is required to make any solid claims.

We can also look into always skipping the intro and then joining the chunks using ffmpeg, maybe that will make it work consistently with the default player. What do you think?

DhanrajHira referenced this issue Jul 7, 2020
This breaks the video for me but fixes it for others 🤷
@DhanrajHira
Copy link
Collaborator Author

Yup, looks like I was right, using ffmpeg to convert chunks into .mp4 makes it so that the file works with the default player even if the intro is skipped. I tested this on the "God of High School" episode. As you can see above, without ffmpeg it didn't work with the default player if the intro chunk was skipped but by using ffmpeg it works flawlessly. Furthermore, the file size seems to be noticeably smaller.

@DhanrajHira
Copy link
Collaborator Author

The current implementation of the download functionality seems satisfactory to me. I will make a note reminding us to talk about this quirk in the documentation. I think the issue can be closed now, I am leaving the issue open, if you feel satisfied, Kindly close the issue,

@notmarek
Copy link
Owner

notmarek commented Jul 7, 2020

I will add this info to the README and then close this issue

@notmarek
Copy link
Owner

notmarek commented Jul 8, 2020

68f670f

@notmarek notmarek closed this as completed Jul 8, 2020
@notmarek notmarek pinned this issue Jul 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working downloads For issues related to the download functionality offered by the API
Projects
None yet
Development

No branches or pull requests

2 participants