[FFmpeg-user] Save webcam stream in mpg, not avi format
Felix Baier
felixbaier at yahoo.de
Tue Aug 4 17:56:48 CEST 2015
Hi everyone!
I’m new to FFMPEG and look for help with saving video stream from a webcam in .mpg format. What I have is a working code that will save the video stream in .avi format in 1 hour junks:
ffmpeg -r 20 -f dshow -s 960x544 -i video="Microsoft LifeCam HD-5000" -codec copy -f segment -segment_time 3600 -reset_timestamps 1 -segment_start_number 1 -segment_format avi -r 20 c:\Users\Desktop\out%%03d.avi
…but I’m having trouble saving in .mpg format. The reason why I would like to save in .mpg format is that (1) .avi files are very large and (2) my downstream analysis requires .mpg format.
I’m uncertain what the correct way is to save in .mpg format, hence my question here, but what I tried is simply changing, in the code above, the -segment_format to mpg and the file ending to .mpg. With these changes, I get the following error notifications:
C:\Users\Desktop>ffmpeg -r 25 -f dshow -s 640x360 -i video="Microsof
t LifeCam HD-5000" -codec copy -f segment -segment_time 3570 -reset_timestamps 1
-segment_start_number 1 -segment_format mpeg -r 25 c:\Users\Desktop
\out_%03d.mpg
ffmpeg version N-71544-g82d9c4e Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 23.100 / 54. 23.100
libavcodec 56. 35.100 / 56. 35.100
libavformat 56. 30.100 / 56. 30.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 14.100 / 5. 14.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, dshow, from 'video=Microsoft LifeCam HD-5000':
Duration: N/A, start: 428574.351000, bitrate: N/A
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x360, 25 tbr,
10000k tbn, 25 tbc
[segment @ 00000000098a18e0] Codec for stream 0 does not use global headers but
container format requires global headers
[mpeg @ 00000000030c8ba0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, segment, to 'c:\Users\Desktop\out_%03d.mpg':
Metadata:
encoder : Lavf56.30.100
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x360, q=2-31,
25 tbr, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize=N/A time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ove
rhead: unknown
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=448222 size=460800
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=450263 size=460800
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=450263 size=460800
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=452304 size=460800
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=452304 size=460800
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=454345 size=460800
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=454345 size=460800
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=456386 size=460800
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=456386 size=460800
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=458427 size=460800
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=458427 size=460800
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=460468 size=460800
[mpeg @ 00000000003f8ba0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000003f8ba0] buffer underflow st=0 bufi=460468 size=460800
frame= 22 fps= 20 q=-1.0 Lsize=N/A time=00:00:01.09 bitrate=N/A
video:9900kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: unknown
Any help or suggestions are greatly appreciated!
Thanks,
Leo
More information about the ffmpeg-user
mailing list