As a beginner I don't know much about ffprobe and other video editing command line tools. Please guide me here.

I am trying to download a video with yt-dlp and trim it to the nearest key-frame of my starting interval.

That is, lets say, I want "https://www.youtube.com/watch?v=mZqWloHCjyY" this video from 00:04:30 to 00:04:40.

yt-dlp -o "output.%(ext)s" -S "res,asr,+abr,+size" --external-downloader ffmpeg --external-downloader-args "ffmpeg_i:-ss 00:4:30.00 -to 00:4:40.00 -avoid_negative_ts make_zero" https://www.youtube.com/watch?v=mZqWloHCjyY //to download the video

After download I am trying to get some information about 'only the first frame',

ffprobe -read_intervals "%+#1" -select_streams v -show_frames "output.mp4"

But there is no output. Now if I remove -read_intervals "%+#1" I am getting information of all the frames.(But I want only first frame info)

Also I noticed if I use hard coded URL of video which I get with this command,

yt-dlp -S "res,asr,+abr,+size" --get-url https://www.youtube.com/watch?v=mZqWloHCjyY

Then after I can get 'only the first frame data' with previous -read_intervals "%+#1". ie now ffprobe -read_intervals "%+#1" -select_streams v -show_frames "URL from previous command" works


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.