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

Support for videos which are not available in any of the formats we currently support #117

Open
satyamtg opened this issue Oct 6, 2020 · 2 comments

Comments

@satyamtg
Copy link
Contributor

satyamtg commented Oct 6, 2020

The technology run failed in #115 due to a video which is only available as an HLS stream. Here's the JSON -

				"resources": {
					"h264": null,
					"hls": {
						"adUrl": "https://pubads.g.doubleclick.net/gampad/ads?ciu_szs=300x250%2C512x288%2C120x60%2C320x50%2C6x7%2C6x8&correlator=%5Bcorrelator%5D&cust_params=event%3DTorchbearers%26id%3D13012%26tag%3Dglobal%2Bissues%2Ccollaboration%2Ctechnology%2Cdisease%2Chealth%2Bcare%2Chealth%2CAfrica%2CTED%2BPrize%2Chumanity%2Cmedicine%2Csociety%2Cillness%26talk%3Draj_panjabi_community_health_heroes%26year%3D2018&env=vp&gdfp_req=1&impl=s&iu=%2F5641%2Fmobile%2Fios%2Fweb&output=xml_vast2&sz=640x360&unviewed_position_start=1&url=%5Breferrer%5D",
						"maiTargeting": {
							"id": "13012",
							"talk": "raj_panjabi_community_health_heroes",
							"tag": "global issues,collaboration,technology,disease,health care,health,Africa,TED Prize,humanity,medicine,society,illness",
							"year": "2018",
							"event": "Torchbearers"
						},
						"stream": "https://hls.ted.com/talks/13012.m3u8?preroll=newshortintro_053119",
						"metadata": "https://hls.ted.com/talks/13012.json?preroll=newshortintro_053119"
					}
				},

We might want to support that. Also we should add logging for currently processing videos.

@rgaudin
Copy link
Member

rgaudin commented Oct 6, 2020

Thanks !
Youtube-dl supports HLS so we could use it to download it. ytdl streams video and audio one after another and then merge it into an mp4 file that we can convert.
Not sure if there's a way to request a specific quality. Default is to test connexion speed.

@benoit74
Copy link
Collaborator

+1, also to be used as a fallback when h264 download failed (happen from time to time, e.g. https://www.ted.com/talks/the_ted_interview_how_bill_gates_spends_9_billion_a_year)

ffmpeg can read this manifest, select appropriate stream and directly create appropriate output reencode video.

ffprobe -i https://hls.ted.com/project_masters/9107/manifest.m3u8

python-ffmpeg binding can do all this is a more pythonic way, especially the probing part which will be necessary to select adequate stream: https://github.com/kkroening/ffmpeg-python/tree/master/examples#get-video-info-ffprobe

I recommend to download highest bitrates available, even if it will consume more bandwidth, it ensures we do not get a degraded quality which is then reencoded, which can lead to only more artefacts.

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

3 participants