Skip to content

youtube-dl change output path only for converted videos (–recode-video)?

I want to download a video with bestvideo+bestaudio quality and save the converted video to a different location.

for example command below

youtube-dl -f bestvideo+bestaudio -k 1G4isv_Fylg

produces this: output

but I want something like this: required output

Can I change the location for ffmpeg output?

Advertisement

Answer

I read the documentation here. The solution was to use –exec flag

youtube-dl -f bestvideo+bestaudio -k --exec 'mv {} ./output/{}'  1G4isv_Fylg

I found that command passed as an argument to –exec runs only after file conversion and only affects the final output file, that is, in this case, is the converted file.