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

FranceTV: hlsnative corrupts soundtrack in videos with separate "audio only" HLS playlist #22674

Open
zag-adka opened this issue Oct 10, 2019 · 23 comments

Comments

@zag-adka
Copy link

In several videos from www.france.tv, including all recent from "Passion Outremer" but also some others, there are several video only files and an audio only file. But the other video files are video+audio. This audio file triggers an error of ffmpeg after 10 seconds when merging, thus the video+audio merged file doesn't have sound included after these seconds. For an original sound file of about 20 MB, the sound extracted from the merged file is only 80 KB, including only these 10 seconds.

This problem is not strictly related to youtube-dl and maybe not to ffmpeg. I think that it comes from a basic copy protection system which includes an error in the file. In the browser, it works well, but with youtube-dl the sound track is truncated.

Please note that if I download the audio only file with "-f bestaudio", the sound track is also cut, because of the postprocessing with ffmpeg.

I found a workaround to keep the entire sound track for further postprocessing by using this option: "--fixup never", combined with "-f bestaudio".

I first tried to hear the sound with VLC or mplayer, it stops at 10s. Then I installed ffplay 4.1.4 (Debian package from deb-multimedia.org), which works, but I hear a very short pause in the sound at 10 seconds, then at 30s and maybe every 30s. I haven't tried with ffmpeg 4.2 or 4.2.1. Of course, I use the latest youtube-dl, which is 2019.09.28.

Maybe with ffmpeg options I can merge the video only file and the audio only file but I'm not an expert of ffmpeg and haven't found it in the documentation. If a fix is found with ffmpeg options, it would be useful to include it in youtube-dl code.

Here are some examples of these videos:

https://www.france.tv/documentaires/voyages/1073909-montagne-pelee-un-volcan-sous-haute-surveillance.html
https://www.france.tv/france-o/antilles-les-volcans-se-reveillent/1020287-montserrat-la-pompei-des-caraibes.html
https://www.france.tv/documentaires/voyages/1083115-soufriere-la-vieille-dame-indomptable.html
https://www.france.tv/france-o/antilles-les-volcans-se-reveillent/1084769-dominique-une-ile-en-ebullition.html
https://www.france.tv/documentaires/animaux-nature/1085375-des-volcans-aux-lagons.html
https://www.france.tv/documentaires/animaux-nature/1085373-reunion-le-volcan-rouge.html
https://www.france.tv/france-o/passion-outre-mer/763831-passion-outre-mer.html

For the concerned videos, "youtube-dl -F" gives for example:
format code extension resolution note
hls_v5_os-audio-aacl-64-Audio_Français mp4 audio only [fr]
hls_v5_os-191 mp4 256x144 191k , avc1.42C01E, 25.0fps, video only
hls_v5_os-321 mp4 320x180 321k , avc1.42C01E, 25.0fps, video only
hls_v5_os-609 mp4 512x288 609k , avc1.42C01E, 25.0fps, video only
hls_v5_os-880 mp4 704x396 880k , avc1.4D401F, 25.0fps, video only
hls_v5_os-1554 mp4 1024x576 1554k , avc1.4D401F, 25.0fps, video only (best)

Other videos with audio merged are OK.

I attach a log of youtube-dl downloading the audio only file, with the file cut by postprocessing, as you can see in the following "ls".

rapport_de_bug_youtube-dl.log

@zag-adka zag-adka changed the title FranceTV: sound stop after 9.5 seconds in videos with audio only file FranceTV: sound stop after 10 seconds in videos with audio only file Oct 10, 2019
@guy-teube
Copy link

guy-teube commented Nov 23, 2019

Any news about this issue ? All my videos have no sound after 10 seconds, quite disturbing...
Other download programs provide the sound in the whole file, so the problem doesn't come from it.
Thank you

@awsms
Copy link

awsms commented Nov 30, 2019

Exact same issue here.

@zag-adka
Copy link
Author

zag-adka commented Dec 10, 2019

With youtube-dl version 2019.11.28, it works.

Now, I get this message among the logs:
"WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg"

These videos use a separate audio file which is not a single file but a ".m3u8" playlist of 10 seconds ".aac" audio fragments. With youtube-dl version 2019.09.28, the download was done by hlsnative and the merged file is corrupted every 10 seconds. But with youtube-dl version 2019.11.28 using ffmpeg do download and merge, it's OK.

If think that this bug can be closed and that it is related to another closed bug.

@zag-adka
Copy link
Author

zag-adka commented Dec 11, 2019

I can't find which closed issue is related to this one, but as now, youtube-dl detects that it can't use hlsnative, this problem is solved.

I close my bug report.

@guy-teube
Copy link

With youtube-dl 2019.11.28, it still doesn't work for me.

For example with this link :
https://www.france.tv/france-o/passion-outre-mer/1118553-episode-10.html

@zag-adka
Copy link
Author

Hello,

I can't reproduce your problem with this URL. It works for me with youtube-dl version 2019.11.28.

Here's the log :


[debug] System config: []
[debug] User config: [u'-o', u'~/Vid\xe9os/Youtube-dl/%(extractor)s/%(upload_date)s_%(title)s_%(resolution)s.%(ext)s', u'-f', u'bestvideo[height<=480]+bestaudio/best[height<=480]/best', u'--socket-timeout', u'10', u'--sub-lang', u'fr']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.france.tv/france-o/passion-outre-mer/1118553-episode-10.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-5-amd64-x86_64-with-debian-10.2
[debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1
[debug] Proxy map: {}
[FranceTVSite] 1118553-episode-10: Downloading webpage
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading video JSON
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading geo restriction info
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading signed hls_v5_os manifest URL
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading m3u8 information
[debug] Invoking downloader on u'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000.m3u8'
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: /home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-321.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.65 Safari/537.36
' -i 'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000.m3u8' -c copy -f mp4 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-321.mp4.part'
ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[tcp @ 0x55c79ce10c00] Starting connection attempt to 88.221.14.16 port 443
[tcp @ 0x55c79ce10c00] Successfully connected to 88.221.14.16 port 443
[hls,applehttp @ 0x55c79ce0da40] HLS request for url 'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000-1.ts', offset 0, playlist 0
[hls,applehttp @ 0x55c79ce0da40] Opening 'https://cloudreplayfrancetv.akamaized.net/keys/crypt.key' for reading
[tcp @ 0x55c79d169740] Starting connection attempt to 88.221.14.16 port 443
[tcp @ 0x55c79d169740] Successfully connected to 88.221.14.16 port 443
[AVIOContext @ 0x55c79d460840] Statistics: 16 bytes read, 0 seeks
[hls,applehttp @ 0x55c79ce0da40] Opening 'crypto+https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000-1.ts' for reading
[tcp @ 0x55c79d460400] Starting connection attempt to 88.221.14.16 port 443
[tcp @ 0x55c79d460400] Successfully connected to 88.221.14.16 port 443
[h264 @ 0x55c79d1e1300] Reinit context to 640x368, pix_fmt: yuv420p
[hls,applehttp @ 0x55c79ce0da40] max_analyze_duration 5000000 reached at 5000000 microseconds st:0
Input #0, hls,applehttp, from 'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000.m3u8':
  Duration: 02:04:41.60, start: 10.000000, bitrate: 0 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 640x360 (640x368) [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0
Output #0, mp4, to 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-321.mp4.part':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[AVIOContext @ 0x55c79d1e2440] Statistics: 1320888 bytes read, 0 seeks
[hls,applehttp @ 0x55c79ce0da40] HLS request for url 'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000-2.ts', offset 0, playlist 0
[hls,applehttp @ 0x55c79ce0da40] Opening 'crypto+https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-video=240000-2.ts' for reading
[tcp @ 0x55c79d176b40] Starting connection attempt to 88.221.14.16 port 443
[tcp @ 0x55c79d176b40] Successfully connected to 88.221.14.16 port 443
[AVIOContext @ 0x55c79d41bdc0] Statistics: 1293816 bytes read, 0 seeks

...

[ I've remove the same logs for parts 3 to 747 ]

...

[hls,applehttp @ 0x55823fb1fa40] HLS request for url 'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-audio_fre=64000-748.aac', offset 0, playlist 0
[hls,applehttp @ 0x55823fb1fa40] Opening 'crypto+https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-audio_fre=64000-748.aac' for reading
[tcp @ 0x55823fdf0980] Starting connection attempt to 88.221.14.16 port 443
[tcp @ 0x55823fdf0980] Successfully connected to 88.221.14.16 port 443
[AVIOContext @ 0x55824013a700] Statistics: 123213 bytes read, 0 seeks
[hls,applehttp @ 0x55823fb1fa40] HLS request for url 'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-audio_fre=64000-749.aac', offset 0, playlist 0
[hls,applehttp @ 0x55823fb1fa40] Opening 'crypto+https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-audio_fre=64000-749.aac' for reading
[tcp @ 0x55823fe88b40] Starting connection attempt to 88.221.14.16 port 443
[tcp @ 0x55823fe88b40] Successfully connected to 88.221.14.16 port 443
size=   87552kB time=02:04:40.02 bitrate=  95.9kbits/s speed= 107x    
[AVIOContext @ 0x55823ff7e380] Statistics: 20246 bytes read, 0 seeks
No more output streams to write to, finishing.
size=   89047kB time=02:04:41.62 bitrate=  97.5kbits/s speed= 107x    
video:0kB audio:90073kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYwODUzMzR+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9ZWE4NmE2NzI1OGQ5MjQyNDcwZTQ4NWNjZjQ3ZDU4YTU1Y2Y4ZDNiMjE0ZDQ1MzhiZTM4M2U0M2FiM2JjNWZhMA==/218672014_france-domtom_TA-audio_fre=64000.m3u8):
  Input stream #0:0 (audio): 350702 packets read (92234709 bytes); 
  Total: 350702 packets (92234709 bytes) demuxed
Output file #0 (file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-audio-aacl-64-Audio_Français.mp4.part):
  Output stream #0:0 (audio): 350702 packets muxed (92234709 bytes); 
  Total: 350702 packets (92234709 bytes) muxed
[AVIOContext @ 0x55823fef09c0] Statistics: 14 seeks, 359 writeouts
[AVIOContext @ 0x55823fdf9d80] Statistics: 56792 bytes read, 0 seeks

[ffmpeg] Downloaded 91184543 bytes

[download] 100% of 86.96MiB in 01:10

[download] 100% of 86.96MiB in 01:10
[ffmpeg] Merging formats into "/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-321.mp4' -i 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-audio-aacl-64-Audio_Français.mp4' -c copy -map '0:v:0' -map '1:a:0' 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.temp.mp4'
Deleting original file /home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-321.mp4 (pass -k to keep)
Deleting original file /home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.fhls_v5_os-audio-aacl-64-Audio_Français.mp4 (pass -k to keep)

Then, I can extract the audio track with:
ffmpeg -i "/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_640x360.mp4" -vn -acodec copy output-audio.aac

and it is complete (88MB) and not 120kB when it was only 10 seconds long.

Can you please run this command and copy youtube-dl.log here ?
youtube-dl -v https://www.france.tv/france-o/passion-outre-mer/1118553-episode-10.html 2>&1 |tee youtube-dl.log

@guy-teube
Copy link

@zag-adka
Copy link
Author

Sorry. I can reproduce the bug. It's not solved in 2019.11.28, I reopen this issue.

I've done the above tests on another computer with a better internet connection and the same youtube-dl version. But it doesn't have a lot of libraries installed and it is missing python-crypto. That is the reason why I get the message "WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg". If I install python-crypto, it uses hlsnative and the bug appears.

On my main computer (used for the initial bug report), I have python-crypto installed and youtube-dl uses hlsnative. If I remove python-crypto, it uses ffmpeg and it works.

I confirm that there is a bug, the same that is described in the first message, which appears only when using hlsnative.

Here's a new log with the bug. As you can see with the following "ls" command, the file is shrinked by ffmpeg when fixup, because it is corrupted.

$ youtube-dl -v -f bestaudio https://www.france.tv/france-o/passion-outre-mer/1118553-episode-10.html
[debug] System config: []
[debug] User config: [u'-o', u'~/Vid\xe9os/Youtube-dl/%(extractor)s/%(upload_date)s_%(title)s_%(resolution)s.%(ext)s', u'-f', u'bestvideo[height<=480]+bestaudio/best[height<=480]/best', u'--socket-timeout', u'10', u'--sub-lang', u'fr']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'bestaudio', u'https://www.france.tv/france-o/passion-outre-mer/1118553-episode-10.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-5-amd64-x86_64-with-debian-10.2
[debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1
[debug] Proxy map: {}
[FranceTVSite] 1118553-episode-10: Downloading webpage
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading video JSON
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading geo restriction info
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading signed hls_v5_os manifest URL
[FranceTV] ee26934c-b93d-4bd2-95e7-16423798b990: Downloading m3u8 information
[debug] Invoking downloader on u'https://cloudreplayfrancetv.akamaized.net/8c267a467ded5/218672014_france-domtom_TA.ism/ZXhwPTE1NzYyMDEwNzd+YWNsPSUyZjhjMjY3YTQ2N2RlZDUlMmYyMTg2NzIwMTRfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9YjhiNWU5MDRlNDVlYjVlZmVkYTlkMzliNjdjODdkZDQwODJhNjJhNmQ3ZDE4MWIyMmM4ZWJhYTEzZjIwMWQ3Nw==/218672014_france-domtom_TA-audio_fre=64000.m3u8'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 749
[download] Destination: /home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.mp4
[download] 100% of 88.02MiB in 00:39.55MiB/s ETA 00:00141
[debug] ffmpeg command line: ffprobe -show_streams 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.mp4'
[ffmpeg] Fixing malformed AAC bitstream in "/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.mp4' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.temp.mp4'

$ ls -lh "/home/mylogin/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.mp4"
-rw-r--r-- 1 mylogin mylogin 2,4M déc.  12 15:35 '/home/debian/Vidéos/Youtube-dl/FranceTV/20191208_Passion outre-mer - Episode 10_NA.mp4'

A workaround to download the video with its sound track is to use the --hls-prefer-ffmpeg command line (or config file) option.

youtube-dl https://www.france.tv/france-o/passion-outre-mer/1118553-episode-10.html --hls-prefer-ffmpeg

@zag-adka zag-adka reopened this Dec 12, 2019
@zag-adka zag-adka changed the title FranceTV: sound stop after 10 seconds in videos with audio only file FranceTV: hlsnative corrupts soundtrack in videos with separate "audio only" HLS playlist Dec 12, 2019
@awsms
Copy link

awsms commented Dec 14, 2019

Sorry. I can reproduce the bug. It's not solved in 2019.11.28, I reopen this issue.

I've done the above tests on another computer with a better internet connection and the same youtube-dl version. But it doesn't have a lot of libraries installed and it is missing python-crypto. That is the reason why I get the message "WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg". If I install python-crypto, it uses hlsnative and the bug appears.

python-crypto isn't installed on my machine, still not working

@guy-teube
Copy link

The option --hls-prefer-ffmpeg seems to work for me.
Thank you @zag-adka

@LateLament
Copy link

Some links only provide separate audio and video files, both with the same name and extension (mp4).

A single download provides a video with truncated sound (a few minutes).

This therefore requires in order:

  • downloading the "audio file only"
  • to modify its extension to avoid overwriting
  • downloading "the video file only"
  • a manual concatenation.

Could you specify the ffmpeg commands used by youtube-dl allowing:

  • to "Fixing malformed AAC bitstream"
  • to concatenate audio and video files

Thanks.

Examples :
https://www.france.tv/documentaires/voyages/1133789-l-age-d-or-des-croisieres.html
https://www.france.tv/documentaires/histoire/392135-le-papyrus-oublie-de-la-grande-pyramide.html
https://www.france.tv/documentaires/histoire/1124953-elisabeth-ii-la-revolution-d-une-reine.html

@awsms
Copy link

awsms commented Jan 6, 2020

The option --hls-prefer-ffmpeg seems to work for me.
Thank you @zag-adka

I confirm this worked as well for me.

@dgaudrie
Copy link

dgaudrie commented Feb 9, 2020

Hi everyone. I have the same issue: I only have the 10 first audio seconds for France TV videos (last week-end however, it worked perfectly). I have the latest youtube-dl release. And in my case, the --hls-prefer-ffmpeg option does not avoid that issue.

Do you have some advices?
Thanks a lot!

youtube-dl -v https://www.france.tv/sport/rugby/tournoi-des-vi-nations-de-rugby/1209079-2e-journee.html --hls-prefer-ffmpeg

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.france.tv/sport/rugby/tournoi-des-vi-nations-de-rugby/1209079-2e-journee.html', '--hls-prefer-ffmpeg']
[debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252
[debug] youtube-dl version 2020.01.24
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg N-93830-gc81ec19817, ffprobe N-93830-gc81ec19817
[debug] Proxy map: {}
[FranceTVSite] 1209079-2e-journee: Downloading webpage
[FranceTV] 583de976-ca18-4221-879d-6e9ba3e5a415: Downloading video JSON
[FranceTV] 583de976-ca18-4221-879d-6e9ba3e5a415: Downloading geo restriction info
[FranceTV] 583de976-ca18-4221-879d-6e9ba3e5a415: Downloading signed hls_v5_os manifest URL
[FranceTV] 583de976-ca18-4221-879d-6e9ba3e5a415: Downloading m3u8 information
[FranceTV] 583de976-ca18-4221-879d-6e9ba3e5a415: Downloading signed m3u8-download manifest URL
[FranceTV] 583de976-ca18-4221-879d-6e9ba3e5a415: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://cloudreplayfrancetv.akamaized.net/e94a21eede3e5/222892906_france-domtom_TA.ism/ZXhwPTE1ODEyNTgzMjh+YWNsPSUyZmU5NGEyMWVlZGUzZTUlMmYyMjI4OTI5MDZfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9NzFlOTE1MGViZTM1MmU1ODQyMmIzODNhNjcxZjMyMmRmYWI5NzA4MjU1NzBkMDcxZTE1YTY5ODQ0MDk2OTJhNA==/222892906_france-domtom_TA-video=768000.m3u8'
[download] Destination: Tournoi des VI Nations  - Irlande _ Pays de Galles - 2e journ▒e-583de976-ca18-4221-879d-6e9ba3e5a415.fhls_v5_os-880.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.110 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-us,en;q=0.5
" -i "https://cloudreplayfrancetv.akamaized.net/e94a21eede3e5/222892906_france-domtom_TA.ism/ZXhwPTE1ODEyNTgzMjh+YWNsPSUyZmU5NGEyMWVlZGUzZTUlMmYyMjI4OTI5MDZfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9NzFlOTE1MGViZTM1MmU1ODQyMmIzODNhNjcxZjMyMmRmYWI5NzA4MjU1NzBkMDcxZTE1YTY5ODQ0MDk2OTJhNA==/222892906_france-domtom_TA-video=768000.m3u8" -c copy -f mp4 "file:Tournoi des VI Nations  - Irlande _ Pays de Galles - 2e journ▒e-583de976-ca18-4221-879d-6e9ba3e5a415.fhls_v5_os-880.mp4.part"
ffmpeg version N-93830-gc81ec19817 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7.4.0 (GCC)
  configuration: --enable-shared --disable-static
  libavutil      56. 26.101 / 56. 26.101
  libavcodec     58. 52.101 / 58. 52.101
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 50.100 /  7. 50.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
[tcp @ 0x60004e7c0] Starting connection attempt to 23.15.179.121 port 443
[tcp @ 0x60004e7c0] Successfully connected to 23.15.179.121 port 443
[tls @ 0x60004e500] Server closed the connection
[https @ 0x60004c840] Compressed (gzip) content, need zlib with gzip support
https://cloudreplayfrancetv.akamaized.net/e94a21eede3e5/222892906_france-domtom_TA.ism/ZXhwPTE1ODEyNTgzMjh+YWNsPSUyZmU5NGEyMWVlZGUzZTUlMmYyMjI4OTI5MDZfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9NzFlOTE1MGViZTM1MmU1ODQyMmIzODNhNjcxZjMyMmRmYWI5NzA4MjU1NzBkMDcxZTE1YTY5ODQ0MDk2OTJhNA==/222892906_france-domtom_TA-video=768000.m3u8: Function not implemented


ERROR: ffmpeg exited with code 1
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\__init__.py", line 474, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\__init__.py", line 464, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 2018, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 807, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 869, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 807, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 862, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 1643, in process_video_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 1919, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 1864, in dl
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\downloader\common.py", line 366, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\downloader\external.py", line 64, in real_download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\downloader\common.py", line 165, in report_error
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 624, in report_error
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 586, in trouble

@Shnoulle
Copy link

A workaround to download the video with its sound track is to use the --hls-prefer-ffmpeg command line (or config file) option.

Thanks : confirmed on https://www.francetvinfo.fr/replay-magazine/france-3/pieces-a-conviction/pieces-a-conviction-du-mercredi-5-fevrier-2020_3787051.html

@akred
Copy link

akred commented Feb 17, 2020

Hi,
I tried with the version "2020.01.24" and the option --hls-prefer-ffmpeg, and it still freeze at audio download.

@Shnoulle
Copy link

Hi,
I tried with the version "2020.01.24" and the option --hls-prefer-ffmpeg, and it still freeze at audio download.

A link because with same workaround seems to work for me.

@akred
Copy link

akred commented Feb 19, 2020

Hi,

Here the URL with the command :
youtube-dl https://www.france.tv/france-2/tout-compte-fait/1241987-quand-la-consommation-du-quotidien-derape-restaurants-gaspillage-a-la-carte.html --hls-prefer-ffmpeg

@guy-teube
Copy link

Hello
With my youtube-dl version 2020.01.24, it works well, I have the sound on the whole file.
To help you on this video, you can check here :
https://www.swisstransfer.com/d/93b4e0cd-416b-48ad-acfa-3c70bcd0da6e

@akred
Copy link

akred commented Feb 20, 2020

It's weird because mine finish with a timeout like this
[hls,applehttp @ 0x55c7a90d9ac0] Opening 'crypto+https://cloudreplayfrancetv.akamaized.net/16648dd6f74e5/223376346_france-domtom_TA.ism/ZXhwPTE1ODIyNjA5Mzl+YWNsPSUyZjE2NjQ4ZGQ2Zjc0ZTUlMmYyMjMzNzYzNDZfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9NTJiNWU5YzYzZDlhYWRhYTE3NTQ5MjhkNTg1MGYwNzgxMGY0MWYyNzg5YjgzMDhlYzkzMTM3MzE3Mzc3YjBkYg==/223376346_france-domtom_TA-video=768000-70.ts' for reading frame=17436 fps=843 q=-1.0 size= 169728kB time=00:11:37.40 bitrate=1993.7kbits/s speed=33.7x

And at the beginning of the download, I have this stack :
$ youtube-dl https://www.france.tv/france-2/tout-compte-fait/1241987-quand-la-consommation-du-quotidien-derape-restaurants-gaspillage-a-la-carte.html --hls-prefer-ffmpeg [FranceTVSite] 1241987-quand-la-consommation-du-quotidien-derape-restaurants-gaspillage-a-la-carte: Downloading webpage [FranceTV] b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53: Downloading video JSON [FranceTV] b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53: Downloading geo restriction info [FranceTV] b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53: Downloading signed hls_v5_os manifest URL [FranceTV] b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53: Downloading m3u8 information [FranceTV] b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53: Downloading signed m3u8-download manifest URL [FranceTV] b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53: Downloading m3u8 information [download] Destination: Tout compte fait - Quand la consommation du quotidien dérape - Restaurants - gaspillage à la carte !-b7f64c81-2cf8-4a67-9bc5-ded0d2c16f53.fhls_v5_os-880.mp4 ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared WARNING: library configuration mismatch avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 [hls,applehttp @ 0x55c7a90d9ac0] Opening 'https://cloudreplayfrancetv.akamaized.net/keys/crypt.key' for reading [hls,applehttp @ 0x55c7a90d9ac0] Opening 'crypto+https://cloudreplayfrancetv.akamaized.net/16648dd6f74e5/223376346_france-domtom_TA.ism/ZXhwPTE1ODIyNjA5Mzl+YWNsPSUyZjE2NjQ4ZGQ2Zjc0ZTUlMmYyMjMzNzYzNDZfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9NTJiNWU5YzYzZDlhYWRhYTE3NTQ5MjhkNTg1MGYwNzgxMGY0MWYyNzg5YjgzMDhlYzkzMTM3MzE3Mzc3YjBkYg==/223376346_france-domtom_TA-video=768000-1.ts' for reading Input #0, hls,applehttp, from 'https://cloudreplayfrancetv.akamaized.net/16648dd6f74e5/223376346_france-domtom_TA.ism/ZXhwPTE1ODIyNjA5Mzl+YWNsPSUyZjE2NjQ4ZGQ2Zjc0ZTUlMmYyMjMzNzYzNDZfZnJhbmNlLWRvbXRvbV9UQS5pc20qfmhtYWM9NTJiNWU5YzYzZDlhYWRhYTE3NTQ5MjhkNTg1MGYwNzgxMGY0MWYyNzg5YjgzMDhlYzkzMTM3MzE3Mzc3YjBkYg==/223376346_france-domtom_TA-video=768000.m3u8':

It's not something related to a ffmpeg issue ?

@MorganeB
Copy link

MorganeB commented Feb 21, 2020

Hi, i'm running version 2020.02.16 and had the same issue.
It was solved by using the option --hls-prefer-ffmpeg (thanks @zag-adka !)

youtube-dl.exe https://www.france.tv/france-3/plus-belle-la-vie/plus-belle-la-vie-saison-16/1183429-plus-belle-la-vie.html --hls-prefer-ffmpeg

@mishka81
Copy link

mishka81 commented Mar 2, 2020

yeah, it works with option --hls-prefer-ffmpeg, thank u @zag-adka !

But, you have to wait for the entire file to download : option --no-part seems not compatible with this.

@akred
Copy link

akred commented May 11, 2020

Do you have any update on this issue ?

@j-degreef
Copy link

j-degreef commented Jan 30, 2021

--hls-prefer-ffmpeg saved my live too ;)

Any way to have youtube-dl discover by itself if this option is needed ?

Update : i've forgotten to thanks you for your work :)

@codl codl mentioned this issue Feb 6, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests