Is it possible to not change the file created date when embedding thumbnail using youtube-dl? - youtube-dl

I was trying to download videos from YouTube using youtube-dl with the following:
youtube-dl -f "bestvideo+bestaudio" --merge-output-format mp4 --add-metadata --embed-thumbnail {video URL}
I want to have both the thumbnail embedded in the output file and also the upload date of the YouTube video written as the "Date created" of the output file.
I was able to write the upload date of the video on YouTube to the output file as the "Date created" by using --add-metadata {URL}.
But if I was also embedding the thumbnail to the output using --add-metadata --embed-thumbnail {URL}, the "Date created" and "Date modified" of the output file becomes the time the video thumbnail was written to the disk (aka 'now') but not the upload date of the video on YouTube.
Is there any way to get the output I want to get by using youtube-dl?

Save the date created and/or the date modified of the downloaded video.
Add metadata for thumbnail
Set the created and/or modified date using touch. To see the help for touch, type:
$ man touch

This is a youtube-dl bug, here is the relevant issue on GitHub.
Unfortunately, youtube-dl is quite bad at accepting pull requests and bug fixes, and many such bugs remain. yt-dlp (an actively maintained youtube-dl fork) doesn't seem to have this bug, so that's what I switched to now. (yt-dlp is also able to embed thumbnails to mkv files, something youtube-dl couldn't do, as well as other bugfixes and features.)

Related

How to download and get video informations at the same time in youtube-dl?

In youtube-dl cli, How can i get information about the video (in json output) while the video beign downloaded by the app?
When i use this command:
youtube-dl https://www.youtube.com/watch?v=jNQXAC9IVRw
It only shows me output filename, But what a about the duration, resolution, etc... ?
I do this with 2 requests, But is it possible in on go?
It would be great if it dump the video meta data into a json file as well as output filename, Because i also struggling to pragmatically get the path of downloaded file (i have to use regex)
Just add --print-json in your command line.
youtube-dl --print-json https://www.youtube.com/watch?v=jNQXAC9IVRw
This outputs a big JSON, while video is still downloading

How to embed auto-generated English subtitles with either youtube-dl or yt-dlp?

The key here is to be able to embed the auto-generated subtitles.
The tool can download the autogenerated subtitles but can only embed the real subtitle file, if it exists. I wondered if there would be a way to embed or capture in the video the auto-generated subs. Thanks!
Emmbed Subtitle To Video
--embed-subs: Embed subtitles in the video (only for mp4, webm and mkv videos)
When --embed-subs and --write-subs are used together, the subtitles are written to disk and also embedded in the media file. You can use just --embed-subs to embed the subs and automatically delete the separate file.
don't forget to list the available subtitles using --list-subs.
You can find more like this here
Burn Subtitles To Video
Burn subtitles into the video is also an easy step. You can do this just using commonly used VLC Media Player and can be downloaded from here. I found a great video about this. you can do this with just 4 easy steps by following this video

Resume youtube-dl download for MP3s

I am trying to download an entire playlist using youtube-dl, this way :
youtube-dl -citwx --audio-format mp3 --audio-quality 320K <playlist>
I believe it extracts the audio without having to download the actual video.
The problem is that I want to be able to stop and resume this download, which is impossible using only these arguments. However, if I add the -k option, the program will download the original videos (which takes a lot longer), convert them, and keep the original files (which takes a lot more space).
Is there any way for me to resume such a transfer without having to download the actual video files?
Sounds to me like there is no way. If it takes just the audio, seems like it needs to be done in one go. Maybe try writing a script that takes the file path and url as arguments, and pass those into a youtube dl script, then when that's done also deletes the video file. takes more time that way, but the space issue is gone.
I found the answer while browsing the man page :
--download-archive FILE Download only videos not listed in the
archive file. Record the IDs of all
downloaded videos in it.
youtube-dl -citwx --download-archive progress.txt --audio-format mp3 --audio-quality 320K <playlist> is the correct command.
A note, --title is deprecated. The correct command should be youtube-dl -ciwx -o "%(title)s.%(ext)s" --download-archive progress.txt --audio-format mp3 --audio-quality 320K <playlist>

get metadata from jpg, dng and arw raw files

I was wondering if anyone new how to get access the metadata (the date in particular) from jpg, arw and dng files.
I've recently lost the folder structure after a merge operation gone-bad and would like to rename the recovered files according to the metadata.
I'm planning on creating a little C++ app to dig into each file and get the metadata.
any input is appreciated.
( alternatively, if you know of an app that already does this I'd like to know :)
Have you looked at the libexif project http://libexif.sourceforge.net/?
ok, so I did a google search (probably should have started with that) for "batch rename based on exif data arw dng jpg"
and the first page that popped up was the ExifTool by Phil Harvey
it supports recent arw and dng files, and with some command line magic I should be able to get it to do what pretty much what I want
exiftool -r -d images/%Y-%m-%d/%Y%m%d_%%.4c.%%e "-filename<filemodifydate" pics
-move files to folders (images/YYYY-MM-DD/) and rename files to YYYYMMDD_####.ext that are in pics folder(and subfolders)
hope this helps others
You should also try Adobe XMP SDK, which is great for its supported formats (JPEG, PNG, TIFF and DNG).

How to modify EXIF metadata for JPEG images using Coldfusion?

I am using Coldfusion to view images stored in the file system and I can READ the EXIF metadata of JPEGs, but I'd like to know if it is possible to modify this information and re-save the image.
I know that there are XMP and IPTC custom tags out there, I googled now and seems that javaloader.cfc + some java lib are your only sure option.
EDIT: Since I work on stock photography application I got interested and found this command line tool which could do the trick:
http://www.sno.phy.queensu.ca/~phil/exiftool/