1
votes

ALREADY WORKING: I get video from embedded video source (just device) through LAN and I can get video from it and save it to file ".h264" (append to file every next "encodedPacket", C++) (it is worked fine, I can play file using VLC).

TASK: How can I save image files periodically (5 in 1 second for example) (any format, but I want jpg)?

File info:

Video Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Format settings : 1 Ref Frames Format settings, CABAC : No Format settings, RefFrames : 1 frame Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive

1
Thank you for your answer! You say about "You can use QMediaPlayer to achieve this."? QMediaPlayer can get data from char* packet?devdex
and here the answer about this question too: stackoverflow.com/questions/27749105/…Gabriel de Grimouard

1 Answers

0
votes

ffmpeg is your friend: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video

I'd try something like: ffmpeg -i input.h264 -vf fps=5 out%d.jpg

If your input is a network stream you can do something like ffmpeg -i tcp://local_hostname:port?listen

https://trac.ffmpeg.org/wiki/StreamingGuide