Open indahud opened 3 years ago
I'm surprised this isn't a duplicate. There is literally no issue asking for metadata to be added to downloads. O.o
How does youtube-dl do it?
Regarding thumbnails, they can only be added to the mp4 container, not ogg. (Technically they can, but it needs a hack; the image needs to be converted to base64 or something.)
Metadata can and should be added for audio as well as video files.
youtube-dl doesn't add metadata by default, but you can with --add-metadata option.
It uses these flags --embed-thumbnail --add-metadata
this would be very cool... especially for audio files
@B0pol And it will add the image too? In full quality?
I'm here from a request I wrote here, btw: https://github.com/TeamNewPipe/NewPipe/issues/1014
It would not be a good idea to add a very high quality image to the downloaded file. If your file is 4 MB and you add another 2 MB just to get a thumbnail, for example, it would bloat your media library very fast.
@opusforlife2 I don't think I ever saw a ridiculously large image for it that it takes this much space, from YouTube, and I use "mediahuman youtube to mp3 converter" on many videos from there. In fact I never even saw a 4k image from there, so I think it should be safe.
You could always have a setting for protecting it, if you really want:
And because I really never saw such an issue.
https://support.google.com/youtube/answer/72431?hl=en
I got the 2 MB figure from here. So it is possible that an uploader uses an image of that size.
But Youtube provides thumbnails in several sizes. From very small to full sized. That's what I was referring to. We could get an optimum sized image that looks good but is still small.
And yes, we should definitely have a setting to control this. Users who don't want thumbnails shouldn't have to pay for them in data.
@opusforlife2 It's the guidelines, and even then, it's incredibly rare for an image of size 1280x720 to take this much space. It will probably need to have such random content that the compression of JPG/PNG will fail to compress it well.
I don't think you need to worry about this much. We could have a generous default setting and you wouldn't notice it.
If you want, you can try to upload the largest thing you can, and I can test what I get from it.
I'm surprised Youtube doesn't recommend WebP for thumbnails yet. Or even AVIF.
@opusforlife2 I don't know how it's saved behind the scenes. Does YouTube have the videos saved in a format that has the image inside? Or it's separate? If it's separate, they might save it on WEBP themselves. If it's inside the video file, maybe it's limited...
Does YouTube have the videos saved in a format that has the image inside? Or it's separate?
It's separate, probably. They only need thumbnails for embedded videos.
@opusforlife2 So maybe it's webp?
@opusforlife2 Are there rules about the format, when it's inside the video file? It could be WEBP?
WebP has a different container called RIFF. https://en.wikipedia.org/wiki/WebP
It doesn't seem to support being contained in WebM or MP4.
So maybe it's webp?
This shows several URLs which have thumbnails in the webp format. So Youtube does use them already.
@opusforlife2 So on YouTube it's saved as WEBP, but on the output of creating MP4/WEBM, we can't have WEBP inside .
Too bad. So what can be inside MP4/WEBM ? JPG/PNG ? Something else?
Why would you need embedded thumbnails for videos? They are generally automatically generated by media players like VLC, and file explorers as well.
To answer your question, JPGs and PNGs can be embedded in both those containers. But a likely use for an embedded thumbnail is only audio files, which rules out WebM. This is because Youtube contains only Opus and AAC audio streams, which are downloaded by Newpipe in Ogg and MP4 containers respectively.
I've already written about Ogg here https://github.com/TeamNewPipe/NewPipe/issues/4341#issuecomment-700200109.
@opusforlife2 When you download as an audio file, though, I don't think apps will generate it for you. The request here is more about audio, not video. I just asked this as a side note, because it's interesting for both video and audio. It could be nice to have an option for video, too, though.
The same restrictions are for audio? Can't put WEBP into audio files? Only PNG/JPG?
Nothing matters here except the container. MP4 allows images, and so does WebM (it is based on Matroska - MKV). But not Ogg. In Newpipe's case, only MP4 matters, because you have the option of downloading AAC streams in that container.
@opusforlife2 Odd that OGG doesn't support it, as it's supposed to be newer and more modern... I'm sorry if I made you upset. So as you said, whether it's audio or video file, we are restricted to PNG/JPG to be inside?
What made you think I'm upset?
Odd that OGG doesn't support it
It is indeed weird.
we are restricted to PNG/JPG to be inside?
Yup.
@opusforlife2 I see. Thanks.
Hi there, I'd also give this feature +1.
It would be very helpful to support and integrate metadata into downloaded files for e.g. a video to podcast scenario including a cover screenshot at a definable position within a video file. The MP4 to M4A conversion is sufficient for me, so I use ffmpeg to achieve that goal.
Save the following commands in a batch file and put a link into the "SendTo" folder (%appdata%\Microsoft\Windows\SendTo) to be able to choose MP4 files in the file-explorer.
REM rip audio track from video file
ffmpeg.exe -i %%a -vn -acodec copy "%%~dpa%%~na".tmp.m4a
REM rip frame at 5s of video with quality 5 to jpg
ffmpeg.exe -i %%a -ss 00:00:05 -vframes 1 -q:v 5 "%%~dpa%%~na".jpg
REM integrate jpg into m4a file and cleanup, if the conversion is executed without errors
ffmpeg.exe -i "%%~dpa%%~na".tmp.m4a -i "%%~dpa%%~na".jpg -map 0:0 -map 1:0 -codec copy -disposition:v:0 attached_pic "%%~dpa%%~na".m4a && del "%%~dpa%%~na".tmp.m4a && del "%%~dpa%%~na".jpg
I'm happy with this, however if NewPipe could do the job automatically, that would be a nice time saver ;)
+1 for that feature
This would be very useful for archivists, like myself, who want a painless way of organizing the videos they have download.
I also would really like to see this, because I always end up using another App trying to add tags and sometimes not quite remembering them, having this just done in NewPipe would be amazing. Maybe there should be an option for making metadata optional and cover art optional for people that want to reduce their file size
I am still very new to this but an implementation could maybe look like this:
Metadata:
Album Art:
Errors that might occur:
@mangoepic By "cover" it means "album cover" , right? Meaning it could get the image from YouTube of the video, and put it into the output file?
@AndroidDeveloperLB Yes there needs to be some method for it. I know that youtube-dl can download youtube thumbnails with ffmpeg but i am not sure how well this is supported/customizable without it and if it supports all of newpipes platforms like soundcloud etc.
https://github.com/mangoepic/NewPipe i tried starting to add a cover image feature here but i have honestly no idea what i am doing so feel free to help or overtake if you're interested
Is it possible to bundle youtube-dl and ffmpeg with newpipe? (Or they can be downloaded and installed via option in settings). Then there could be an "advanced download" section where users can add their own custom youtube-dl command.
@Mhowser You can search for those keywords. This has already been discussed.
My current idea was to use jaudiotagger (or similiar) for tagging and getting the current youtube thumbnail as cover + inserting the channel as artist and the video title as Music title.
When this feature implemented?
Has this been solved finally?
this is a subset of the issue described here, but it would be helpful to embed the original download URI into the metadata as well. this is helpful for archival/provenance.
I mean Ymusic on Android somehow does it
I believe this should also include chapters.
workaround: install YTDLNis (available from Github or IzzyOnDroid) and use the android share dialog to share to YTDLNis. from there you can control all parameters of the download including custom yt-dlp flags.
Already used it btw. I thought why two apps for two different tasks, when the np extractor has the ability to fetch these streams and has a post-processor isn't it ? This is a feature enhancement anyways.
workaround: install YTDLNis (available from Github or IzzyOnDroid) and use the android share dialog to share to YTDLNis. from there you can control all parameters of the download including custom yt-dlp flags.
It is super slow, takes too much time to just start the download
It is super slow, takes too much time to just start the download
Try enabling aria2 from the settings.
Add metadata and thumbnail while downloading files
There is no option to embed metadata and thumbnails while downloading files.
Is your feature request related to a problem? Please describe it
No
How will you/everyone benefit from this feature?
Metadata information like chapters, artist, album name, genre, year and thumbnail can organize audio files easily. Similarly for video files.