ethaniel
Posts: 14
Joined: Sat Dec 16, 2017 9:26 am

Skipping raw h264 frames with gst-launch gst-launch-1.0

Tue Mar 27, 2018 8:26 pm

I have a v4l2 /dev/video0 which outputs a h264 video stream.

Since I'm using a Auvidea B101, the output h264 stream has weird fps - somewhere around 48.

2 questions:
1. Is is possible to limit the stream to 25 fps with gst-launch-1.0 without reencoding?
2. Is it possible to drop the fps twice with gst-launch-1.0 without reencoding?

I need that same h264 stream on stdout (I'm going to feed it into ffmpeg and stream to youtube without reencoding).

Thank you!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9624
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Skipping raw h264 frames with gst-launch gst-launch-1.0

Tue Mar 27, 2018 9:08 pm

bcm2835-v4l2 is still using the firmware, the same as raspivid. Support will not be forthcoming on the HDMI capture board via the firmware.

And the simple answer is that no you can't skip H264 frames as they will be used as reference frames for subsequent frames.
There is an option within MMAL/IL to request that every other frame can be dropped (it won't be used as a reference frame), but that isn't available via the V4L2 driver.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ethaniel
Posts: 14
Joined: Sat Dec 16, 2017 9:26 am

Re: Skipping raw h264 frames with gst-launch gst-launch-1.0

Wed Mar 28, 2018 6:04 pm

6by9 wrote:
Tue Mar 27, 2018 9:08 pm
bcm2835-v4l2 is still using the firmware, the same as raspivid. Support will not be forthcoming on the HDMI capture board via the firmware.

And the simple answer is that no you can't skip H264 frames as they will be used as reference frames for subsequent frames.
There is an option within MMAL/IL to request that every other frame can be dropped (it won't be used as a reference frame), but that isn't available via the V4L2 driver.
Wow. Thank you for the info.

I'm using a GoPro Hero 6 which I'd like to turn into a 24/7 camera & stream to youtube via rpi3.
Right now I have 2 options - either stream with insane fps coming from v4l2 (and use too much bandwidth).
Or use h264_omx ffmpeg for gpu encoding, but that gives me 22 fps tops.

Would you happen to know a reliable hdmi-in board which provides proper 1080p h264 output with controllable fps (hopefully, 30)? Which I could stream with ffmpeg without reencoding?

Thank you!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9624
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Skipping raw h264 frames with gst-launch gst-launch-1.0

Wed Mar 28, 2018 8:35 pm

Hold fire for a couple of weeks. I have a driver written that I am trying to get merged into the mainline kernel, but that's been stalled since Novemeber due to other commitments. That's what the thread viewtopic.php?f=38&t=120702 is all about.
Today I've had a request from my manager to get it merged to the Pi branch even if not quite ready for upstream, so that should get done in the next few weeks.

If you are happy to build the kernel for yourself, then the instructions from madnerd linked off viewtopic.php?f=38&t=120702&start=300#p1231388 look fairly complete. It requires significantly more configuration than raspivid (you need to load EDID files and action configuring the timing modes), but also is more flexible and will be supported. Combine it with https://github.com/6by9/yavta and the timings are dealt with for you, but you still need to handle some of it yourself.
(Part of my current work may be useful in really optimising this via gstreamer or similar, but we'll see)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ethaniel
Posts: 14
Joined: Sat Dec 16, 2017 9:26 am

Re: Skipping raw h264 frames with gst-launch gst-launch-1.0

Thu Mar 29, 2018 3:30 pm

It's too hard for me, unfortunately. I decided to buy an external hdmi encoder from aliexpress, and connect it to a usb ethernet port on the rpi3.
rpi3 will pick up the flv stream from the encoder and broadcast it directly to youtube.

This way each device is doing it's job and I won't be hitting any module errors.

Return to “Graphics programming”