Repository: youtube-dl
Issue: FranceTV: hlsnative corrupts soundtrack in videos with separate "audio only" HLS playlist
Labels: geo-restricted

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](https://github.com/ytdl-org/youtube-dl/files/3714580/rapport_de_bug_youtube-dl.log)