Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro
* 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 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
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 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
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 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
On Tue, Feb 16, 2021 at 10:35 AM Mike Soultanian 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 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
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. Soo, 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 1000? 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 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
Am So., 14. Feb. 2021 um 22:27 Uhr schrieb 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*? 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 1000? 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 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
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
Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro
Am So., 14. Feb. 2021 um 20:49 Uhr schrieb Mike Soultanian : > 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 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
On 2/14/2021 8:57 AM, Carl Eugen Hoyos wrote: Am So., 14. Feb. 2021 um 17:53 Uhr schrieb 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 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 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
Am So., 14. Feb. 2021 um 17:53 Uhr schrieb 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 > *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.00, bitrate: 442368 kb/s Any difference if you use mono2abs instead of abs? 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
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.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: 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.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: 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
Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro
Am So., 14. Feb. 2021 um 09:49 Uhr schrieb Mike Soultanian : > *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 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
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
Re: [FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro
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
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
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] Trying to stream to rtmp from my rsp4 and a GoPro
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
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
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".
[FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro
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".