Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-13 Thread 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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-13 Thread Carl Eugen Hoyos
Am So., 14. Feb. 2021 um 01:51 Uhr schrieb Mike Soultanian
:

> Input #0, video4linux2,v4l2, from '/dev/video0':
>Duration: N/A, start: 0.00, 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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-13 Thread 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.00, 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 

Re: [FFmpeg-user] Add subtitles to trimmed mp4

2021-02-13 Thread adam smith via ffmpeg-user
I have tested multiple source formats, I was totally wrong and Leo was bang on 
the money.
This is working great. I am able to concat multiple trimmed files together and 
the subtitles remain timed to the output - all is good and I am super happy.

Thanks Leo.
Adam

> On 13 Feb 2021, at 11:12, adam smith  wrote:
> 
> Actually I think I may have just been a bit of a donut and you may be spot on.
> Now I have had a cup of tea and woken up properly, I will do some more 
> testing on different source formats and get back to you.
> 
> Thank you for your help, as always to everyone in the group it is very much 
> appreciated.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] astats to csv file

2021-02-13 Thread Reino Wijnsma
On 2021-02-11T16:39:47+0100, Benjamin Houtman  wrote:
> I ran the
>
> ffprobe -f lavfi -i amovie=X.flac,astats=metadata=1 -show_frames -of csv
>
> command, but I don't need the entire printout, just the "Parsed_astats..."
> data that appears at the end of the printout. How would I limit the results
> to just that?
You could try Xidel [1] to parse FFprobe's output.

Assuming you're on Windows:

ffprobe -f lavfi -i "amovie='X.flac',astats=metadata=1" 2>&1 | xidel - -se 
"x:lines($raw)[starts-with(.,'[Parsed_astats')] ! replace(substring(.,30),': 
',',')"

Swap the single- and double-quotes if you're on Unix.

[1]: http://videlibri.sourceforge.net/xidel.html

-- 
Reino

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add subtitles to trimmed mp4

2021-02-13 Thread adam smith via ffmpeg-user


> On 13 Feb 2021, at 10:46, adam smith via ffmpeg-user  
> wrote:
> 
> Thanks Leo. 
> I gave it a try but the same thing happened regarding the subtitle position 
> and the in point of the media appeared less accurate and had black at the 
> start.
> I believe this is because -ss prior to the file path does a quick seek to the 
> closest key frame to the desired timing, whereas -ss after the file path 
> decodes all the data to find the actual specified timing.

Actually I think I may have just been a bit of a donut and you may be spot on.
Now I have had a cup of tea and woken up properly, I will do some more testing 
on different source formats and get back to you.

Thank you for your help, as always to everyone in the group it is very much 
appreciated.

Adam

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add subtitles to trimmed mp4

2021-02-13 Thread adam smith via ffmpeg-user


> On 13 Feb 2021, at 02:10, Leo Butler via ffmpeg-user  
> wrote:
> 
> I think you want to do
> 
> ffmpeg -y -ss 10 -t 30 -i input.mp4 -ss 10 -t 30 -i input.srt ...
> 
> See
> 
> https://ffmpeg.org/ffmpeg-all.html#toc-Main-options 
> 
> 
> Leo

Thanks Leo. 
I gave it a try but the same thing happened regarding the subtitle position and 
the in point of the media appeared less accurate and had black at the start.
I believe this is because -ss prior to the file path does a quick seek to the 
closest key frame to the desired timing, whereas -ss after the file path 
decodes all the data to find the actual specified timing.


> 
>> -filter_complex "[0:1]fifo[vout];[0:0]afifo[01_afifo]" -map "[vout]"
>> -map "[01_afifo]" -map 1 -pix_fmt yuv420p -c:v libx264 -s 1920x1080
>> -profile:v high -level:v 4.1 -refs:v 2 -keyint_min 50 -b:v 15000k -r
>> 25 -ac 2 -bsf:a aac_adtstoasc -c:a libfdk_aac -ar 48000 -b:a 192k
>> -c:s:0 mov_text -metadata:s:s:0 language=eng -flags +global_header -f
>> tee
>> "[f=mp4:movflags=+faststart]/data/disposable/transcode_20210212-1147-znbqck/edit_2805.mp4"
> 
> Do you mean to you `tee' with only one output sink?

My command is put together by a script I created and its configured to be able 
to write to multiple outputs, so tee is needed, in this test though I am only 
supplying a single output path and I didn’t write the script well enough to 
adapt the command. It doesn’t appear to do any harm, although you are right its 
a bit shit.


If you have any other ideas, keep them coming :)

Thanks
Adam

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-13 Thread 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  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
  libavformat58. 67.100 / 58. 67.100
  libavdevice58. 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
  libpostproc55.  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.00, 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 

Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-13 Thread 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.00, 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, 

Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-13 Thread 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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".