matrog
Posts: 1
Joined: Sat Feb 24, 2018 7:38 am

Rasperry 2 ffmpeg hw encoding issues

Sat Feb 24, 2018 8:03 am

Hi, this is my first post and I hope I'm posting in the right section!

I'm trying to encode a unicast webcam stream using raspy2 and ffmpeg/ffserver using hw accelerated ecnoding but looks like it's not working and it's CPU (which spikes to 130%)

this is my ffserver config

Code: Select all

<Feed feed1.ffm>
	File /tmp/feed1.ffm
	FileMaxSize 50M
	ACL allow 127.0.0.1
</Feed>

# if you want to use mpegts format instead of flv
# then change "live.flv" to "live.ts"
# and also change "Format flv" to "Format mpegts"
<Stream live.ts>
	Format mpegts
	Feed feed1.ffm

	VideoCodec libx264
	VideoFrameRate 30
	VideoBitRate 800
	VideoSize 1280x720
	AVOptionVideo crf 23
	AVOptionVideo preset medium
	# for more info on crf/preset options, type: x264 --help
	AVOptionVideo flags +global_header

	AudioCodec aac
	Strict -2
	AudioBitRate 128
	AudioChannels 2
	AudioSampleRate 44100
	AVOptionAudio flags +global_header
</Stream>
this is ffmpeg

Code: Select all

[email protected]:~ $ ffmpeg
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 4.9.2 (Raspbian 4.9.2-10+deb8u1)
  configuration: --enable-gpl --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
and

Code: Select all

[email protected]:~ $ ffmpeg -encoders | grep h264_omx
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 4.9.2 (Raspbian 4.9.2-10+deb8u1)
  configuration: --enable-gpl --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
 V..... h264_omx             OpenMAX IL H.264 video encoder (codec h264)
i'm using

Code: Select all

ffmpeg -i "udp://:5004?overrun_nonfatal=1&fifo_size=50000000" http://localhost:8090/feed1.ffm
getting

Code: Select all

Input #0, mpegts, from 'udp://:5004?overrun_nonfatal=1&fifo_size=50000000':
  Duration: N/A, start: 6544.864000, bitrate: N/A
  Program 256
    Metadata:
      service_name    : AIR_CH_521_6M
      service_provider: ITE
    Stream #0:0[0x7d1]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p(top first), 1728x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x7d2]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
[tcp @ 0x2f98810] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[tcp @ 0x2fc4380] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
Stream mapping:
  Stream #0:1 -> #0:0 (mp2 (native) -> mp2 (native))
  Stream #0:0 -> #0:1 (h264 (native) -> h264 (h264_omx))
Schermata 2018-02-24 alle 09.00.36.png
Schermata 2018-02-24 alle 09.00.36.png (84.13 KiB) Viewed 129 times
any idea ofr suggestion is welcomed :)

thanks,
Matteo

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 69 guests