1

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 : Baseline@L3.1 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

kometen
  • 6,536
  • 6
  • 41
  • 51
devdex
  • 11
  • 4

1 Answers1

0

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

Markus Schumann
  • 7,636
  • 1
  • 21
  • 27
  • Great! But how can I route my stream from my program to ffmpeg not via file? – devdex Dec 14 '17 at 07:46
  • How is the video transported? PLEASE tell us the format. – Markus Schumann Dec 14 '17 at 21:59
  • I don't understand your question :( What does you mean? Video Format : AVC Format/Info : Advanced Video Codec Format profile : Baseline@L3.1 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 – devdex Dec 18 '17 at 11:23
  • You are getting your video over LAN. So is it TCP, UDP, RTP, RTMP, DASH, HLS or some other transport format. Your H.264 stream gets transported from one computer to another. What is the mode of network transportation? – Markus Schumann Dec 18 '17 at 15:13
  • I get it from device via UDP using private protocol (protocol by device's developer). – devdex Dec 19 '17 at 09:08
  • When I try to use your ffmpeg methos with my file i see this (no jpg files was created): https://ibb.co/eq4VZm – devdex Dec 20 '17 at 09:41
  • Please share your input file test.264. – Markus Schumann Dec 20 '17 at 18:13
  • But I want to create image with no creation of video file. I have an stream to file, I want to send it to ffmpeg to do images. Is it possible? – devdex Dec 25 '17 at 14:00