I use youtube-dl to download video from websites of television networks such as nbc.com, abc.com, cbs.com etc. Once youtube-dl extracts the playlists it then calls ffmpeg to download the video. On some websites, such as tntdrama.com, ffmpeg repeatedly prints the message "Non-monotonous DTS in output stream 0:0; previous: ..., current: ...; changing to ... This may result in incorrect timestamps in the output file." When I play the downloaded file, it will play fine up to about 14-21 minutes in then hang. When I asked about this problem in another forum a member stated "Some playlists contain a sequence of separately produced MPEG-TS files. So, there's a timestamp reset when each new segment is received. At this point, the timestamp code in libavformat's mux.c simply increments the output timestamp by one when this happens. Unless the timebase resolution is 1/fps, this produces an unsound file." I've been trying to find a solution for over a year on various forums but nothing suggested so far has helped. Anyone here use ffmpeg to download video available to watch online and encounter this problem? I'm at a loss and so far nothing really helpful from the ffmpeg forum.
+ Reply to Thread
Results 1 to 13 of 13
Use the -F switch to browse the available streams then run again with -f with different streams until one Works. On the CW I have to play around with different ones at different resolutions as I sometimes get the same error.if all else fails read the manual
Thanks I'll try that just won't get it in 1080 or maybe not at all...
[generic] master_unpv_de: Requesting header
[generic] master_unpv_de: Downloading m3u8 information
[info] Available formats for master_unpv_de:
format code extension resolution note
140 mp4 audio only 140k , mp4a.40.2
855 mp4 640x360 855k , avc1.42001e, mp4a.40.2
1343 mp4 640x360 1343k , avc1.42001e, mp4a.40.2
1821 mp4 852x480 1821k , avc1.42001f, mp4a.40.2
2564 mp4 960x540 2564k , avc1.4d001f, mp4a.40.2
3526 mp4 1280x720 3526k , avc1.4d001f, mp4a.40.2 (best)
I can only download preview without access.
Last edited by slimozis; 10th Jun 2019 at 04:56.
But, yes, that is correct (the separately produced MPEG-TS files) for almost all program-length videos on all tbs owned websites.
One solution is to download each individual contiguous block of ts segments (there are around 3 or 4 such blocks per 30 minutes of content).
The blocks are demarcated by:
found at the end of each block within the hlsvariant playlist for the desired quality.
Then, join the individually downloaded blocks using the concatenation function of ffmpeg. The concat function of ffmpeg will make the timestamp codes in the resulting joined file to be properly consecutive for the length of the joined file.
A batch file could be made to automate all of this.
Last edited by ponens; 11th Jun 2019 at 13:02.
slimozis: Thank you for checking this for me.
Thank you for your suggestions.
I've asked about this problem at github.com/ytdl-org/youtube-dl/issues and on the forum at ffmpeg.org. Someone on the mailing list at ffmpeg.org posted that reply.
I see those in the m3u file. How can I download the individual blocks of segments? Then how do I join them with ffmpeg ensuring that it makes the timestamps continuous? Could this be added to the youtube-dl script or must it be done separately?