Off Topic Banter

Post Reply
User avatar
mctom
Posts: 1792
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1
Location: Gdansk, Poland
Has thanked: 204 times
Been thanked: 238 times
Contact:

Re: Off Topic Banter

Post by mctom »

Most of these devices are USB 2.0, so cannot spit out more than 60MB/s.
I assume they output MPEG2 stream, compatible with DVD video, but we will see.

Fortunately my mom has a VCR that I could use as a backup if my grandpa's player is borked beyond repair. Perhaps it has some kind of digital output, but I can't recall any digital video interface before DVI.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
rooted
Posts: 9571
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 761 times
Been thanked: 500 times
Contact:

Re: Off Topic Banter

Post by rooted »

I've never seen a VCR with any digital output, I used to have a JVC with S-Video but that is still analog. Looked noticeably better than standard composite though, I suppose most of Europe had SCART which is better than that I believe.

First digital interface I can recall is FireWire.

User avatar
mctom
Posts: 1792
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1
Location: Gdansk, Poland
Has thanked: 204 times
Been thanked: 238 times
Contact:

Re: Off Topic Banter

Post by mctom »

Yeah, S-Video transports two video signals separately, so it should work a tad bit better than composite.
I read some online reviews of those dongles and apparently some reported their S-video inputs didn't work correctly.

If only we could plug in a PCI card to any modern machine, I'd use one of those old school TV capture things, I bet they were of superior quality compared to contemporary $5 dongles.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
mad_ady
Posts: 10744
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 938 times
Contact:

Re: Off Topic Banter

Post by mad_ady »

Well, that dongle on Amazon reports it works with obs studio, so it must present itself like a uvc camera. That means you can use ffmpeg, no need for dd.

User avatar
mad_ady
Posts: 10744
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 938 times
Contact:

Re: Off Topic Banter

Post by mad_ady »

Sorry for the delay.

So - here are some ideas for encoding:
1. Using Handbrake with software encoding. Note that I remembered why I liked Handbrake - it had a deinterlace filter that could be used, which is very important for that type of video. Sadly, using deinterlace forces you to using the software encoder (ffmpeg has it too).

Code: Select all

nice HandBrakeCLI -i '$infile' -o '$outfile' -t 1 --angle 1 -c 1 -f mp4  --loose-anamorphic  --modulus 2 -e x264 -b $bandwidth -2  -T  -r $rate --cfr -a 1 -E ca_aac --audio-fallback ca_aac --x264-preset=slow  --x264-profile=high --h264-level='4.1' --verbose=1 2>&1
2. Software encoding with ffmpeg:

Code: Select all

nice ffmpeg -i '$infile' -c:v libx264 -preset slower -crf 22 -x264-params 'nal-hrd=cbr' -b:v ${bandwidth}k -maxrate ${bandwidth}k -bufsize 2M -c:a aac '$outfile'
3. Software encoding with ffmpeg and deinterlacing:

Code: Select all

/usr/bin/ffmpeg -y -i '$src/$file' -map 0:0 -codec:v h264 -b:v ${bandwidth}k -pix_fmt nv21 -vf 'yadif, scale=trunc(iw/64)*64:trunc(ih/64)*64' $audioMapping '$dst/${filetimestamp}_$metadata{name}.mp4' 
4. Hardware encoding with ffmpeg on xu4 - sadly no deinterlacing - not sure if you can enable it with the hardware decoder - I guess not:

Code: Select all

/usr/bin/ffmpeg -y -i '$src/$file' -codec:v copy -codec:a none -bsf:v h264_mp4toannexb -f rawvideo - | /usr/bin/ffmpeg -r 25 -vf 'scale=trunc(iw/64)*64:trunc(ih/64)*64' -i -  -i '$src/$file' -map 0:v:0 -vcodec h264 -b:v ${bandwidth}k -r 25 -pix_fmt nv21 -c:a copy '$dst/${filetimestamp}_$metadata{name}.mp4'

Note that this is working with files. In your case you would use "-i /dev/video0" instead of -i "$src/$file" and -i for the audio (from the audio input of the dongle) - something like what is described here: https://stackoverflow.com/questions/117 ... ing-ffmpeg

If I were you, I'd test the XU4's hardware encoder on some test files, to see what quality mapping you need to use (controled via the bitrate -b:v parameter) and then work on the command to do it for the camera.

Also note that the encoder should be supported by gstreamer as well. I know you have some experience with it. Maybe you can do software deinterlacing and hardware encoding with gstreamer...
Here are some details: viewtopic.php?t=24366
Also, if you want to look into handbrake and it's not available for armhf (not sure what the current situation is), you can compile it by roughly following this guide: viewtopic.php?f=98&t=16863&p=196303#p196303
These users thanked the author mad_ady for the post:
mctom (Fri Aug 05, 2022 5:54 pm)

User avatar
mctom
Posts: 1792
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1
Location: Gdansk, Poland
Has thanked: 204 times
Been thanked: 238 times
Contact:

Re: Off Topic Banter

Post by mctom »

Excellent, thank you!

One question though: Can I save the /dev/video0 stream to a file and process it later? Unless it's really a massive amount of data, I'm thinking about spliiting the job between two computers - one for copying, and another for encoding.

I think I used handbrake on RasPi4s some time ago, but it was awfully slow - took me a month to encode a 1h video. :D My Wyse terminal did the same in some 20h or so.
If I get super picky I might run the encoding jobs on a company server - it's idle all the time anyway.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
mad_ady
Posts: 10744
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 938 times
Contact:

Re: Off Topic Banter

Post by mad_ady »

As far as I know no, you can't use /dev/video0 like a block device and dump it with dd (because it's a character device):

Code: Select all

 adrianp  ~  $  ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 Jul 18 17:01 /dev/video0
crw-rw----+ 1 root video 81, 1 Jul 18 17:01 /dev/video1
crw-rw----+ 1 root video 81, 2 Jul 27 19:56 /dev/video2
crw-rw----+ 1 root video 81, 3 Jul 27 19:56 /dev/video3
 adrianp  ~  $  sudo dd if=/dev/video0 of=/tmp/test bs=1000 count=1000
dd: error reading '/dev/video0': Invalid argument
0+0 records in
0+0 records out
0 bytes copied, 0.0025775 s, 0.0 kB/s
 adrianp  ~  ⚑ 1  $  
But you can query its capabilities:

Code: Select all

 adrianp  ~  $  v4l2-ctl --all -d /dev/video0
Driver Info:
	Driver name      : uvcvideo
	Card type        : FJ Camera : FJ Camera 
	Bus info         : usb-0000:00:1a.0-1.6
	Driver version   : 5.15.39
	Capabilities     : 0x84a00001
		Video Capture
		Metadata Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : uvcvideo
	Model            : FJ Camera : FJ Camera 
	Serial           : 
	Bus info         : usb-0000:00:1a.0-1.6
	Media version    : 5.15.39
	Hardware revision: 0x00009783 (38787)
	Driver version   : 5.15.39
Interface Info:
	ID               : 0x03000002
	Type             : V4L Video
Entity Info:
	ID               : 0x00000001 (1)
	Name             : FJ Camera : FJ Camera 
	Function         : V4L2 I/O
	Flags            : default
	Pad 0x01000007   : 0: Sink
	  Link 0x02000013: from remote pad 0x100000a of entity 'Extension 4' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
	Width/Height      : 1280/720
	Pixel Format      : 'MJPG' (Motion-JPEG)
	Field             : None
	Bytes per Line    : 0
	Size Image        : 1843200
	Colorspace        : sRGB
	Transfer Function : Rec. 709
	YCbCr/HSV Encoding: ITU-R 601
	Quantization      : Default (maps to Full Range)
	Flags             : 
Crop Capability Video Capture:
	Bounds      : Left 0, Top 0, Width 1280, Height 720
	Default     : Left 0, Top 0, Width 1280, Height 720
	Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags: 
Streaming Parameters Video Capture:
	Capabilities     : timeperframe
	Frames per second: 30.000 (30/1)
	Read buffers     : 0
                     brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0
                       contrast 0x00980901 (int)    : min=0 max=95 step=1 default=0 value=0
                     saturation 0x00980902 (int)    : min=0 max=100 step=1 default=64 value=64
                            hue 0x00980903 (int)    : min=-2000 max=2000 step=100 default=0 value=0
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
                          gamma 0x00980910 (int)    : min=100 max=300 step=1 default=100 value=100
                           gain 0x00980913 (int)    : min=1 max=8 step=1 default=4 value=4
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=0 value=1 (50 Hz)
				0: Disabled
				1: 50 Hz
				2: 60 Hz
      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
                      sharpness 0x0098091b (int)    : min=1 max=7 step=1 default=2 value=2
         backlight_compensation 0x0098091c (int)    : min=0 max=3 step=1 default=1 value=1
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3 (Aperture Priority Mode)
				1: Manual Mode
				3: Aperture Priority Mode
              exposure_absolute 0x009a0902 (int)    : min=3 max=1250 step=1 default=166 value=166 flags=inactive
         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=1

You could presumably encode on xu4 to a simple/fast format (mjpeg, but there's no native container that can keep also sound), and transcode it elsewhere.
Or you can try a software encoding to mpeg2 (mpegts): http://www.waveguide.se/?article=creati ... ing-ffmpeg, maybe with deinterlacing, and later you could encode the files even further to save disk space. I too think that with a reasonably high bitrate (2-3Mbps @576p) the XU4 could encode in real-time. Not sure if deinterlacing could be done in real-time...

User avatar
mctom
Posts: 1792
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1
Location: Gdansk, Poland
Has thanked: 204 times
Been thanked: 238 times
Contact:

Re: Off Topic Banter

Post by mctom »

Alright, I think you guys gave me more than enough to start tinkering with.

Too bad there are no PCI - USB adapters so I could use an old video capture card. I'll gamble with one of those cheap dongles instead.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

L67GS
Posts: 829
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: M1 8GB -w- MIPI-CSI Camera Kit, XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 245 times
Been thanked: 103 times
Contact:

Re: Off Topic Banter

Post by L67GS »

Medieval fair today, I've wanted a Damascus steel dagger for 20 years and today I found one that felt just right in my hand.
Sure, it cost 4× as much as my Gerber Machete Jr. that's infinitely more practical, but that folded steel just warmed from my heart right down to my wallet.
20220814_195703.jpg
20220814_195703.jpg (434.75 KiB) Viewed 99 times

User avatar
rooted
Posts: 9571
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 761 times
Been thanked: 500 times
Contact:

Re: Off Topic Banter

Post by rooted »

Very nice, now you can open packages in style.
These users thanked the author rooted for the post:
L67GS (Mon Aug 15, 2022 12:35 pm)

User avatar
mctom
Posts: 1792
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1
Location: Gdansk, Poland
Has thanked: 204 times
Been thanked: 238 times
Contact:

Re: Off Topic Banter

Post by mctom »

Never heard of Damascus steel before, I've never seen one in a museum. Different place and time than medieval Poland, clearly.
Have you bought it from an actual blacksmith?

The medieval lifestyle and battle reenactment groups are popular around here.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
rooted
Posts: 9571
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 761 times
Been thanked: 500 times
Contact:

Re: Off Topic Banter

Post by rooted »

For $100'ish I can't imagine this is a custom piece, "Damascus" steel is labor intensive.

L67GS
Posts: 829
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: M1 8GB -w- MIPI-CSI Camera Kit, XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 245 times
Been thanked: 103 times
Contact:

Re: Off Topic Banter

Post by L67GS »

I'm sure it's mass market, more or less decorative. Probably made in India or something.

User avatar
rooted
Posts: 9571
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 761 times
Been thanked: 500 times
Contact:

Re: Off Topic Banter

Post by rooted »

L67GS wrote:I'm sure it's mass market, more or less decorative. Probably made in India or something.
I'm sure the blade is plenty strong, just made on a large scale.

L67GS
Posts: 829
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: M1 8GB -w- MIPI-CSI Camera Kit, XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 245 times
Been thanked: 103 times
Contact:

Re: Off Topic Banter

Post by L67GS »

rooted wrote:
Tue Aug 16, 2022 5:39 am
L67GS wrote:I'm sure it's mass market, more or less decorative. Probably made in India or something.
I'm sure the blade is plenty strong, just made on a large scale.
It's a fantastic piece, well balanced, Damascus steel by nature has good edge retention, nice to hold, and beautiful. I thought "nope" when I saw that handle but when I held it the spiral handle was actually really nice. I might have a black sheath made for it that's a little more period specific.

phaseshifter
Posts: 3763
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 68 times
Been thanked: 51 times
Contact:

Re: Off Topic Banter

Post by phaseshifter »

phase wrote....


droid@server:~$ lsb_release
No LSB modules are available.
odroid@server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Kinetic Kudu (development branch)
Release: 22.10
Codename: kinetic
odroid@server:~$ uname -a
Linux server 5.18.0-odroid-arm64 #1 SMP PREEMPT Ubuntu 5.18.0-202205181718~jammy (2022-05-18) aarch64 aarch64 aarch64 GNU/Linux
odroid@server:~$


droid@server:~$ uname -a
Linux server 5.18.0-odroid-arm64 #1 SMP PREEMPT Ubuntu 5.18.0-202205181718~jammy (2022-05-18) aarch64 aarch64 aarch64 GNU/Linux
odroid@server:~$ neofetch
`:+shmNNMMNNmhs+:` odroid@server
.odMMMMMMMMMMMMMMMMMMdo. -------------
/dMMMMMMMMMMMMMMMmMMMMMMMMd/ OS: Ubuntu MATE Kinetic Kudu (develo
:mMMMMMMMMMMMMNNNNM/`/yNMMMMMMm: Host: Hardkernel ODROID-M1
`yMMMMMMMMMms:..-::oM: -omMMMMMy` Kernel: 5.18.0-odroid-arm64
`dMMMMMMMMy-.odNMMMMMM: -odMMMMMMd` Uptime: 7 mins
hMMMMMMMm-.hMMy/....+M:`/yNm+mMMMMMMMh Packages: 2596 (dpkg), 7 (snap)
/MMMMNmMN-:NMy`-yNMMMMMmNyyMN:`dMMMMMMM/ Shell: bash 5.1.16
hMMMMm -odMMh`sMMMMMMMMMMs sMN..MMMMMMMh Resolution: 1920x1080
NMMMMm `/yNMMMMMMMMMMMM: MM+ mMMMMMMN DE: MATE 1.26.0
NMMMMm `/yNMMMMMMMMMMMM: MM+ mMMMMMMN WM: Metacity (Marco)
hMMMMm -odMMh sMMMMMMMMMMs oMN..MMMMMMMh Theme: Yaru-MATE-light [GTK2/3]
/MMMMNNMN-:NMy`-yNMMMMMNNsyMN:`dMMMMMMM/ Icons: Yaru-MATE-light [GTK2/3]
hMMMMMMMm-.hMMy/....+M:.+hNd+mMMMMMMMh Terminal: mate-terminal
`dMMMMMMMMy-.odNMMMMMM: :smMMMMMMd` Terminal Font: Ubuntu Mono 13
yMMMMMMMMMms/..-::oM: .+dMMMMMy CPU: (4) @ 1.992GHz
:mMMMMMMMMMMMMNNNNM: :smMMMMMMm: Memory: 1214MiB / 3734MiB
/dMMMMMMMMMMMMMMMdNMMMMMMMd/
.odMMMMMMMMMMMMMMMMMMdo.
`:+shmNNMMNNmhs+:`
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

phaseshifter
Posts: 3763
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 68 times
Been thanked: 51 times
Contact:

Re: Off Topic Banter

Post by phaseshifter »

@rooted
@ odroid
@ mad_ady
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

User avatar
mad_ady
Posts: 10744
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 938 times
Contact:

Re: Off Topic Banter

Post by mad_ady »

Always living on the edge, eh?

phaseshifter
Posts: 3763
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 68 times
Been thanked: 51 times
Contact:

Re: Off Topic Banter

Post by phaseshifter »

what can i say
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

User avatar
rooted
Posts: 9571
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 761 times
Been thanked: 500 times
Contact:

Re: Off Topic Banter

Post by rooted »

phaseshifter wrote:what can i say
Life's short eh

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 6 guests