pi camera 3 help

September 13, 2023, 17:07

k9t33n

and got

k9t33n

so it is addressed to video0

oops.se

Sorry for not being more persuasive...

k9t33n

it's alright

k9t33n

deos this mean no process is using it?

k9t33n

also we think the v4l2 part is not updated enough for the camera 3

k9t33n

so when we change it it is "supposedly" working because it is giving no errors

k9t33n

but now we have the problem of it not streaming to the site

oops.se

Pls post text, not pictures

oops.se

And test with sudo lsof | grep /var/log/message That will show that rsyslogd uses that file

oops.se

Not streaming ? Any errors?

k9t33n

ok a few people have said I need to pipe libcamera into the ffmpeg command, do you know how to do this?

oops.se

Just put the pipe character | between libcamera and ffmpeg

oops.se

Example libcamera-vid -t 0 -o - | ffmpeg -i - -c:v copy test.mp4

k9t33n

oh that's simple

k9t33n

so with
 ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 /dev/ video0 -f mpegts -codec:v mpeglvideo -s 1920x1080 -b:v 1000k -bf https://stream. remocon. tv/o0s75fhfuwor5nrolpdalt47 

k9t33n

you would do
  libcamera-vid -t -o |ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 /dev/ video0 -f mpegts -codec:v mpeglvideo -s 1920x1080 -b:v 1000k -bf https://stream. remocon. tv/o0s75fhfuwor5nrolpdalt47 
?

oops.se

Yes, but you have a space in /dev/video0, see: -video_size 1920x1080 /dev/ video0 -f mpegts.... that will fail that command

k9t33n

can you give me the hole correct command

oops.se

´libcamera-vid -t -o |ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 /dev/video0 -f mpegts -codec:v mpeglvideo -s 1920x1080 -b:v 1000k -bf https://stream. remocon. tv/o0s75fhfuwor5nrolpdalt47 ´

oops.se


k9t33n

I did a few mistakes because of the way I copied it so I'm just gonna put the corrected version here:

k9t33n

libcamera-vid -t 0 -o - | ffmpeg -f rawvideo -framerate 25 -video_size 640x480 -i /dev/video0 -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 https : // stream.remocon.tv/ o0s75fhfuwor5nrolpdalt47

k9t33n

that should be it if Im not mistaken

k9t33n

I know you said no pics but I want to show the output, I can't copy it and I am not copying it all out

k9t33n

so this is the output

oops.se

Well I cant read that picture, microscopic text

k9t33n

oh yeah sorry

k9t33n

these are the main things I think

k9t33n

that should be bigger

oops.se

You have the answer in red in the picture

k9t33n

/Dev/video0 busy?

k9t33n

so I don't know what to do

oops.se

Ok, I think I see now, isn't libcamera using /dev/video0 ? And then you state that ffmpeg should use /dev/video0 as well, then its only logical that its in use already.

oops.se

So try this: libcamera-vid -t 0 -o - | ffmpeg -f rawvideo -framerate 25 -video_size 640x480 -i -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 https : // stream.remocon.tv/o0s75fhfuwor5nrolpdalt47

k9t33n

ok i will later, thanks so much for helping

k9t33n

I get this error: -f: No such file or directory. well that's the only thing highlighted in red

k9t33n

do you know how to fix?

_krazy.

Maybe you added a slash or forgot a character that it later interputed as a path to a file or folder

_krazy.

Or the package you used couldn't find anything in a path (some internal stuff)

_krazy.

Check for your inputs and how the code works in the package

k9t33n

i just copied and pasted it

oops.se

Why not use the example from remcon webpage: Raspberry Pi Example Open two terminal windows in your raspberry pi, run the following in each of them. The first streams the video, the second gets the commands from the website to control the motor and steering for a remote control car. To control anything else you just change the commands there. First terminal window:
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 \
        -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 \
        https : // stream.remocon.tv/ <api_key>

oops.se

And skip the second windows since its related to controll a "car" or similar

k9t33n

the command from the remocon page is what I've been trying, I got the command from the owner

k9t33n

thanks for doing the research tho

oops.se

Noop, the web say -f v4l2 but your command has -f rawvideo

k9t33n

oh yeah I forgot to tell you, we tried that command originally but it didn't work. I ended up asking you after like 2 weeks of back and forth between the owner and a person with lots of experience with remocon. so I just gave you the command that was the closest we've gotten (in my opinion it was the closest)

k9t33n

I can try it now just to make sure but I'm pretty sure it won't work

k9t33n

yeah I just get this:
[video4linux2, v4 l2 @ Ox559219 f010] ioctl(VIDIOC_G_PARM) : Inappropriate ioctl for device [video4linux2, v4l2 Ox5592 19 f010) Time per frame unknown [video4 linux2 , v4l2 @ 0x5592 19 fo10] ioctl (VIDIOC_ STREAMON) Invalid argument /dev/v ideo0: Inval id ar gument

k9t33n

theres a couple spelling mistakes there because of the way I had to copy it can add in a couple spaces for no reason and stuff, but you should be able to read it

oops.se

OK, I have got my Pi with camera out so I can replicate your work

k9t33n

which one is it?

k9t33n

<@796000224690307072> have you just given up on this?

k9t33n

I just realy want to finish this project but I have no clue how to use the ffmpeg or libcamera command so I just have to ask people like you

oops.se

Not really, I have just ben busy with my own project, and a struggling Raspberry Pi Pico that keeps loosing contact and I have to reflash micropython all the time

k9t33n

it's okay I'm just making sure, what's your own project?

_krazy.

Just to make sure, you're currently trying to get the output of the camera to a stream, correct?

k9t33n

yes it should stream to remocon

k9t33n

a robot controlling site

_krazy.

Oh, I recommend checking their tutorial, they might have some proprietary things which depends their stuff

k9t33n

can you link it for me?

_krazy.

And if they don't have any or anything useful, debug your code with some video viewing program

_krazy.

They use neocities lol

_krazy.

You were correct:
sh
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 \
        -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 \
        https : // stream.remocon.tv/ <api_key>

_krazy.

Have you tried checking your /dev/videoX?

_krazy.

I'm not experienced in those, but I remember using VLC to view ffmpeg live feed, but you can try to record for like 5 seconds and save it to a file and checking it afterward

k9t33n

one second i have to go for a bit, ill be back

_krazy.

Take your time

_krazy.

Try the python or nodejs code for controlling the robot, if it doesn't work, then you probably have some issue with the connection, maybe (I've no experience in controlling robots)

k9t33n

I've got the code controling the robot that works perfectly

k9t33n

it's streaming the camera live to the site

k9t33n

ok I'm back

k9t33n

oh ok

_krazy.

Btw, you got this?

_krazy.

Nice, so you just have to implement custom characters somehow, by editing the module or lighting up the individual light dots

_krazy.

And I don't know how, I just thought of it without experience

_krazy.

Oh, if that's so, a simple tutorial is enough, you're able to do it in no time!

oops.se

Yes, I have code that prints åäö (Swedish chars) to the display and OpenWeather weather deliver UTF8 () , so its just to deconstruct the string from OpenWeather to a array of chars and apply the function:
Substitute substitutes[] =
{
  { "Ã…", 0xC5 },
  { "Ä", 0xC4 },
  { "Ö", 0xD6 },
  { "Ã¥", 0xE5 },
  { "ä", 0xE4 },
  { "ö", 0xF6 },
};
🙂

oops.se

But this is another topic...

k9t33n

how do I record a video with ffmpeg command and with libcamera piped into it?

_krazy.

I think something like this:
ffmpeg -f video4linux2 -i /dev/video0 -vframes 1  -video_size 640x480 frameshot.png

k9t33n

but I need libcamera pipeing into it

k9t33n

okay update. I've managed to get it running ish, it's apparently streaming to the site and the site says the bots online which means it's receiving input but his not showing anything for some reason, the command I used is:
libcamera-vid -t -0 |ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 /dev/video0 -f mpegts -codec:v mpeg1video -s 1920x1080 -b:v 1000k -bf 

k9t33n

in the terminal it's just outputting:
#32 (30.01 fps) exp 32876.80 ag 5.99 dg 1.91
constantly