Start a new topic

Can't record compressed video with ffmpeg

Hello. I have a problem with BC-H16480, when I'm trying to save H.264 stream to file with ffmpeg:


  1. # ffmpeg -f v4l2 -input_format h264 -standard pal-b -s 704x576 -i /dev/video1 -vcodec copy -loglevel debug test.mp4

  2. ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers

  3. built on Sep 12 2013 22:23:23 with gcc 4.7 (Debian 4.7.2-5)

  4. configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr libavutil 52. 38.100 / 52. 38.100

  5. libavcodec 55. 18.102 / 55. 18.102

  6. libavformat 55. 12.100 / 55. 12.100

  7. libavdevice 55. 3.100 / 55. 3.100

  8. libavfilter 3. 79.101 / 3. 79.101

  9. libswscale 2. 3.100 / 2. 3.100

  10. libswresample 0. 17.102 / 0. 17.102

  11. libpostproc 52. 3.100 / 52. 3.100

  12. Splitting the commandline.

  13. Reading option '-f' ... matched as option 'f' (force format) with argument 'v4l2'.

  14. Reading option '-input_format' ... matched as AVOption 'input_format' with argument 'h264'.

  15. Reading option '-standard' ... matched as AVOption 'standard' with argument 'pal-b'.

  16. Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '704x576'.

  17. Reading option '-i' ... matched as input file with argument '/dev/video1'.

  18. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.

  19. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.

  20. Reading option 'test.mp4' ... matched as output file.

  21. Finished splitting the commandline.

  22. Parsing a group of options: global .

  23. Applying option loglevel (set logging level) with argument debug.

  24. Successfully parsed a group of options.

  25. Parsing a group of options: input file /dev/video1.

  26. Applying option f (force format) with argument v4l2.

  27. Applying option s (set frame size (WxH or abbreviation)) with argument 704x576.

  28. Successfully parsed a group of options.

  29. Opening an input file: /dev/video1.

  30. [video4linux2,v4l2 @ 0x1faafe0] fd:4 capabilities:5000001

  31. [video4linux2,v4l2 @ 0x1faafe0] Current input_channel: 0, input_name: Encoder 1

  32. [video4linux2,v4l2 @ 0x1faafe0] The V4L2 driver is using the interlaced mode

  33. [video4linux2,v4l2 @ 0x1faafe0] Setting standard: pal-b

  34. [video4linux2,v4l2 @ 0x1faafe0] Current standard: PAL-B, id: 1, frameperiod: 1/25

  35. [h264 @ 0x1fabc60] non-existing PPS 0 referenced

  36. [h264 @ 0x1fabc60] decode_slice_header error

  37. [h264 @ 0x1fabc60] no frame!

  38. [h264 @ 0x1fabc60] non-existing PPS 0 referenced

  39. [h264 @ 0x1fabc60] decode_slice_header error

  40. [h264 @ 0x1fabc60] no frame!

  41. [video4linux2,v4l2 @ 0x1faafe0] All info found

  42. Input #0, video4linux2,v4l2, from '/dev/video1':

  43. Duration: N/A, start: 50897.855756, bitrate: N/A

  44. Stream #0:0, 27, 1/1000000: Video: h264 (Baseline), yuv420p, 704x576, 1/2000000, -4 kb/s, 25 fps, 25 tbr, 1000k tbn, 2000k tbc

  45. Successfully opened the file.

  46. Parsing a group of options: output file test.mp4.

  47. Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.

  48. Successfully parsed a group of options.

  49. Opening an output file: test.mp4.

  50. File 'test.mp4' already exists. Overwrite ? [y/N] y

  51. Successfully opened the file.

  52. Output #0, mp4, to 'test.mp4':

  53. Metadata:

  54. encoder : Lavf55.12.100

  55. Stream #0:0, 0, 1/1000000: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 704x576, 1/1000000, q=2-31, -4 kb/s, 25 fps, 1000k tbn, 1000k tbc

  56. Stream mapping:

  57. Stream #0:0 -> #0:0 (copy)

  58. Press [q] to stop, [?] for help

  59. frame= 0 fps=0.0 q=-1.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A

  60. video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead inf%

  61. Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

  62. 0 frames successfully decoded, 0 decoding errors

  63. [AVIOContext @ 0x20e69a0] Statistics: 4 seeks, 4 writeouts

But when I remove "-vcodec copy" video gets captured and reencoded normally. In both h264 and mjpeg input_formats. I even can copy mjpeg stream:


  1. # ffmpeg -f v4l2 -input_format mjpeg -standard pal-b -s 704x576 -i /dev/video1 -vcodec copy test.mjpeg

  2. ...

  3. Input #0, video4linux2,v4l2, from '/dev/video1':

  4. Duration: N/A, start: 51541.620871, bitrate: N/A

  5. Stream #0:0: Video: mjpeg, yuvj420p, 704x576, -4 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc

  6. File 'test.mjpeg' already exists. Overwrite ? [y/N] y

  7. Output #0, mjpeg, to 'test.mjpeg':

  8. Metadata:

  9. encoder : Lavf55.12.100

  10. Stream #0:0: Video: mjpeg, yuvj420p, 704x576, q=2-31, -4 kb/s, 25 fps, 90k tbn, 1000k tbc

  11. Stream mapping:

  12. Stream #0:0 -> #0:0 (copy)

  13. Press [q] to stop, [?] for help

  14. frame= 88 fps= 39 q=-1.0 Lsize= 1778kB time=00:00:03.63 bitrate=4002.3kbits/s

solo6x10-dkms version is 2.4.8-6. I had to add videobuf-dma-contig.c from kernel sources to /var/lib/dkms/solo6010/2.4.8/source to compile module.

Login or Signup to post a comment