c# - How to convert an IP Camera video stream into a video file? -
c# - How to convert an IP Camera video stream into a video file? -
i have url (<ip>/ipcam/mpeg4.cgi
) points ip camera connected via ethernet. accessing url resuls in infinite stream of video (possibly audio) data.
i store info video file , play later video player (html5's video
tag preferred player).
however, straightforward approach, simple saving stream info .mp4
file, didn't work.
i have looked file , here saw (click enlarge):
it turned out, there html headers, farther on manually excluded using binary editing tool, , yet no player play rest of file.
the html headers are:
--myboundary content-type: image/mpeg4 content-length: 76241 x-status: 0 x-tag: 1693923 x-flags: 0 x-alarm: 0 x-frametype: x-framerate: 30 x-resolution: 1920*1080 x-audio: 1 x-time: 2000-02-03 02:46:31 alarm: 0000
my question pretty clear now, , help or suggestion. suspect, have manually create mp4 headers myself based on values above, however, fail understand format descriptions such these.
i have next video stream settings on ip photographic camera (click enlarge):
i utilize ffmpeg
tool, no matter how seek , mix arguments program, keeps telling me error:
it looks server sending h.264 encoded 'rawvideo' in annex b byte stream format.
it might reformatted .mp4 below command line:
ffmpeg -i {input file} -f rawvideo -bsf h264_mp4toannexb -vcodec re-create out.mp4
saving audio/video streaming file not easy job. if it's video only, using mpeg2 ts format easiest way go.
for .mp4 streaming, consider -movflags faststart
-> recommendation on best quality/performance h264 encoder video encoding?
** update: -bsf h264_mp4toannexb
alternative omitted, i'm not sure.
c# ffmpeg video-streaming mp4 rtsp
Comments
Post a Comment