Open jrafaaael opened 9 months ago
You can refer to the link below. Although not entirely equivalent, it closely aligns with your requirements.
DEMO: https://hughfenghen.github.io/WebAV/demo/1_4-mp4-previewer Code: https://github.com/hughfenghen/WebAV/blob/56ab3c240b3347e195184c291676dd9119dea608/packages/av-cliper/src/mp4-utils/mp4-previewer.ts#L85
Hey @hughfenghen, thanks for the link/repo, definitely interesting!
From my understanding you are downloading the entire stream here correct? (Building the videoSamples
on init
.) Would you happen to know how to only fetch a range of data (say I only wanted to extract from range 5-7s and make sure to only download the minimum necessary range)?
@Secretmapper If you only want to download a portion of the video data, perhaps you should explore some DASH or HLS protocols.
I want to extract frames based on a range of seconds: lets say I have a 20-second video and I want to get all the frames in 2 to 7 seconds range Right now, I'm usign the following code (from here) to extract each frame of a given mp4 video and it works fine but I would like to extract only required frames instead of all of them I tried to use the
seek
method in#onSamples
private method ofMP4Demuxer
class but this doesn't work. My laptop got freezed for some reason. Without theseek
LOC all works fine again (I get all frames without any problem)