I am working on a Node.js project, and I have a need that requires pulling a single frame from a specific smooth stream video fragment. I'm struggling with downloading the portion of video into a format where I could pull a single frame from it. I have attempted to research my way out of this, but I just don't know what I'm looking at or how to get from A to B.
Let's use this URL as an example:
http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/QualityLevels(230000)/Fragments(video=0)
This will download a fragment of the video, but I don't know what this fragment actually is. This seems to download a portion of the video itself at the timestamp given and in the mp4 format, but it's not playable by itself.
So, I have a few questions:
/Fragments...
? An fMP4?I realize that this may be asking a lot. If you can link me to resources where I could do further research, or if you have any information or libraries to link me to that may help me accomplish this, I would appreciate it. Thanks!
UPDATE:
I have learned a little bit more. I am indeed receiving a fragment of an MP4. I used MP4 Explorer to view it manually, and I see that I have a Moof box and an Mdat box.
My understanding is that the video/audio data is stored in the Mdat box, but you need to read data from the Moov box to get pointers to where the actual video frames are. I don't have a Moov box...
Hallelujah! I do not have to do this manually.
Using ffmpeg
:
ffmpeg -ss 00:00:01.00 -i http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/manifest(format=mpd-time-csf) -frames:v 1 image.jpg
And bingo, I have frame!