Blog Posts


Capture Card with Audio

Posted 2023-11-16 8:41 by azri.

ffmpeg -f v4l2 -framerate 30 -pixel_format mjpeg -video_size hd1080 -i /dev/video0  -f alsa -thread_queue_size 1024 -ac 2 -i hw:CARD=MS2109,DEV=0 -c:v libx264 -b:v 3000k -preset ultrafast -tune fastdecode -listen 1 -f mp4 -movflags frag_keyframe+empty_moov http://192.168.100.120:8080

Audio device not found when piping in TVHeadend

Need to run script (.sh)? 

arecord -L

stream from VLC, http. Need to try RSTP next.

https://stackoverflow.com/questions/26999595/what-steps-are-needed-to-stream-rtsp-from-ffmpeg

https://forums.raspberrypi.com/viewtopic.php?t=66259 Try mjpg streamer?

https://forums.raspberrypi.com//viewtopic.php?f=41&t=61787

https://www.mankier.com/1/v4l2-ctl

https://stackoverflow.com/questions/59574987/how-to-change-mjpeg-to-yuyv422-from-a-webcam-to-a-v4l2loopback loopback?

https://superuser.com/questions/1639086/how-to-use-ffmpeg-to-save-video-and-audio-streams-to-a-file-in-linux

https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA

https://tvheadend.org/boards/4/topics/40891 try this? systemd as service...

41
 

Use -q:v to control (M)JPEG quality

The effective range is a linear scale of 2-31, and a lower value will result in a higher quality output.

Examples

Make MJPEG video in MOV container:

ffmpeg -i input.mov -c:v mjpeg -q:v 3 -an output.mov

Feature Request

Posted 2023-03-16 16:09 by azri.

Flights of aircraft without callsigns

adsbexchange link

icao where applicable

Lost connection to MySQL server at 'reading authorization packet', system error: 104

Posted 2022-04-29 23:58 by azri.

More rarely, it can happen when the client is attempting the initial connection to the server. In this case, if your connect_timeout value is set to only a few seconds, you may be able to resolve the problem by increasing it to ten seconds, perhaps more if you have a very long distance or slow connection. You can determine whether you are experiencing this more uncommon cause by using SHOW STATUS LIKE 'aborted_connections'. It will increase by one for each initial connection attempt that the server aborts. You may see “reading authorization packet” as part of the error message; if so, that also suggests that this is the solution that you need.

 

https://stackoverflow.com/questions/21091850/error-2013-hy000-lost-connection-to-mysql-server-at-reading-authorization-pa

Traceback (most recent call last):

  File "/home/pi/adsb-receiver/build/portal/python/flights.fa.py", line 1056, in <module>

    processor.processAircraftList(data["aircraft"]) #PROBLEM HERE!!! 205

  File "/home/pi/adsb-receiver/build/portal/python/flights.fa.py", line 97, in processAircraftList

    db = self.connectDB()

  File "/home/pi/adsb-receiver/build/portal/python/flights.fa.py", line 93, in connectDB

    db=self.config["database"]["db"])

  File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 86, in Connect

    return Connection(*args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in __init__

    super(Connection, self).__init__(*args, **kwargs2)

_mysql_exceptions.OperationalError: (2013, "Lost connection to MySQL server at 'reading authorization packet', system error: 104")

  2022/04/29_13:23:32

Waiting for data... (interrupt to abort)

 

 

7.processPositions

staBbRgInserted position w/ Squawk (6545L, '2022/04/29 05:22:23', 12337, u'2174', 5.705303, 115.480515, 89.0, 12400, -2048, 342.1, -5.6, 3995L)

6e.Check if position data is available

5e.aircraft.has_key flight

5.processAircraft

5b.Updating Aircraft: 86d244

5c.Found Aircraft ID: 3911

5d.check if aircraft.has_key

6.processFlight

6c.Updated Flight: ANA1971(3911L, '2022/04/29 05:22:23', u'ANA1971')

6d.Get Flight ID 

7.processPositions

staBbRgInserted position w/ Squawk (6609L, '2022/04/29 05:22:23', 9051, u'3713', 3.808136, 114.397702, 218.5, 40000, 0, 489.6, -8.2, 3911L)

6e.Check if position data is available

5e.aircraft.has_key flight

Last Run: 2022/04/29 13:22:57

____________________________________________________________________________________________

4.processAircraftList

3.connectDB

2.setupDBStatements

Traceback (most recent call last):

  File "/home/pi/adsb-receiver/build/portal/python/flights.fa.py", line 1056, in <module>

    processor.processAircraftList(data["aircraft"]) #PROBLEM HERE!!! 205

  File "/home/pi/adsb-receiver/build/portal/python/flights.fa.py", line 97, in processAircraftList

    db = self.connectDB()

  File "/home/pi/adsb-receiver/build/portal/python/flights.fa.py", line 93, in connectDB

    db=self.config["database"]["db"])

  File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 86, in Connect

    return Connection(*args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in __init__

    super(Connection, self).__init__(*args, **kwargs2)

_mysql_exceptions.OperationalError: (2013, "Lost connection to MySQL server at 'reading authorization packet', system error: 104")

9. Main

1.flightsprocessor

4.processAircraftList

3.connectDB

2.setupDBStatements

5.processAircraft

5b.Updating Aircraft: 8a07ec

5c.Found Aircraft ID: 3837

5d.check if aircraft.has_key

6.processFlight

6c.Updated Flight: MYU7711(3837L, '2022/04/29 05:23:41', u'MYU7711')

6d.Get Flight ID 

7.processPositions

staBbRgInserted position w/ Squawk (3640L, '2022/04/29 05:23:41', 2134, u'2265', 4.499367, 113.912264, 69.0, 28100, -2304, 430.5, -4.1, 3837L)

6e.Check if position data is available

5e.aircraft.has_key flight

Reminder

Posted 2022-04-22 23:17 by azri.

Fix in flight.php:

        $sql = "SELECT id, aircraft, flight, firstSeen, lastSeen FROM ".$settings::db_prefix."flights WHERE id = :id";

        $sql = "SELECT id, icao, firstSeen, lastSeen FROM ".$settings::db_prefix."aircraft WHERE id = :id";

 

lastSeen is missing!

What's missing

Posted 2022-04-22 10:26 by azri.

Aircraft

  • no squawk
  • no flight
  • merge momentarily no position

Plot

  • aircraft history i.e. flights 
  • aircraft on ground

Enhance

  • photo
  • radio
  • merge route data