Trying to stream to rtmp from my rsp4 and a GoPro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
Hey Everyone,

I'm trying to stream from my GoPro into a USB capture device through my
Raspberry Pi 4 and send the feed up to Twitch or my rtmp server.  After
a lot of head banging I realized that there were two things that were
messing me up: 1) specifying an audio input seems to break things and 2)
trying to use the h264_v4l2m2m hardware encoder also seems to mess
things up.   After finding the ffmpeg streaming wiki here:

https://trac.ffmpeg.org/wiki/EncodingForStreamingSites

I was finally able to cobble this command-line together and get it
working... kinda:

*ffmpeg -f v4l2 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v
libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf
"format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv
rtmp://sfo.contribute.live-video.net/app/[my key]*

I say kinda because I can't seem to get audio working.  Now, I just want
to say that using the QT v4l2 test utility I'm able to get audio and
video simultaneously, so I know that the capture feed from my GoPro is
healthy, and using ffmpeg I'm able to record either video from
*/dev/video0* or audio from *plughw:2,0*, but it seems like whenever I
add *-f alsa -i plughw:2,0* in addition to *-i /dev/video0*, it won't
stream anything (or record anything during my recording attempts).

Am I missing something obvious here?  I was hoping that I'm just doing
something stupid, but even looking on that wiki listed above it looks
like all I need to do is add *-f alsa -ac 2 -i plughw:2,0* and it should
work, but it just seems to kill the stream or record nothing.

Also, I'd love to be able to use the hardware encoder, so any thoughts
on that would be appreciated, but getting both audio and video is the
main priority.

Btw, if you're curious about what I'm doing, I'm trying to build a DIY
mobile streaming rig that I can take hangliding/paragliding with me so
people can watch.  I thought it would be a fun project but this portion
has turned out to be quite challenging!!

Thanks!

Mike

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Gisbert Haas
Hi Mike,


can you post the full output please.

I had the similar issues and curious if your output looks similar to mine.

Btw, in your command line you miss the audio input.


Gis.


On 2/13/21 1:23 AM, Mike Soultanian wrote:

> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you recognize the sender
> and know the content is safe.
>
>
> Hey Everyone,
>
> I'm trying to stream from my GoPro into a USB capture device through my
> Raspberry Pi 4 and send the feed up to Twitch or my rtmp server. After
> a lot of head banging I realized that there were two things that were
> messing me up: 1) specifying an audio input seems to break things and 2)
> trying to use the h264_v4l2m2m hardware encoder also seems to mess
> things up.   After finding the ffmpeg streaming wiki here:
>
> https://trac.ffmpeg.org/wiki/EncodingForStreamingSites
>
> I was finally able to cobble this command-line together and get it
> working... kinda:
>
> *ffmpeg -f v4l2 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v
> libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf
> "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv
> rtmp://sfo.contribute.live-video.net/app/[my key]*
>
> I say kinda because I can't seem to get audio working.  Now, I just want
> to say that using the QT v4l2 test utility I'm able to get audio and
> video simultaneously, so I know that the capture feed from my GoPro is
> healthy, and using ffmpeg I'm able to record either video from
> */dev/video0* or audio from *plughw:2,0*, but it seems like whenever I
> add *-f alsa -i plughw:2,0* in addition to *-i /dev/video0*, it won't
> stream anything (or record anything during my recording attempts).
>
> Am I missing something obvious here?  I was hoping that I'm just doing
> something stupid, but even looking on that wiki listed above it looks
> like all I need to do is add *-f alsa -ac 2 -i plughw:2,0* and it should
> work, but it just seems to kill the stream or record nothing.
>
> Also, I'd love to be able to use the hardware encoder, so any thoughts
> on that would be appreciated, but getting both audio and video is the
> main priority.
>
> Btw, if you're curious about what I'm doing, I'm trying to build a DIY
> mobile streaming rig that I can take hangliding/paragliding with me so
> people can watch.  I thought it would be a fun project but this portion
> has turned out to be quite challenging!!
>
> Thanks!
>
> Mike
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
On 2/13/2021 1:54 AM, Gisbert Haas wrote:
> can you post the full output please.

Sorry, I didn't include it because when I have audio it doesn't work.  I
have tried *-f alsa -i* with the following: *plughw:2,0*,
*hw:CARD=capture,DEV=0*, and *plughw:CARD=capture,DEV=0* and none of
them seem to work - I could very well be using them incorrectly.  If
you're able to tell when I should be using after "-i" for the sound,
I'll give it a try.  Here is the output from various commands (ezcap is
my USB capture card):

*pi@raspberrypi:~ $ cat /proc/asound/devices*
0: [ 0]   : control
16: [ 0- 0]: digital audio playback
32: [ 1]   : control
33:        : timer
48: [ 1- 0]: digital audio playback
64: [ 2]   : control
88: [ 2- 0]: digital audio capture

*pi@raspberrypi:~ $ arecord -L*
default
     Playback/recording through the PulseAudio sound server
null
     Discard all samples (playback) or generate zero samples (capture)
jack
     JACK Audio Connection Kit
pulse
     PulseAudio Sound Server
usbstream:CARD=b1
     bcm2835 HDMI 1
     USB Stream Output
usbstream:CARD=Headphones
     bcm2835 Headphones
     USB Stream Output
sysdefault:CARD=capture
     ezcap U3 capture, USB Audio
     Default Audio Device
front:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     Front speakers
surround21:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     4.0 Surround output to Front and Rear speakers
surround41:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     Direct sample mixing device
dsnoop:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     Direct sample snooping device
hw:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     Direct hardware device without any conversions
plughw:CARD=capture,DEV=0
     ezcap U3 capture, USB Audio
     Hardware device with all software conversions
usbstream:CARD=capture
     ezcap U3 capture
     USB Stream Output

*pi@raspberrypi:~ $ arecord -l*
**** List of CAPTURE Hardware Devices ****
card 2: capture [ezcap U3 capture], device 0: USB Audio [USB Audio]
   Subdevices: 1/1
   Subdevice #0: subdevice #0

And here is the command and output for when it works (without sound - if
you can help me form the correct audio input syntax, I'll gladly try it
and post the output):

*pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 &&
ffmpeg -f v4l2 -thread_queue_size 384 -video_size 1280x720 -framerate 30
-i /dev/video0 -c:v h264_omx -preset veryfast -b:v 1984k -maxrate 1984k
-bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100
-f flv rtmp://sfo.contribute.live-video.net/app/*
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
developers
   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
   configuration: --prefix=/home/pi/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/pi/ffmpeg_build/include
--extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-omx
--enable-omx-rpi --enable-nonfree
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.122.100 / 58.122.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 11.103 / 58. 11.103
   libavfilter     7.106.100 /  7.106.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x327d420] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Codec AVOption preset (Encoding preset [0, 8]) specified for output file
#0 (rtmp://sfo.contribute.live-video.net/app/) has not been used for any
stream. The most likely reason is either wrong type (e.g. a video option
with no video streams) or that it is a private option of some encoder
which was not actually used for any stream.
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x327d420] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
     Last message repeated 30 times
[h264_omx @ 0x32817b0] Using OMX.broadcom.video_encode
Output #0, flv, to 'rtmp://sfo.contribute.live-video.net/app/':
   Metadata:
     encoder         : Lavf58.67.100
   Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv,
progressive), 1280x720, q=2-31, 1984 kb/s, 30 fps, 1k tbn
     Metadata:
       encoder         : Lavc58.122.100 h264_omx
[flv @ 0x3280360] Failed to update header with correct duration.ate= 
37.0kbits/s speed=48.2x
[flv @ 0x3280360] Failed to update header with correct filesize.
frame= 1377 fps= 27 q=-0.0 Lsize=   11138kB time=00:40:49.76 bitrate= 
37.2kbits/s speed=47.9x
video:11111kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.244566%
Exiting normally, received signal 2.
pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 &&
ffmpeg -f v4l2 -thread_queue_size 384 -video_size 1280x720 -framerate 30
-i /dev/video0 -c:v libx264 -preset veryfast -b:v 1984k -maxrate 1984k
-bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100
-f flv rtmp://sfo.contribute.live-video.net/app/
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
developers
   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
   configuration: --prefix=/home/pi/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/pi/ffmpeg_build/include
--extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-omx
--enable-omx-rpi --enable-nonfree
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.122.100 / 58.122.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 11.103 / 58. 11.103
   libavfilter     7.106.100 /  7.106.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x2756420] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x2756420] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
     Last message repeated 30 times
[libx264 @ 0x275a7b0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x275a7b0] profile High, level 3.1
[libx264 @ 0x275a7b0] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft
2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=60 keyint_min=6
scenecut=40 intra_refresh=0 rc_lookahead=10 rc=cbr mbtree=1 bitrate=1984
ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1984
vbv_bufsize=3968 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://sfo.contribute.live-video.net/app/':
   Metadata:
     encoder         : Lavf58.67.100
   Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv,
progressive), 1280x720, q=2-31, 1984 kb/s, 30 fps, 1k tbn
     Metadata:
       encoder         : Lavc58.122.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 1984000/0/1984000 buffer size: 3968000
vbv_delay: N/A
[flv @ 0x2759360] Failed to update header with correct duration.ate= 
38.1kbits/s speed=47.2x
[flv @ 0x2759360] Failed to update header with correct filesize.
*frame= 1468 fps= 27 q=-1.0 Lsize=   12026kB time=00:42:21.43 bitrate= 
38.8kbits/s speed=46.8x << this line counts up until I hit q*
video:11997kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.241407%
[libx264 @ 0x275a7b0] frame I:30    Avg QP:22.77  size: 35542
[libx264 @ 0x275a7b0] frame P:775   Avg QP:25.98  size: 10805
[libx264 @ 0x275a7b0] frame B:663   Avg QP:26.90  size:  4290
[libx264 @ 0x275a7b0] consecutive B-frames: 13.4% 75.9% 10.2% 0.5%
[libx264 @ 0x275a7b0] mb I  I16..4: 31.8% 50.5% 17.7%
[libx264 @ 0x275a7b0] mb P  I16..4: 12.7%  7.3%  0.4%  P16..4: 38.1% 
8.9%  2.7%  0.0%  0.0%    skip:29.9%
[libx264 @ 0x275a7b0] mb B  I16..4:  1.7%  0.7%  0.0%  B16..8: 13.1% 
2.6%  0.2%  direct:22.6%  skip:59.1%  L0:39.8% L1:53.3% BI: 7.0%
[libx264 @ 0x275a7b0] 8x8 transform intra:37.6% inter:18.0%
[libx264 @ 0x275a7b0] coded y,uvDC,uvAC intra: 24.9% 54.3% 5.3% inter:
7.1% 30.7% 0.0%
[libx264 @ 0x275a7b0] i16 v,h,dc,p: 51% 24% 17%  8%
[libx264 @ 0x275a7b0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 19% 41% 3%  5% 
4%  5%  3%  6%
[libx264 @ 0x275a7b0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 23% 21% 4%  8% 
5%  6%  5%  7%
[libx264 @ 0x275a7b0] i8c dc,h,v,p: 59% 19% 18%  3%
[libx264 @ 0x275a7b0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x275a7b0] kb/s:1990.71


Thanks!

Mike



>
> On 2/13/21 1:23 AM, Mike Soultanian wrote:
>> CAUTION: This email originated from outside of the organization. Do
>> not click links or open attachments unless you recognize the sender
>> and know the content is safe.
>>
>>
>> Hey Everyone,
>>
>> I'm trying to stream from my GoPro into a USB capture device through my
>> Raspberry Pi 4 and send the feed up to Twitch or my rtmp server. After
>> a lot of head banging I realized that there were two things that were
>> messing me up: 1) specifying an audio input seems to break things and 2)
>> trying to use the h264_v4l2m2m hardware encoder also seems to mess
>> things up.   After finding the ffmpeg streaming wiki here:
>>
>> https://trac.ffmpeg.org/wiki/EncodingForStreamingSites
>>
>> I was finally able to cobble this command-line together and get it
>> working... kinda:
>>
>> *ffmpeg -f v4l2 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v
>> libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf
>> "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv
>> rtmp://sfo.contribute.live-video.net/app/[my key]*
>>
>> I say kinda because I can't seem to get audio working.  Now, I just want
>> to say that using the QT v4l2 test utility I'm able to get audio and
>> video simultaneously, so I know that the capture feed from my GoPro is
>> healthy, and using ffmpeg I'm able to record either video from
>> */dev/video0* or audio from *plughw:2,0*, but it seems like whenever I
>> add *-f alsa -i plughw:2,0* in addition to *-i /dev/video0*, it won't
>> stream anything (or record anything during my recording attempts).
>>
>> Am I missing something obvious here?  I was hoping that I'm just doing
>> something stupid, but even looking on that wiki listed above it looks
>> like all I need to do is add *-f alsa -ac 2 -i plughw:2,0* and it should
>> work, but it just seems to kill the stream or record nothing.
>>
>> Also, I'd love to be able to use the hardware encoder, so any thoughts
>> on that would be appreciated, but getting both audio and video is the
>> main priority.
>>
>> Btw, if you're curious about what I'm doing, I'm trying to build a DIY
>> mobile streaming rig that I can take hangliding/paragliding with me so
>> people can watch.  I thought it would be a fun project but this portion
>> has turned out to be quite challenging!!
>>
>> Thanks!
>>
>> Mike
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Gisbert Haas
Can you post the ffmpeg output with audio input in the command line

Sent from my iPhone

On 13. Feb 2021, at 11:21, Mike Soultanian <[hidden email]> wrote:



CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


On 2/13/2021 1:54 AM, Gisbert Haas wrote:
can you post the full output please.

Sorry, I didn't include it because when I have audio it doesn't work.  I have tried -f alsa -i with the following: plughw:2,0, hw:CARD=capture,DEV=0, and plughw:CARD=capture,DEV=0 and none of them seem to work - I could very well be using them incorrectly.  If you're able to tell when I should be using after "-i" for the sound, I'll give it a try.  Here is the output from various commands (ezcap is my USB capture card):

pi@raspberrypi:~ $ cat /proc/asound/devices
0: [ 0]   : control
16: [ 0- 0]: digital audio playback
32: [ 1]   : control
33:        : timer
48: [ 1- 0]: digital audio playback
64: [ 2]   : control
88: [ 2- 0]: digital audio capture

pi@raspberrypi:~ $ arecord -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
usbstream:CARD=b1
    bcm2835 HDMI 1
    USB Stream Output
usbstream:CARD=Headphones
    bcm2835 Headphones
    USB Stream Output
sysdefault:CARD=capture
    ezcap U3 capture, USB Audio
    Default Audio Device
front:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    Front speakers
surround21:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    Direct sample mixing device
dsnoop:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    Direct sample snooping device
hw:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    Direct hardware device without any conversions
plughw:CARD=capture,DEV=0
    ezcap U3 capture, USB Audio
    Hardware device with all software conversions
usbstream:CARD=capture
    ezcap U3 capture
    USB Stream Output

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: capture [ezcap U3 capture], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


And here is the command and output for when it works (without sound - if you can help me form the correct audio input syntax, I'll gladly try it and post the output):

pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 && ffmpeg -f v4l2 -thread_queue_size 384 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v h264_omx -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv rtmp://sfo.contribute.live-video.net/app/
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/home/pi/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/pi/ffmpeg_build/include --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-omx --enable-omx-rpi --enable-nonfree
  libavutil      56. 65.100 / 56. 65.100
  libavcodec     58.122.100 / 58.122.100
  libavformat    58. 67.100 / 58. 67.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7.106.100 /  7.106.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x327d420] Dequeued v4l2 buffer contains corrupted data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Codec AVOption preset (Encoding preset [0, 8]) specified for output file #0 (rtmp://sfo.contribute.live-video.net/app/) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x327d420] Dequeued v4l2 buffer contains corrupted data (0 bytes).
    Last message repeated 30 times
[h264_omx @ 0x32817b0] Using OMX.broadcom.video_encode
Output #0, flv, to 'rtmp://sfo.contribute.live-video.net/app/':
  Metadata:
    encoder         : Lavf58.67.100
  Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, progressive), 1280x720, q=2-31, 1984 kb/s, 30 fps, 1k tbn
    Metadata:
      encoder         : Lavc58.122.100 h264_omx
[flv @ 0x3280360] Failed to update header with correct duration.ate=  37.0kbits/s speed=48.2x
[flv @ 0x3280360] Failed to update header with correct filesize.
frame= 1377 fps= 27 q=-0.0 Lsize=   11138kB time=00:40:49.76 bitrate=  37.2kbits/s speed=47.9x
video:11111kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.244566%
Exiting normally, received signal 2.
pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 && ffmpeg -f v4l2 -thread_queue_size 384 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv rtmp://sfo.contribute.live-video.net/app/
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/home/pi/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/pi/ffmpeg_build/include --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-omx --enable-omx-rpi --enable-nonfree
  libavutil      56. 65.100 / 56. 65.100
  libavcodec     58.122.100 / 58.122.100
  libavformat    58. 67.100 / 58. 67.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7.106.100 /  7.106.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x2756420] Dequeued v4l2 buffer contains corrupted data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x2756420] Dequeued v4l2 buffer contains corrupted data (0 bytes).
    Last message repeated 30 times
[libx264 @ 0x275a7b0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x275a7b0] profile High, level 3.1
[libx264 @ 0x275a7b0] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=cbr mbtree=1 bitrate=1984 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1984 vbv_bufsize=3968 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://sfo.contribute.live-video.net/app/':
  Metadata:
    encoder         : Lavf58.67.100
  Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, progressive), 1280x720, q=2-31, 1984 kb/s, 30 fps, 1k tbn
    Metadata:
      encoder         : Lavc58.122.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 1984000/0/1984000 buffer size: 3968000 vbv_delay: N/A
[flv @ 0x2759360] Failed to update header with correct duration.ate=  38.1kbits/s speed=47.2x
[flv @ 0x2759360] Failed to update header with correct filesize.
frame= 1468 fps= 27 q=-1.0 Lsize=   12026kB time=00:42:21.43 bitrate=  38.8kbits/s speed=46.8x << this line counts up until I hit q
video:11997kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.241407%
[libx264 @ 0x275a7b0] frame I:30    Avg QP:22.77  size: 35542
[libx264 @ 0x275a7b0] frame P:775   Avg QP:25.98  size: 10805
[libx264 @ 0x275a7b0] frame B:663   Avg QP:26.90  size:  4290
[libx264 @ 0x275a7b0] consecutive B-frames: 13.4% 75.9% 10.2%  0.5%
[libx264 @ 0x275a7b0] mb I  I16..4: 31.8% 50.5% 17.7%
[libx264 @ 0x275a7b0] mb P  I16..4: 12.7%  7.3%  0.4%  P16..4: 38.1%  8.9%  2.7%  0.0%  0.0%    skip:29.9%
[libx264 @ 0x275a7b0] mb B  I16..4:  1.7%  0.7%  0.0%  B16..8: 13.1%  2.6%  0.2%  direct:22.6%  skip:59.1%  L0:39.8% L1:53.3% BI: 7.0%
[libx264 @ 0x275a7b0] 8x8 transform intra:37.6% inter:18.0%
[libx264 @ 0x275a7b0] coded y,uvDC,uvAC intra: 24.9% 54.3% 5.3% inter: 7.1% 30.7% 0.0%
[libx264 @ 0x275a7b0] i16 v,h,dc,p: 51% 24% 17%  8%
[libx264 @ 0x275a7b0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 19% 41%  3%  5%  4%  5%  3%  6%
[libx264 @ 0x275a7b0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 23% 21%  4%  8%  5%  6%  5%  7%
[libx264 @ 0x275a7b0] i8c dc,h,v,p: 59% 19% 18%  3%
[libx264 @ 0x275a7b0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x275a7b0] kb/s:1990.71


Thanks!

Mike



On 2/13/21 1:23 AM, Mike Soultanian wrote:
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


Hey Everyone,

I'm trying to stream from my GoPro into a USB capture device through my
Raspberry Pi 4 and send the feed up to Twitch or my rtmp server. After
a lot of head banging I realized that there were two things that were
messing me up: 1) specifying an audio input seems to break things and 2)
trying to use the h264_v4l2m2m hardware encoder also seems to mess
things up.   After finding the ffmpeg streaming wiki here:

https://trac.ffmpeg.org/wiki/EncodingForStreamingSites

I was finally able to cobble this command-line together and get it
working... kinda:

*ffmpeg -f v4l2 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v
libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf
"format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv
rtmp://sfo.contribute.live-video.net/app/[my key]*

I say kinda because I can't seem to get audio working.  Now, I just want
to say that using the QT v4l2 test utility I'm able to get audio and
video simultaneously, so I know that the capture feed from my GoPro is
healthy, and using ffmpeg I'm able to record either video from
*/dev/video0* or audio from *plughw:2,0*, but it seems like whenever I
add *-f alsa -i plughw:2,0* in addition to *-i /dev/video0*, it won't
stream anything (or record anything during my recording attempts).

Am I missing something obvious here?  I was hoping that I'm just doing
something stupid, but even looking on that wiki listed above it looks
like all I need to do is add *-f alsa -ac 2 -i plughw:2,0* and it should
work, but it just seems to kill the stream or record nothing.

Also, I'd love to be able to use the hardware encoder, so any thoughts
on that would be appreciated, but getting both audio and video is the
main priority.

Btw, if you're curious about what I'm doing, I'm trying to build a DIY
mobile streaming rig that I can take hangliding/paragliding with me so
people can watch.  I thought it would be a fun project but this portion
has turned out to be quite challenging!!

Thanks!

Mike

_______________________________________________
ffmpeg-user mailing list
[hidden email]<mailto:[hidden email]>
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email]<mailto:[hidden email]> with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
Ok, I did a lot more testing and have learned a bit more about my
hardware and the various names of audio devices.  Also, I didn't mention
it in the previous email, but I did recompile ffmpeg from the latest
source.  After a bunch of research and testing I found all of these
commands to work:

v4l2-ctl --set-fmt-video=width=1280,height=720
ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -c:v
libx264                -vf format=yuv420p -y Desktop/test.mp4
ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -c:v
h264_omx          -vf format=yuv420p -y Desktop/test.mp4
ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -c:v
h264_v4l2m2m -vf format=yuv420p -y Desktop/test.mp4
ffmpeg -f alsa -ac 2 -i
hw:CARD=capture,DEV=0                                    -c:v
h264_omx          -vf format=yuv420p -y Desktop/test.mp4

So, if I'm understanding this all correctly, I'm using the raw feed from
my capture card and converting it into a different format utilizing the
software encoder (first ffmpeg line above) and the hardware encoder
(second and third lines - omx/v4l2m2m), so it looks like I figured out
hardware encoding - one problem solved!  The first 3 ffmpeg lines
successfully recorded video.  I was also able to successfully record
audio in the last line above.

Now, here's where I tried to capture audio and video together:
*ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -f
alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf format=yuv420p -y
Desktop/test.mp4*

I let the command run for about 20 seconds.  When I play the file it has
audio at the beginning but no video, and the audio doesn't start until
about 5 seconds in. Eventually the audio stops and then it's just
silence and black. What's weird is the length is 14 minutes and if I try
and seek it will jump to the end and then briefly show some captured
video and then stop.  So it's like I'm getting both audio and video, but
it's not lined up and there's barely any video.  Also when the capture
was occurring, the *time= *counter wasn't going up - it was just staying
stuck at *time=00:14:31.46* whereas with all the individual audio or
video captures it will count up - plus that number coincidentally is the
length of the recorded video.  Also, the frame rate is super low with
the above audio/video ffmpeg line whereas it hangs out in the high 20s
when just recording video, probably because it's actually recording
video correctly...

Here is the full output from the failed video/audio capture (I hit q
after about 20 seconds):

*pi@raspberrypi:~ $ ffmpeg -f v4l2 -input_format yuyv422 -framerate 30
-i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf
format=yuv420p -y Desktop/test.mp4*
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
developers
   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
   configuration: --prefix=/home/pi/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/pi/ffmpeg_build/include
--extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-omx
--enable-omx-rpi --enable-nonfree
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.122.100 / 58.122.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 11.103 / 58. 11.103
   libavfilter     7.106.100 /  7.106.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x3b3e390] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=capture,DEV=0':
   Duration: N/A, start: 1613261965.042902, bitrate: 1536 kb/s
   Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
   Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x3b3e390] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
     Last message repeated 30 times
[libx264 @ 0x3b56fe0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x3b56fe0] profile High, level 3.1
[libx264 @ 0x3b56fe0] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft
2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
[alsa @ 0x3b412b0] Thread message queue blocking; consider raising the
thread_queue_size option (current value: 8)
[alsa @ 0x3b412b0] ALSA buffer xrun.
Output #0, mp4, to 'Desktop/test.mp4':
   Metadata:
     encoder         : Lavf58.67.100
   Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv,
progressive), 1280x720, q=2-31, 30 fps, 15360 tbn
     Metadata:
       encoder         : Lavc58.122.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
   Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 128 kb/s
     Metadata:
       encoder         : Lavc58.122.100 aac
[video4linux2,v4l2 @ 0x3b3e390] Thread message queue blocking; consider
raising the thread_queue_size option (current value: 8)
*frame=   51 fps=1.6 q=-1.0 Lsize=     549kB time=00:14:31.46 bitrate=  
5.2kbits/s dup=14 drop=0 speed=27.4x *
video:140kB audio:394kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 2.829021%
[libx264 @ 0x3b56fe0] frame I:2     Avg QP:12.23  size: 45880
[libx264 @ 0x3b56fe0] frame P:14    Avg QP:19.18  size:  2835
[libx264 @ 0x3b56fe0] frame B:35    Avg QP:21.92  size:   335
[libx264 @ 0x3b56fe0] consecutive B-frames:  7.8%  0.0%  5.9% 86.3%
[libx264 @ 0x3b56fe0] mb I  I16..4: 66.3% 15.7% 18.0%
[libx264 @ 0x3b56fe0] mb P  I16..4:  0.6%  1.0%  0.2%  P16..4: 7.9% 
2.4%  1.2%  0.0%  0.0%    skip:86.7%
[libx264 @ 0x3b56fe0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 4.6% 
0.2%  0.0%  direct: 0.1%  skip:95.0%  L0:52.4% L1:46.2% BI: 1.4%
[libx264 @ 0x3b56fe0] 8x8 transform intra:20.3% inter:78.3%
[libx264 @ 0x3b56fe0] coded y,uvDC,uvAC intra: 23.0% 30.3% 20.2% inter:
1.1% 1.7% 0.4%
[libx264 @ 0x3b56fe0] i16 v,h,dc,p: 75% 18%  2%  5%
[libx264 @ 0x3b56fe0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 27% 19% 4%  4% 
5%  5%  5%  6%
[libx264 @ 0x3b56fe0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 34% 12% 3%  4% 
4%  6%  4%  5%
[libx264 @ 0x3b56fe0] i8c dc,h,v,p: 69% 19%  6%  5%
[libx264 @ 0x3b56fe0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3b56fe0] ref P L0: 71.6%  9.8% 14.0%  4.6%
[libx264 @ 0x3b56fe0] ref B L0: 92.3%  6.0%  1.7%
[libx264 @ 0x3b56fe0] ref B L1: 97.3%  2.7%
[libx264 @ 0x3b56fe0] kb/s:673.73
[aac @ 0x3b58f80] Qavg: 153.000


Lemme know if you need anything else!

Thanks,
Mike



On 2/13/2021 2:27 AM, Gisbert Haas wrote:

> Can you post the ffmpeg output with audio input in the command line
>
> Sent from my iPhone
>
>> On 13. Feb 2021, at 11:21, Mike Soultanian <[hidden email]> wrote:
>>
>> 
>> CAUTION: This email originated from outside of the organization. Do
>> not click links or open attachments unless you recognize the sender
>> and know the content is safe.
>>
>> On 2/13/2021 1:54 AM, Gisbert Haas wrote:
>>> can you post the full output please.
>>
>> Sorry, I didn't include it because when I have audio it doesn't
>> work.  I have tried *-f alsa -i* with the following: *plughw:2,0*,
>> *hw:CARD=capture,DEV=0*, and *plughw:CARD=capture,DEV=0* and none of
>> them seem to work - I could very well be using them incorrectly.  If
>> you're able to tell when I should be using after "-i" for the sound,
>> I'll give it a try.  Here is the output from various commands (ezcap
>> is my USB capture card):
>>
>> *pi@raspberrypi:~ $ cat /proc/asound/devices*
>> 0: [ 0]   : control
>> 16: [ 0- 0]: digital audio playback
>> 32: [ 1]   : control
>> 33:        : timer
>> 48: [ 1- 0]: digital audio playback
>> 64: [ 2]   : control
>> 88: [ 2- 0]: digital audio capture
>>
>> *pi@raspberrypi:~ $ arecord -L*
>> default
>>     Playback/recording through the PulseAudio sound server
>> null
>>     Discard all samples (playback) or generate zero samples (capture)
>> jack
>>     JACK Audio Connection Kit
>> pulse
>>     PulseAudio Sound Server
>> usbstream:CARD=b1
>>     bcm2835 HDMI 1
>>     USB Stream Output
>> usbstream:CARD=Headphones
>>     bcm2835 Headphones
>>     USB Stream Output
>> sysdefault:CARD=capture
>>     ezcap U3 capture, USB Audio
>>     Default Audio Device
>> front:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     Front speakers
>> surround21:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     2.1 Surround output to Front and Subwoofer speakers
>> surround40:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     4.0 Surround output to Front and Rear speakers
>> surround41:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     4.1 Surround output to Front, Rear and Subwoofer speakers
>> surround50:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     5.0 Surround output to Front, Center and Rear speakers
>> surround51:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     5.1 Surround output to Front, Center, Rear and Subwoofer speakers
>> surround71:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
>> iec958:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     IEC958 (S/PDIF) Digital Audio Output
>> dmix:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     Direct sample mixing device
>> dsnoop:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     Direct sample snooping device
>> hw:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     Direct hardware device without any conversions
>> plughw:CARD=capture,DEV=0
>>     ezcap U3 capture, USB Audio
>>     Hardware device with all software conversions
>> usbstream:CARD=capture
>>     ezcap U3 capture
>>     USB Stream Output
>>
>> *pi@raspberrypi:~ $ arecord -l*
>> **** List of CAPTURE Hardware Devices ****
>> card 2: capture [ezcap U3 capture], device 0: USB Audio [USB Audio]
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>>
>> And here is the command and output for when it works (without sound -
>> if you can help me form the correct audio input syntax, I'll gladly
>> try it and post the output):
>>
>> *pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 &&
>> ffmpeg -f v4l2 -thread_queue_size 384 -video_size 1280x720 -framerate
>> 30 -i /dev/video0 -c:v h264_omx -preset veryfast -b:v 1984k -maxrate
>> 1984k -bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k
>> -ar 44100 -f flv rtmp://sfo.contribute.live-video.net/app/*
>> ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
>> developers
>>   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
>>   configuration: --prefix=/home/pi/ffmpeg_build
>> --pkg-config-flags=--static
>> --extra-cflags=-I/home/pi/ffmpeg_build/include
>> --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread
>> -lm' --bindir=/home/pi/bin --enable-gpl --enable-gnutls
>> --enable-libass --enable-libfdk-aac --enable-libfreetype
>> --enable-libmp3lame --enable-libopus --enable-libsvtav1
>> --enable-libdav1d --enable-libvorbis --enable-libvpx --enable-libx264
>> --enable-libx265 --enable-omx --enable-omx-rpi --enable-nonfree
>>   libavutil      56. 65.100 / 56. 65.100
>>   libavcodec     58.122.100 / 58.122.100
>>   libavformat    58. 67.100 / 58. 67.100
>>   libavdevice    58. 11.103 / 58. 11.103
>>   libavfilter     7.106.100 /  7.106.100
>>   libswscale      5.  8.100 /  5.  8.100
>>   libswresample   3.  8.100 /  3.  8.100
>>   libpostproc    55.  8.100 / 55.  8.100
>> [video4linux2,v4l2 @ 0x327d420] Dequeued v4l2 buffer contains
>> corrupted data (0 bytes).
>> Input #0, video4linux2,v4l2, from '/dev/video0':
>>   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
>>   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
>> 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
>> Codec AVOption preset (Encoding preset [0, 8]) specified for output
>> file #0 (rtmp://sfo.contribute.live-video.net/app/) has not been used
>> for any stream. The most likely reason is either wrong type (e.g. a
>> video option with no video streams) or that it is a private option of
>> some encoder which was not actually used for any stream.
>> Stream mapping:
>>   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
>> Press [q] to stop, [?] for help
>> [video4linux2,v4l2 @ 0x327d420] Dequeued v4l2 buffer contains
>> corrupted data (0 bytes).
>>     Last message repeated 30 times
>> [h264_omx @ 0x32817b0] Using OMX.broadcom.video_encode
>> Output #0, flv, to 'rtmp://sfo.contribute.live-video.net/app/':
>>   Metadata:
>>     encoder         : Lavf58.67.100
>>   Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv,
>> progressive), 1280x720, q=2-31, 1984 kb/s, 30 fps, 1k tbn
>>     Metadata:
>>       encoder         : Lavc58.122.100 h264_omx
>> [flv @ 0x3280360] Failed to update header with correct duration.ate= 
>> 37.0kbits/s speed=48.2x
>> [flv @ 0x3280360] Failed to update header with correct filesize.
>> frame= 1377 fps= 27 q=-0.0 Lsize=   11138kB time=00:40:49.76
>> bitrate=  37.2kbits/s speed=47.9x
>> video:11111kB audio:0kB subtitle:0kB other streams:0kB global
>> headers:0kB muxing overhead: 0.244566%
>> Exiting normally, received signal 2.
>> pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 &&
>> ffmpeg -f v4l2 -thread_queue_size 384 -video_size 1280x720 -framerate
>> 30 -i /dev/video0 -c:v libx264 -preset veryfast -b:v 1984k -maxrate
>> 1984k -bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k
>> -ar 44100 -f flv rtmp://sfo.contribute.live-video.net/app/
>> ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
>> developers
>>   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
>>   configuration: --prefix=/home/pi/ffmpeg_build
>> --pkg-config-flags=--static
>> --extra-cflags=-I/home/pi/ffmpeg_build/include
>> --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread
>> -lm' --bindir=/home/pi/bin --enable-gpl --enable-gnutls
>> --enable-libass --enable-libfdk-aac --enable-libfreetype
>> --enable-libmp3lame --enable-libopus --enable-libsvtav1
>> --enable-libdav1d --enable-libvorbis --enable-libvpx --enable-libx264
>> --enable-libx265 --enable-omx --enable-omx-rpi --enable-nonfree
>>   libavutil      56. 65.100 / 56. 65.100
>>   libavcodec     58.122.100 / 58.122.100
>>   libavformat    58. 67.100 / 58. 67.100
>>   libavdevice    58. 11.103 / 58. 11.103
>>   libavfilter     7.106.100 /  7.106.100
>>   libswscale      5.  8.100 /  5.  8.100
>>   libswresample   3.  8.100 /  3.  8.100
>>   libpostproc    55.  8.100 / 55.  8.100
>> [video4linux2,v4l2 @ 0x2756420] Dequeued v4l2 buffer contains
>> corrupted data (0 bytes).
>> Input #0, video4linux2,v4l2, from '/dev/video0':
>>   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
>>   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
>> 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
>> Stream mapping:
>>   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
>> Press [q] to stop, [?] for help
>> [video4linux2,v4l2 @ 0x2756420] Dequeued v4l2 buffer contains
>> corrupted data (0 bytes).
>>     Last message repeated 30 times
>> [libx264 @ 0x275a7b0] using cpu capabilities: ARMv6 NEON
>> [libx264 @ 0x275a7b0] profile High, level 3.1
>> [libx264 @ 0x275a7b0] 264 - core 146 - H.264/MPEG-4 AVC codec -
>> Copyleft 2003-2015 - http://www.videolan.org/x264.html - options:
>> cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1
>> psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0
>> 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0
>> threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1
>> interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3
>> b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0
>> weightp=1 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0
>> rc_lookahead=10 rc=cbr mbtree=1 bitrate=1984 ratetol=1.0 qcomp=0.60
>> qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1984 vbv_bufsize=3968
>> nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
>> Output #0, flv, to 'rtmp://sfo.contribute.live-video.net/app/':
>>   Metadata:
>>     encoder         : Lavf58.67.100
>>   Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv,
>> progressive), 1280x720, q=2-31, 1984 kb/s, 30 fps, 1k tbn
>>     Metadata:
>>       encoder         : Lavc58.122.100 libx264
>>     Side data:
>>       cpb: bitrate max/min/avg: 1984000/0/1984000 buffer size:
>> 3968000 vbv_delay: N/A
>> [flv @ 0x2759360] Failed to update header with correct duration.ate= 
>> 38.1kbits/s speed=47.2x
>> [flv @ 0x2759360] Failed to update header with correct filesize.
>> *frame= 1468 fps= 27 q=-1.0 Lsize=   12026kB time=00:42:21.43
>> bitrate=  38.8kbits/s speed=46.8x << this line counts up until I hit q*
>> video:11997kB audio:0kB subtitle:0kB other streams:0kB global
>> headers:0kB muxing overhead: 0.241407%
>> [libx264 @ 0x275a7b0] frame I:30    Avg QP:22.77  size: 35542
>> [libx264 @ 0x275a7b0] frame P:775   Avg QP:25.98  size: 10805
>> [libx264 @ 0x275a7b0] frame B:663   Avg QP:26.90  size: 4290
>> [libx264 @ 0x275a7b0] consecutive B-frames: 13.4% 75.9% 10.2%  0.5%
>> [libx264 @ 0x275a7b0] mb I  I16..4: 31.8% 50.5% 17.7%
>> [libx264 @ 0x275a7b0] mb P  I16..4: 12.7%  7.3%  0.4% P16..4: 38.1% 
>> 8.9%  2.7%  0.0%  0.0%    skip:29.9%
>> [libx264 @ 0x275a7b0] mb B  I16..4:  1.7%  0.7%  0.0% B16..8: 13.1% 
>> 2.6%  0.2%  direct:22.6%  skip:59.1% L0:39.8% L1:53.3% BI: 7.0%
>> [libx264 @ 0x275a7b0] 8x8 transform intra:37.6% inter:18.0%
>> [libx264 @ 0x275a7b0] coded y,uvDC,uvAC intra: 24.9% 54.3% 5.3%
>> inter: 7.1% 30.7% 0.0%
>> [libx264 @ 0x275a7b0] i16 v,h,dc,p: 51% 24% 17%  8%
>> [libx264 @ 0x275a7b0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 19% 41%  3% 
>> 5%  4%  5%  3%  6%
>> [libx264 @ 0x275a7b0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 23% 21%  4% 
>> 8%  5%  6%  5%  7%
>> [libx264 @ 0x275a7b0] i8c dc,h,v,p: 59% 19% 18%  3%
>> [libx264 @ 0x275a7b0] Weighted P-Frames: Y:0.0% UV:0.0%
>> [libx264 @ 0x275a7b0] kb/s:1990.71
>>
>>
>> Thanks!
>>
>> Mike
>>
>>
>>
>>>
>>> On 2/13/21 1:23 AM, Mike Soultanian wrote:
>>>> CAUTION: This email originated from outside of the organization. Do
>>>> not click links or open attachments unless you recognize the sender
>>>> and know the content is safe.
>>>>
>>>>
>>>> Hey Everyone,
>>>>
>>>> I'm trying to stream from my GoPro into a USB capture device
>>>> through my
>>>> Raspberry Pi 4 and send the feed up to Twitch or my rtmp server. After
>>>> a lot of head banging I realized that there were two things that were
>>>> messing me up: 1) specifying an audio input seems to break things
>>>> and 2)
>>>> trying to use the h264_v4l2m2m hardware encoder also seems to mess
>>>> things up.   After finding the ffmpeg streaming wiki here:
>>>>
>>>> https://trac.ffmpeg.org/wiki/EncodingForStreamingSites
>>>>
>>>> I was finally able to cobble this command-line together and get it
>>>> working... kinda:
>>>>
>>>> *ffmpeg -f v4l2 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v
>>>> libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf
>>>> "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv
>>>> rtmp://sfo.contribute.live-video.net/app/[my key]*
>>>>
>>>> I say kinda because I can't seem to get audio working. Now, I just
>>>> want
>>>> to say that using the QT v4l2 test utility I'm able to get audio and
>>>> video simultaneously, so I know that the capture feed from my GoPro is
>>>> healthy, and using ffmpeg I'm able to record either video from
>>>> */dev/video0* or audio from *plughw:2,0*, but it seems like whenever I
>>>> add *-f alsa -i plughw:2,0* in addition to *-i /dev/video0*, it won't
>>>> stream anything (or record anything during my recording attempts).
>>>>
>>>> Am I missing something obvious here?  I was hoping that I'm just doing
>>>> something stupid, but even looking on that wiki listed above it looks
>>>> like all I need to do is add *-f alsa -ac 2 -i plughw:2,0* and it
>>>> should
>>>> work, but it just seems to kill the stream or record nothing.
>>>>
>>>> Also, I'd love to be able to use the hardware encoder, so any thoughts
>>>> on that would be appreciated, but getting both audio and video is the
>>>> main priority.
>>>>
>>>> Btw, if you're curious about what I'm doing, I'm trying to build a DIY
>>>> mobile streaming rig that I can take hangliding/paragliding with me so
>>>> people can watch.  I thought it would be a fun project but this
>>>> portion
>>>> has turned out to be quite challenging!!
>>>>
>>>> Thanks!
>>>>
>>>> Mike
>>>>
>>>> _______________________________________________
>>>> ffmpeg-user mailing list
>>>> [hidden email]
>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>>
>>>> To unsubscribe, visit link above, or email
>>>> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Carl Eugen Hoyos-2
Am So., 14. Feb. 2021 um 01:51 Uhr schrieb Mike Soultanian
<[hidden email]>:

> Input #0, video4linux2,v4l2, from '/dev/video0':
>    Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
>    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
> 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
> Guessed Channel Layout for Input Stream #1.0 : stereo
> Input #1, alsa, from 'hw:CARD=capture,DEV=0':
>    Duration: N/A, start: 1613261965.042902, bitrate: 1536 kb/s

It is not possible to synchronize these two streams due
to the different start times, test the ts option:
https://ffmpeg.org/ffmpeg-devices.html#video4linux2_002c-v4l2

Please find out what top-posting means and avoid it here, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
On 2/13/2021 5:36 PM, Carl Eugen Hoyos wrote:
> It is not possible to synchronize these two streams due
> to the different start times, test the ts option:
> https://ffmpeg.org/ffmpeg-devices.html#video4linux2_002c-v4l2
>
> Please find out what top-posting means and avoid it here, Carl Eugen
> _______________________________________________

Sorry about the top-post!

Where do I use the -ts option (audio, video, output, all)?  And are you
recommending using default, abs, or mono2abs?

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
On 2/13/2021 5:36 PM, Carl Eugen Hoyos wrote:
>> It is not possible to synchronize these two streams due
>> to the different start times, test the ts option:
>> https://ffmpeg.org/ffmpeg-devices.html#video4linux2_002c-v4l2
> Where do I use the -ts option (audio, video, output, all)?  And are
> you recommending using default, abs, or mono2abs?
>
Just fyi, I tried all of the following and none of them really worked:

1. ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -f
alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf format=yuv420p -y
-ts default Desktop/test.mp4

2. ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -f
alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf format=yuv420p -y
-ts abs Desktop/test.mp4

3. ffmpeg -f v4l2 -input_format yuyv422 -framerate 30 -i /dev/video0 -f
alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf format=yuv420p -y
-ts mono2abs Desktop/test.mp4

So 2 seems to be the closest to working, but with really inconsistent
behavior it's a stretch to say working - on the first run (only after a
reboot) I get glitchy video that freezes every now and then with little
blips of audio every 5 seconds or so, and if I run the command again the
fps drops down super low and no video is recorded, but strangely audio
is recorded.  Here is the output:

*pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 *
*pi@raspberrypi:~ $ ffmpeg -f v4l2 -input_format yuyv422 -framerate 30
-i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf
format=yuv420p -y -ts abs Desktop/test.mp4*
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
developers
   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
   configuration: --prefix=/home/pi/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/pi/ffmpeg_build/include
--extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-omx
--enable-omx-rpi --enable-nonfree
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.122.100 / 58.122.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 11.103 / 58. 11.103
   libavfilter     7.106.100 /  7.106.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 306.070836, bitrate: 442368 kb/s
   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=capture,DEV=0':
   Duration: N/A, start: 1613290013.175295, bitrate: 1536 kb/s
   Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
   Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x35387a0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x35387a0] profile High, level 3.1
[libx264 @ 0x35387a0] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft
2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
[alsa @ 0x35262c0] Thread message queue blocking; consider raising the
thread_queue_size option (current value: 8)
Output #0, mp4, to 'Desktop/test.mp4':
   Metadata:
     encoder         : Lavf58.67.100
   Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv,
progressive), 1280x720, q=2-31, 30 fps, 15360 tbn
     Metadata:
       encoder         : Lavc58.122.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
   Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 128 kb/s
     Metadata:
       encoder         : Lavc58.122.100 aac
[video4linux2,v4l2 @ 0x35233e0] Thread message queue blocking; consider
raising the thread_queue_size option (current value: 8)
*[alsa @ 0x35262c0] ALSA buffer xrun.   0kB time=00:00:00.36 bitrate=  
1.0kbits/s dup=1 drop=0 speed=0.121x **
**[alsa @ 0x35262c0] ALSA buffer xrun.1024kB time=00:00:03.35
bitrate=2503.1kbits/s dup=21 drop=0 speed=0.351x **
**[alsa @ 0x35262c0] ALSA buffer xrun.2304kB time=00:00:10.05
bitrate=1877.4kbits/s dup=168 drop=0 speed=0.586x **
**[alsa @ 0x35262c0] ALSA buffer xrun.4096kB time=00:00:20.19
bitrate=1661.3kbits/s dup=413 drop=0 speed=0.732x **
**[alsa @ 0x35262c0] ALSA buffer xrun.5376kB time=00:00:28.33
bitrate=1554.5kbits/s dup=637 drop=0 speed=0.753x **
**frame= 1111 fps= 24 q=-1.0 Lsize=    6536kB time=00:00:38.64
bitrate=1385.4kbits/s dup=816 drop=0 speed=0.832x *
video:6504kB audio:17kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.225371%
[libx264 @ 0x35387a0] frame I:5     Avg QP:18.71  size:137251
[libx264 @ 0x35387a0] frame P:461   Avg QP:21.46  size: 11990
[libx264 @ 0x35387a0] frame B:645   Avg QP:29.15  size:   690
[libx264 @ 0x35387a0] consecutive B-frames: 19.2%  4.9% 16.2% 59.8%
[libx264 @ 0x35387a0] mb I  I16..4: 22.8% 38.1% 39.1%
[libx264 @ 0x35387a0] mb P  I16..4:  0.7%  3.1%  1.5%  P16..4: 5.3% 
4.1%  2.8%  0.0%  0.0%    skip:82.4%
[libx264 @ 0x35387a0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 4.0% 
0.8%  0.2%  direct: 0.2%  skip:94.8%  L0:32.0% L1:51.3% BI:16.7%
[libx264 @ 0x35387a0] 8x8 transform intra:55.3% inter:49.9%
[libx264 @ 0x35387a0] coded y,uvDC,uvAC intra: 66.3% 62.9% 26.2% inter:
3.6% 2.3% 0.1%
[libx264 @ 0x35387a0] i16 v,h,dc,p: 31% 44%  4% 21%
[libx264 @ 0x35387a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 15% 23% 7%  7% 
7%  8%  7% 10%
[libx264 @ 0x35387a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 20% 19% 6%  6% 
6%  7%  6%  7%
[libx264 @ 0x35387a0] i8c dc,h,v,p: 51% 24% 18%  7%
[libx264 @ 0x35387a0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x35387a0] ref P L0: 70.2% 21.2%  6.6%  2.0%
[libx264 @ 0x35387a0] ref B L0: 92.0%  7.2%  0.8%
[libx264 @ 0x35387a0] ref B L1: 93.1%  6.9%
[libx264 @ 0x35387a0] kb/s:1438.51
[aac @ 0x353e590] Qavg: 152.630

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Carl Eugen Hoyos-2
Am So., 14. Feb. 2021 um 09:49 Uhr schrieb Mike Soultanian
<[hidden email]>:

> *pi@raspberrypi:~ $ v4l2-ctl --set-fmt-video=width=1280,height=720 *
> *pi@raspberrypi:~ $ ffmpeg -f v4l2 -input_format yuyv422 -framerate 30
> -i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0 -c:v libx264 -vf
> format=yuv420p -y -ts abs Desktop/test.mp4*

Please provide this command line including complete, uncut console
output to allow us understanding what's going on:
$ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
On 2/14/2021 3:27 AM, Carl Eugen Hoyos wrote:
> Please provide this command line including complete, uncut console
> output to allow us understanding what's going on:
> $ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0
>
Sure!  Here you go:

*pi@raspberrypi:~ $ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i
hw:CARD=capture,DEV=0*
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
developers
   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
   configuration: --prefix=/home/pi/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/pi/ffmpeg_build/include
--extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-omx
--enable-omx-rpi --enable-nonfree
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.122.100 / 58.122.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 11.103 / 58. 11.103
   libavfilter     7.106.100 /  7.106.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x2c75320] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x2c75320] Unknown timestamps
Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=capture,DEV=0':
   Duration: N/A, start: 1613320991.151065, bitrate: 1536 kb/s
   Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
At least one output file must be specified


And I'm not sure if you wanted it, but I figured I'd include the output
if I specified a file (I hit "q" to stop the output because it kept
going on and on):

*pi@raspberrypi:~ $ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i
hw:CARD=capture,DEV=0 -y Desktop/test.mp4 *
ffmpeg version N-101069-g000b250 Copyright (c) 2000-2021 the FFmpeg
developers
   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
   configuration: --prefix=/home/pi/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/pi/ffmpeg_build/include
--extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/pi/bin --enable-gpl --enable-gnutls --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-omx
--enable-omx-rpi --enable-nonfree
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.122.100 / 58.122.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 11.103 / 58. 11.103
   libavfilter     7.106.100 /  7.106.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
   Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=capture,DEV=0':
   Duration: N/A, start: 1613321366.545618, bitrate: 1536 kb/s
   Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
   Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
[video4linux2,v4l2 @ 0x3225370] Unknown timestamps
[video4linux2,v4l2 @ 0x3225370] Detected monotonic timestamps, converting
DTS 1613321372039847, next:33333 st:0 invalid dropping
PTS 1613321372039847, next:33333 invalid dropping st:0
[libx264 @ 0x323a770] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x323a770] profile High 4:2:2, level 3.1, 4:2:2 8-bit
[libx264 @ 0x323a770] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft
2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
[alsa @ 0x32280f0] Thread message queue blocking; consider raising the
thread_queue_size option (current value: 8)
[alsa @ 0x32280f0] ALSA buffer xrun.
Output #0, mp4, to 'Desktop/test.mp4':
   Metadata:
     encoder         : Lavf58.67.100
   Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv422p(tv,
progressive), 1280x720, q=2-31, 30 fps, 15360 tbn
     Metadata:
       encoder         : Lavc58.122.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
   Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 128 kb/s
     Metadata:
       encoder         : Lavc58.122.100 aac
DTS 1613321372073177, next:66666 st:0 invalid dropping0.00 bitrate=N/A
speed=   0x
PTS 1613321372073177, next:66666 invalid dropping st:0
DTS 1613321372106513, next:99999 st:0 invalid dropping
PTS 1613321372106513, next:99999 invalid dropping st:0
DTS 1613321372139842, next:133332 st:0 invalid dropping
PTS 1613321372139842, next:133332 invalid dropping st:0
DTS 1613321372173211, next:166665 st:0 invalid dropping
PTS 1613321372173211, next:166665 invalid dropping st:0
DTS 1613321372206518, next:199998 st:0 invalid dropping
PTS 1613321372206518, next:199998 invalid dropping st:0
DTS 1613321372239838, next:233331 st:0 invalid dropping
PTS 1613321372239838, next:233331 invalid dropping st:0
DTS 1613321372743443, next:266664 st:0 invalid dropping.00 bitrate=N/A
speed=   0x
PTS 1613321372743443, next:266664 invalid dropping st:0
DTS 1613321372776774, next:299997 st:0 invalid dropping
PTS 1613321372776774, next:299997 invalid dropping st:0
DTS 1613321372810107, next:333330 st:0 invalid dropping
PTS 1613321372810107, next:333330 invalid dropping st:0
DTS 1613321372843443, next:366663 st:0 invalid dropping
PTS 1613321372843443, next:366663 invalid dropping st:0
DTS 1613321372876794, next:399996 st:0 invalid dropping
PTS 1613321372876794, next:399996 invalid dropping st:0
DTS 1613321372910108, next:433329 st:0 invalid dropping
PTS 1613321372910108, next:433329 invalid dropping st:0
DTS 1613321372943447, next:466662 st:0 invalid dropping
PTS 1613321372943447, next:466662 invalid dropping st:0
DTS 1613321372976767, next:499995 st:0 invalid dropping
PTS 1613321372976767, next:499995 invalid dropping st:0
DTS 1613321373010104, next:533328 st:0 invalid dropping
PTS 1613321373010104, next:533328 invalid dropping st:0
DTS 1613321373043432, next:566661 st:0 invalid dropping
PTS 1613321373043432, next:566661 invalid dropping st:0
DTS 1613321373076764, next:599994 st:0 invalid dropping
PTS 1613321373076764, next:599994 invalid dropping st:0
DTS 1613321373110095, next:633327 st:0 invalid dropping
PTS 1613321373110095, next:633327 invalid dropping st:0
DTS 1613321373143428, next:666660 st:0 invalid dropping.00 bitrate=N/A
speed=   0x
PTS 1613321373143428, next:666660 invalid dropping st:0
DTS 1613321373176757, next:699993 st:0 invalid dropping
PTS 1613321373176757, next:699993 invalid dropping st:0
DTS 1613321373210094, next:733326 st:0 invalid dropping
PTS 1613321373210094, next:733326 invalid dropping st:0
DTS 1613321373243433, next:766659 st:0 invalid dropping
PTS 1613321373243433, next:766659 invalid dropping st:0
DTS 1613321373276759, next:799992 st:0 invalid dropping
PTS 1613321373276759, next:799992 invalid dropping st:0
DTS 1613321373310097, next:833325 st:0 invalid dropping
PTS 1613321373310097, next:833325 invalid dropping st:0
DTS 1613321373343424, next:866658 st:0 invalid dropping
PTS 1613321373343424, next:866658 invalid dropping st:0
DTS 1613321373376771, next:899991 st:0 invalid dropping
PTS 1613321373376771, next:899991 invalid dropping st:0
DTS 1613321373410080, next:933324 st:0 invalid dropping
PTS 1613321373410080, next:933324 invalid dropping st:0
DTS 1613321373443421, next:966657 st:0 invalid dropping
PTS 1613321373443421, next:966657 invalid dropping st:0
DTS 1613321373476769, next:999990 st:0 invalid dropping
PTS 1613321373476769, next:999990 invalid dropping st:0
DTS 1613321373510076, next:1033323 st:0 invalid dropping
PTS 1613321373510076, next:1033323 invalid dropping st:0
DTS 1613321373543554, next:1066656 st:0 invalid dropping
PTS 1613321373543554, next:1066656 invalid dropping st:0
DTS 1613321373576761, next:1099989 st:0 invalid dropping
PTS 1613321373576761, next:1099989 invalid dropping st:0
DTS 1613321373610071, next:1133322 st:0 invalid dropping00 bitrate=N/A
speed=   0x
PTS 1613321373610071, next:1133322 invalid dropping st:0
DTS 1613321373643411, next:1166655 st:0 invalid dropping
PTS 1613321373643411, next:1166655 invalid dropping st:0
DTS 1613321373676739, next:1199988 st:0 invalid dropping
PTS 1613321373676739, next:1199988 invalid dropping st:0
DTS 1613321373710067, next:1233321 st:0 invalid dropping
PTS 1613321373710067, next:1233321 invalid dropping st:0
DTS 1613321373743404, next:1266654 st:0 invalid dropping
PTS 1613321373743404, next:1266654 invalid dropping st:0
DTS 1613321373776731, next:1299987 st:0 invalid dropping
PTS 1613321373776731, next:1299987 invalid dropping st:0
DTS 1613321373810065, next:1333320 st:0 invalid dropping
PTS 1613321373810065, next:1333320 invalid dropping st:0
DTS 1613321373843401, next:1366653 st:0 invalid dropping
PTS 1613321373843401, next:1366653 invalid dropping st:0
DTS 1613321373876735, next:1399986 st:0 invalid dropping
PTS 1613321373876735, next:1399986 invalid dropping st:0
DTS 1613321373910059, next:1433319 st:0 invalid dropping
PTS 1613321373910059, next:1433319 invalid dropping st:0
DTS 1613321373943402, next:1466652 st:0 invalid dropping
PTS 1613321373943402, next:1466652 invalid dropping st:0
DTS 1613321373976725, next:1499985 st:0 invalid dropping
PTS 1613321373976725, next:1499985 invalid dropping st:0
DTS 1613321374010053, next:1533318 st:0 invalid dropping
PTS 1613321374010053, next:1533318 invalid dropping st:0
[video4linux2,v4l2 @ 0x3225370] Thread message queue blocking; consider
raising the thread_queue_size option (current value: 8)
DTS 1613321374043382, next:1566651 st:0 invalid dropping
PTS 1613321374043382, next:1566651 invalid dropping st:0
DTS 1613321374076722, next:1599984 st:0 invalid dropping00 bitrate=N/A
speed=   0x
PTS 1613321374076722, next:1599984 invalid dropping st:0
DTS 1613321374110045, next:1633317 st:0 invalid dropping
PTS 1613321374110045, next:1633317 invalid dropping st:0
DTS 1613321374143376, next:1666650 st:0 invalid dropping
PTS 1613321374143376, next:1666650 invalid dropping st:0
DTS 1613321374176774, next:1699983 st:0 invalid dropping
PTS 1613321374176774, next:1699983 invalid dropping st:0
DTS 1613321374210039, next:1733316 st:0 invalid dropping
PTS 1613321374210039, next:1733316 invalid dropping st:0
DTS 1613321374243371, next:1766649 st:0 invalid dropping
PTS 1613321374243371, next:1766649 invalid dropping st:0
DTS 1613321374276712, next:1799982 st:0 invalid dropping
PTS 1613321374276712, next:1799982 invalid dropping st:0
DTS 1613321374310034, next:1833315 st:0 invalid dropping
PTS 1613321374310034, next:1833315 invalid dropping st:0
DTS 1613321374343367, next:1866648 st:0 invalid dropping
PTS 1613321374343367, next:1866648 invalid dropping st:0
DTS 1613321374376697, next:1899981 st:0 invalid dropping
PTS 1613321374376697, next:1899981 invalid dropping st:0
DTS 1613321374410029, next:1933314 st:0 invalid dropping
PTS 1613321374410029, next:1933314 invalid dropping st:0
frame=   58 fps=5.5 q=-1.0 Lsize=     214kB time=00:00:05.63 bitrate=
310.2kbits/s speed=0.532x
video:210kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.022506%
[libx264 @ 0x323a770] frame I:2     Avg QP:11.64  size: 37356
[libx264 @ 0x323a770] frame P:17    Avg QP:21.50  size:  5701
[libx264 @ 0x323a770] frame B:39    Avg QP:25.34  size:  1096
[libx264 @ 0x323a770] consecutive B-frames:  6.9% 10.3%  0.0% 82.8%
[libx264 @ 0x323a770] mb I  I16..4: 68.5% 18.6% 12.8%
[libx264 @ 0x323a770] mb P  I16..4:  2.9%  4.2%  0.4%  P16..4: 15.3% 
5.1%  1.4%  0.0%  0.0%    skip:70.8%
[libx264 @ 0x323a770] mb B  I16..4:  0.2%  0.2%  0.0%  B16..8: 11.6% 
1.0%  0.1%  direct: 0.3%  skip:86.6%  L0:38.7% L1:57.5% BI: 3.8%
[libx264 @ 0x323a770] 8x8 transform intra:33.6% inter:83.0%
[libx264 @ 0x323a770] coded y,uvDC,uvAC intra: 23.8% 43.6% 6.4% inter:
2.7% 4.8% 0.0%
[libx264 @ 0x323a770] i16 v,h,dc,p: 59% 20%  2% 19%
[libx264 @ 0x323a770] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 17% 19% 7%  8% 
7%  7%  6%  7%
[libx264 @ 0x323a770] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 30% 16% 4%  4% 
4%  5%  4%  5%
[libx264 @ 0x323a770] i8c dc,h,v,p: 62% 17% 15%  6%
[libx264 @ 0x323a770] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x323a770] ref P L0: 65.8% 16.3% 14.8%  3.1%
[libx264 @ 0x323a770] ref B L0: 94.2%  5.1%  0.7%
[libx264 @ 0x323a770] ref B L1: 97.9%  2.1%
[libx264 @ 0x323a770] kb/s:887.12
[aac @ 0x3240070] Qavg: 147.016


Thanks!

Mike

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Carl Eugen Hoyos-2
Am So., 14. Feb. 2021 um 17:53 Uhr schrieb Mike Soultanian
<[hidden email]>:
>
> On 2/14/2021 3:27 AM, Carl Eugen Hoyos wrote:
> > Please provide this command line including complete, uncut console
> > output to allow us understanding what's going on:
> > $ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0

> *pi@raspberrypi:~ $ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i
> hw:CARD=capture,DEV=0*

> [video4linux2,v4l2 @ 0x2c75320] Unknown timestamps
> Input #0, video4linux2,v4l2, from '/dev/video0':

>    Duration: N/A, start: 0.000000, bitrate: 442368 kb/s

Any difference if you use mono2abs instead of abs?

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian

On 2/14/2021 8:57 AM, Carl Eugen Hoyos wrote:
> Am So., 14. Feb. 2021 um 17:53 Uhr schrieb Mike Soultanian
> <[hidden email]>:
>> On 2/14/2021 3:27 AM, Carl Eugen Hoyos wrote:
>>> Please provide this command line including complete, uncut console
>>> output to allow us understanding what's going on:
>>> $ ffmpeg -ts abs -i /dev/video0 -f alsa -ac 2 -i hw:CARD=capture,DEV=0
> Any difference if you use mono2abs instead of abs?


Unfortunately no - same results.  So as sanity check, and I'm annoyed
(and I apologize) that I didn't try this sooner (I blame it on
ffmpg/audio/video brain overload), I plugged in my Logitech c920 webcam
and ran similar commands and it was able to record audio and video, so
I'm guessing that there is an issue with this capture card (that's my
best guess).  Last night I ordered an Elgato Camlink 4k as I saw an
article that used that capture card (and they specifically say it needs
to be UVC/UAC-compatible) and it should be here this evening.  Lemme
give that whirl and see if it produces better results.  I was hoping not
to purchase yet another capture card, but that camlink is pretty
well-respected and I'm sure I'll get use out of it for other stuff as well.

Should ffmpeg be able to capture from any capture card, or are there
hardware limitations that would cause these kinds of issues to the point
where you just say it's not even possible with that particular device,
or have you tried to make ffmpeg robust enough to handle anything?  The
capture device is a generic "ezcap" chipset that's rebranded for
different manufacturers that I found on Amazon - they don't even have
the specific item listed that I purchased any more...

Thanks!

Mike

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Carl Eugen Hoyos-2
Am So., 14. Feb. 2021 um 20:49 Uhr schrieb Mike Soultanian
<[hidden email]>:

> Should ffmpeg be able to capture from any capture card

Only video4linux2 is supported, how well it works depends
primarily on the kernel driver.

You probably want a card that provides data in a pix_fmt
that your hardware encoder supports.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
On 2/14/2021 12:40 PM, Carl Eugen Hoyos wrote:

>> Should ffmpeg be able to capture from any capture card
> Only video4linux2 is supported, how well it works depends
> primarily on the kernel driver.
>
> You probably want a card that provides data in a pix_fmt
> that your hardware encoder supports.

If I'm understanding correctly, this would be what you refer to *yuyv422*?

It would seem like both my capture card and my logitech support the same
formats, but the logitech 920 also lists h264 (listed below) - is that
why it's allowing it to work?

What I don't understand is why I'm able to record either video or audio
from the capture card, but when they're both together it's not happy. 
Is the combining process of the two sources (audio/video) for the
capture card still dependent on the kernel driver?  In other words,
since I'm seeing video and hearing audio, wouldn't that mean the kernel
driver is supporting my capture card, or is that a false assumption?  I
have no issue viewing the combined audio/video in the video4linux2 test
utility.  Obviously I don't know a whole lot about this stuff, but I'm
trying to digest as much of it as possible so I can understand what's
going on...

*Capture card**
*

**

*pi@raspberrypi:~ $ v4l2-ctl --list-formats-ext**
***ioctl: VIDIOC_ENUM_FMT
     Type: Video Capture

     [0]: 'MJPG' (Motion-JPEG, compressed)
         Size: Discrete 1920x1080
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 640x480
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 800x600
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1024x768
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1280x720
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1280x960
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1280x1024
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1360x768
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1400x900
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1440x900
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
     [1]: 'YUYV' (YUYV 4:2:2)
         Size: Discrete 1920x1080
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 640x480
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 800x600
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1024x768
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1280x720
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1280x960
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1280x1024
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1360x768
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1400x900
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)
         Size: Discrete 1440x900
             Interval: Discrete 0.017s (60.000 fps)
             Interval: Discrete 0.033s (30.000 fps)

*Logitech c920**
*

**

*pi@raspberrypi:~ $ v4l2-ctl --list-formats-ext*
ioctl: VIDIOC_ENUM_FMT
     Type: Video Capture

     [0]: 'YUYV' (YUYV 4:2:2)
         Size: Discrete 640x480
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 160x90
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 160x120
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 176x144
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 320x180
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 320x240
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 352x288
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 432x240
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 640x360
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 800x448
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 800x600
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 864x480
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 960x720
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1024x576
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1280x720
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1600x896
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1920x1080
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 2304x1296
             Interval: Discrete 0.500s (2.000 fps)
         Size: Discrete 2304x1536
             Interval: Discrete 0.500s (2.000 fps)
     [1]: 'H264' (H.264, compressed)
         Size: Discrete 640x480
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 160x90
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 160x120
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 176x144
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 320x180
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 320x240
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 352x288
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 432x240
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 640x360
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 800x448
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 800x600
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 864x480
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 960x720
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1024x576
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1280x720
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1600x896
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1920x1080
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
     [2]: 'MJPG' (Motion-JPEG, compressed)
         Size: Discrete 640x480
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 160x90
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 160x120
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 176x144
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 320x180
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 320x240
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 352x288
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 432x240
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 640x360
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 800x448
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 800x600
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 864x480
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 960x720
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1024x576
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1280x720
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1600x896
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)
         Size: Discrete 1920x1080
             Interval: Discrete 0.033s (30.000 fps)
             Interval: Discrete 0.042s (24.000 fps)
             Interval: Discrete 0.050s (20.000 fps)
             Interval: Discrete 0.067s (15.000 fps)
             Interval: Discrete 0.100s (10.000 fps)
             Interval: Discrete 0.133s (7.500 fps)
             Interval: Discrete 0.200s (5.000 fps)



_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Carl Eugen Hoyos-2
Am So., 14. Feb. 2021 um 22:27 Uhr schrieb Mike Soultanian
<[hidden email]>:

>
> On 2/14/2021 12:40 PM, Carl Eugen Hoyos wrote:
>
> >> Should ffmpeg be able to capture from any capture card
> > Only video4linux2 is supported, how well it works depends
> > primarily on the kernel driver.
> >
> > You probably want a card that provides data in a pix_fmt
> > that your hardware encoder supports.
>
> If I'm understanding correctly, this would be what you refer to *yuyv422*?

I was thinking about yuv420p but I don't know how you want to encode
(and what you plan to do with the resulting file).

> It would seem like both my capture card and my logitech support
> the same formats, but the logitech 920 also lists h264 (listed below)
> - is that why it's allowing it to work?

That's completely unrelated but has the advantage that you don't have
to encode.

> What I don't understand is why I'm able to record either video or audio
> from the capture card, but when they're both together it's not happy.

How should FFmpeg mux audio and video if one has timestamps
starting with 0 and the other with 10000000?
You can - easily - let the audio stream start with 0 but the problem
is that the result will not play in-sync, see the setps documentation.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
Well.. that was extremely frustrating. I've seriously been going at this
for probably 16 hours, scouring the net for documentation and trying
other people's tutorials, wondering why my setup wasn't working as well
as all the examples that described all the cool stuff you could do with
ffmpeg.  It was only after I purchased another capture card (Elgato Cam
Link 4k) that I found I found this article when searching for *ffmpeg
elgato cam link* and found this page:

https://blog.eigenvalue.net/ffmpeg-elgato-camlink-4k/

What was so crucial was one little tidbit towards the end of the page
where the author writes (referring to running the ffmpeg command):

> Unfortunately, most of the time it will get stuck after two frames.
> After some random experimentation, I noticed that unplugging the
> device allowed me to record once, most of the time. I think that it is
> due to syncing the audio / video stream. The video source seems to
> request key frames doesn't get the expected data afterwards. Or
> something else.
>

This was *exactly* the behavior I was running into, but I had no idea
that I was actually running into that particular issue!  This whole time
I had a gut feeling that there was somewhat inconsistent behavior
(sometimes it would seem to work and then on the next run with the same
settings it would have very low FPS), but I'm a total newbie to this so
I didn't know if this was just normal behavior or something was wrong. 
I really wonder how many people run into this kind of issue because not
only did this slow me down big time, but I also feel bad for wasting
other people's time on something for which there's a super-simple fix.
I'm not sure if it isn't already in the documentation, but it would
probably be smart to make mention of this somewhere.  Also, if there's
any way for ffmeg to detect that it's in this kind of state, I think
that would be great if it were to throw a warning that something is up. 
I'm not sure if it's possible, but I felt it worth mentioning.

Soooooo, after running this nifty command before running ffmpeg:

sudo sh -c "echo 0 > /sys/bus/usb/devices/2-1/authorized";sudo sh -c
"echo 1 > /sys/bus/usb/devices/2-1/authorized";

voila!  It captures at 30fps, and with my cheap-o capture card!  I'll be
returning the Elgato Cam Link 4k because it seems like it only outputs
at 4k, and if I'm understanding things correctly, that means I'm
expending extra CPU cycles to down-convert it to 720p instead of it
already being at 720p.  Plus, why spend $99 if I don't need to!?

So Carl, to answer your questions:

To answer your questions:
> I was thinking about yuv420p but I don't know how you want to encode
> (and what you plan to do with the resulting file).

My ultimate goal is to stream my GoPro into my Raspberry Pi, then send
that over a mobile link up to Twitch for my IRL live stream. I just
tried streaming to Twitch from my GoPro through the Raspberry Pi (with a
direct Internet connection) this morning and it works!  Oddly, the
timestamps are different, but the audio does seem to be synced so I
guess I'll run with it?!  Now that I got things working I will start
with the wiki guide for streaming on the ffmpeg site.

>> It would seem like both my capture card and my logitech support
>> the same formats, but the logitech 920 also lists h264 (listed below)
>> - is that why it's allowing it to work?
> That's completely unrelated but has the advantage that you don't have
> to encode.

Got it!


>> What I don't understand is why I'm able to record either video or audio
>> from the capture card, but when they're both together it's not happy.
> How should FFmpeg mux audio and video if one has timestamps
> starting with 0 and the other with 10000000?
> You can - easily - let the audio stream start with 0 but the problem
> is that the result will not play in-sync, see the setps documentation.

Fortunately it seems like this isn't an issue now that I got things
resolved by unplugging the unit before running it...

Thanks for your patience on this!  I appreciate the help so far - lots
of learning going on here!

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Chris Angelico
On Tue, Feb 16, 2021 at 10:35 AM Mike Soultanian <[hidden email]> wrote:

>
> Well.. that was extremely frustrating. I've seriously been going at this
> for probably 16 hours, scouring the net for documentation and trying
> other people's tutorials, wondering why my setup wasn't working as well
> as all the examples that described all the cool stuff you could do with
> ffmpeg.  It was only after I purchased another capture card (Elgato Cam
> Link 4k) that I found I found this article when searching for *ffmpeg
> elgato cam link* and found this page:
>
> https://blog.eigenvalue.net/ffmpeg-elgato-camlink-4k/
>
> What was so crucial was one little tidbit towards the end of the page
> where the author writes (referring to running the ffmpeg command):
>
> > Unfortunately, most of the time it will get stuck after two frames.
> > After some random experimentation, I noticed that unplugging the
> > device allowed me to record once, most of the time. I think that it is
> > due to syncing the audio / video stream. The video source seems to
> > request key frames doesn't get the expected data afterwards. Or
> > something else.
> >
>
> This was *exactly* the behavior I was running into, but I had no idea
> that I was actually running into that particular issue!  This whole time
> I had a gut feeling that there was somewhat inconsistent behavior
> (sometimes it would seem to work and then on the next run with the same
> settings it would have very low FPS), but I'm a total newbie to this so
> I didn't know if this was just normal behavior or something was wrong.

Not sure if it's the same cause, but a friend of mine has a similar
setup, and she had the same sort of problem when streaming on Twitch.
Her solution was to set it to 4k 30fps and select recording video mode
(without actually recording).

ChrisA
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mike Soultanian
On 2/15/2021 5:47 PM, Chris Angelico wrote:
>
> Not sure if it's the same cause, but a friend of mine has a similar
> setup, and she had the same sort of problem when streaming on Twitch.
> Her solution was to set it to 4k 30fps and select recording video mode
> (without actually recording).
>
> ChrisA

Hey Chris,

I was having problems well before even trying to stream to Twitch - I
was just trying to capture (record) audio and video being captured from
my HDMI output and it just wouldn't work.  Had I just unplugged my USB
capture device, it would have started work :/

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Mark Filipak (ffmpeg)
In reply to this post by Mike Soultanian
On 02/15/2021 06:29 PM, Mike Soultanian wrote:
-bigsnip-
>> You can - easily - let the audio stream start with 0 but the problem
>> is that the result will not play in-sync, see the setps documentation.

What is 'setps'? A filter, a protocol, a muxer, what? I've searched through all the docs and can't
find it.

Thanks!

--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"_______ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 2021.
It isn't the distance that's important, it's the direction.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to stream to rtmp from my rsp4 and a GoPro

Christian Ebert-2
* Mark Filipak (ffmpeg) on Monday, February 15, 2021 at 21:02:33 -0500:
> On 02/15/2021 06:29 PM, Mike Soultanian wrote:
> -bigsnip-
>>> You can - easily - let the audio stream start with 0 but the problem
>>> is that the result will not play in-sync, see the setps documentation.
>
> What is 'setps'? A filter, a protocol, a muxer, what?

A typo for 'setpts'.

> I've searched through all the docs and can't find it.

Because the typo is not in the docs ;-)

https://ffmpeg.org/ffmpeg-filters.html#setpts_002c-asetpts

--
LAST SHIP HOME
Winner of the German Ocean Film Award 2019
--->> https://lastshiphome.de
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".