Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output differences with the native hls downloader #5003

Closed
e00E opened this issue Feb 19, 2015 · 3 comments
Closed

Output differences with the native hls downloader #5003

e00E opened this issue Feb 19, 2015 · 3 comments

Comments

@e00E
Copy link

@e00E e00E commented Feb 19, 2015

To download for example twitch.tv vods via hls youtube-dl can use ffmpeg or the built in hls downloader.
I noticed that there are slight differences in the created files with the two options.

As a test I used this twitch vod: http://www.twitch.tv/lobosjr/v/3796842 which is reported as 1:13 long via the twitch player.

When downloading it with ffmpeg the file is 32.938.745 bytes big.
With the native hls downloader the file is 33.744.684 byte big. This is also exactly the same file I get when downloading the vod with a different tool for the same job (livestreamer).

When playing the files via vlc they feel different. Skipping to different times seems faster with the native version but produces a "key frame missing" effect for a short time, this does not happen with the ffmpeg version but skipping is a bit slower.

Using ffprobe on both files shows more differences like the files having a slightly different length (this is also noticeable in vlc but it says 1:13 and 1:12):
ffprobe ffmpeg.mp4:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ffmpeg.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.1.100
  Duration: 00:01:13.22, start: 0.000000, bitrate: 3599 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-1), 1280x720, 3521 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 114 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

ffprobe native.mp4:

Input #0, mpegts, from 'native.mp4':
  Duration: 00:01:13.27, start: 62.901000, bitrate: 3684 kb/s
  Program 1
    Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 134 kb/s
    Stream #0:1[0x101]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709/bt709/iec61966-2-1), 1280x720, 60 fps, 60 tbr, 90k tbn, 120 tbc
    Stream #0:2[0x102]: Data: timed_id3 (ID3  / 0x20334449)
Unsupported codec with id 1414087731 for input stream 2

When trying this with a longer vod (~37 minutes) the reported difference in length is still as minimal as here but the native version is 601mb whereas the ffmpeg version is only 586mb which is not a minimal difference.
Without looking at the ffmpeg source I'm guessing this is caused by the aac_adtstoasc bitstream filter that ffmpeg gets invoked with in downloader/hls.py but I dont know why this is needed or what exactly it does.
Im guessing the native version resembles the original more closely but the ffmpeg version seems to be a more proper file (as it does not contain an unsupported codec). I wonder which one is preferred and should the native downloader implement the bitstream filter too or should ffmpeg be invoked without it (or neither)?

@e00E
Copy link
Author

@e00E e00E commented Feb 19, 2015

Not sure if this is relevant at all but at least interesting, when you open the native version with an hexeditor or invoke strings on it you can see some twitch related text in it:
2015-02-16T17:11:22
2015-02-16T17:11:26
index-0000000000-K1Fq.ts
libavtwitch: e73cdbc45cfb6e9cc05c7d1G

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

Yes they are different and the causes are listed in your first post. Do you expect both methods generate identical files? It's not a goal of the native downloader.

@e00E
Copy link
Author

@e00E e00E commented Nov 12, 2019

I must have missed yan's comment. I just got a notification because the issue was closed.

In the original issue I was voicing confusion and I was not sure if this was a bug or not. I believe my speculation at the end of the original comment is correct and as yan says it is not expected to get the same file output. The actual audio and video should still be exactly the same which is what I was worried about.

It is fine to close this issue. This reply is for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.