Go to advanced search

by gkreidl
Fri Jun 28, 2019 11:25 am
Forum: Graphics, sound and multimedia
Topic: Real Time Transcoding of DVB TV Streams
Replies: 322
Views: 106961

Re: Real Time Transcoding of DVB TV Streams

Hi, I have problem: pi@raspberrypi:~/rtranscode4/web $ ./serve.py Traceback (most recent call last): File "./serve.py", line 21, in <module> import rtc4 ImportError: /home/pi/rtranscode4/web/rtc4.so: undefined symbol: PyFPE_jbuf What am I doing wrong? Thank for any answer. Which OS (Jessie, Stretch...
by gkreidl
Fri Jun 28, 2019 5:07 am
Forum: General discussion
Topic: Pi 4 and the Million Digit Fibonacci Challenge.
Replies: 17
Views: 1117

Re: Pi 4 and the Million Digit Fibonacci Challenge.

It has no problem just printing everything to the terminal window as above. fibo_phy on the other hand was still doing something on teh one core at 14-16MB after I terminated it at over 11mins I removed all the command line arguments, as other just set the variable inside. back to fibo.py with the ...
by gkreidl
Thu Jun 27, 2019 6:24 am
Forum: General discussion
Topic: Is the new Raspberry Pi 4 capable to play H.264 4K or only to play H.264 1080P?
Replies: 9
Views: 1509

Re: Is the new Raspberry Pi 4 capable to play H.264 4K or only to play H.264 1080P?

Slight offtopic, but whilst waiting for the post to show up with the Shiny new Pi4 .. I have prepping a buster image on a 3+. On that, ffmpeg (installed from repo ) decodes through MMAL just fine, but hangs on trying to encode with OMX. This is 1080p source, to 1080p output, using good old big buck...
by gkreidl
Wed Jun 26, 2019 6:09 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

Taking out the check for 0 is a good idea. My Python function now looks like this: def fibo(n): if n <= 0: return 0 if use_gmp: a = mpz(0) b = mpz(1) else: a = 0 b = 1 numbits = int(math.log(n,2)) for i in range(numbits,0,-1): d = a*(b*2-a) e = a*a+b*b if (n >> i) & 1: a = e b = d + e else: a = d b ...
by gkreidl
Wed Jun 26, 2019 7:57 am
Forum: Beginners
Topic: How do I add "time shifting" to Raspberry Pi TV HAT
Replies: 13
Views: 487

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Isn't recording video exactly one of the things that SD cards are designed for? Surely this will give less wear that normal OS usage. The OP wants to record 3 DVB-T2 (HD) channels for 24 hours. One HD channel may need 70-90 GB for 24 h recording. So this application would write approx. 240 GB per d...
by gkreidl
Wed Jun 26, 2019 7:37 am
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Speeding up the fast doubling algorithm

I implemented the fast doubling algorithm in Python as shown below. def fibo(n): if n <= 0: return 0 if use_gmp: a = mpz(0) b = mpz(1) else: a = 0 b = 1 numbits = int(math.log(n,2)) for i in range(numbits,-1,-1): d = a*(b*2-a) e = a*a+b*b if (n >> i) & 1: a = e b = d + e else: a = d b = e return a T...
by gkreidl
Wed Jun 26, 2019 6:35 am
Forum: Beginners
Topic: How do I add "time shifting" to Raspberry Pi TV HAT
Replies: 13
Views: 487

Re: How do I add "time shifting" to Raspberry Pi TV HAT

You should NEVER use the SD card for recording but an external HDD (or maybe SSD). The SD will wear out soon. Isn't recording video exactly one of the things that SD cards are designed for? Surely this will give less wear that normal OS usage. Having said that, I use an external 240GB SSD for stori...
by gkreidl
Wed Jun 26, 2019 4:14 am
Forum: Beginners
Topic: How do I add "time shifting" to Raspberry Pi TV HAT
Replies: 13
Views: 487

Re: How do I add "time shifting" to Raspberry Pi TV HAT

I do quite a lot of TV recording on the RPi. I'm not using the TV HAT, but a DVB-S2 receiver connected via USB. I do not use tvheadend, but mumudvb using my own frontend. My software can stream single channels, multiple channels from one Transponder or a comple transponder (all channels). You should...
by gkreidl
Wed Jun 26, 2019 3:34 am
Forum: General discussion
Topic: Why is the RPi4 being advertised as a desktop computer?
Replies: 80
Views: 7758

Re: Why is the RPi4 being advertised as a desktop computer?

Where is it carved in stone that a desktop computer absolutely must run a Microsoft OS? Other that in Redmond, WA, of course. There are plenty of people that use a Linux system for a desktop computer. The Pi is the same, only smaller, rather slower, but much cheaper and requires far less power. Sta...
by gkreidl
Tue Jun 25, 2019 4:39 am
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

ScriptBasic wrote:
Tue Jun 25, 2019 2:05 am
Is it my understanding all fibos using GMP leak? How does the Python GMP extension do running in a loop?
No leak.
by gkreidl
Mon Jun 24, 2019 9:57 am
Forum: General discussion
Topic: Raspberry Pi 4 Thread - general discussion
Replies: 742
Views: 63328

Re: Raspberry Pi 4 Thread - general discussion

Is OpenMax still supported? Will omxplayer continue to work (except for the missing HW codecs)? I'm using it a lot of projects.
by gkreidl
Wed Jun 19, 2019 5:05 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

gkreidl, Of course they are getting smaller, but there are more of them, not just "20 or so (recursions)" as you wrote some posts above. And usually 3 numbers of about half the size are required (not for the first recursion). What I wrote was correct: "That is very different to starting with a bunc...
by gkreidl
Tue Jun 18, 2019 9:02 pm
Forum: General discussion
Topic: GUI based video player PI3
Replies: 6
Views: 399

Re: GUI based video player PI3

mmkw43 wrote:
Tue Jun 18, 2019 8:07 pm
Oh -- my bad. I thought it was just a command line player. I'll look into that. !
It wraps a GUI around omxplayer.
by gkreidl
Tue Jun 18, 2019 8:09 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

gkreidl, That's not very precise. I believe what I posted is very precise. There are 1000000 digits in fibo(4784969) There are 500000 digits in fibo(4784969 / 2) There are 250000 digits in fibo(4784969 / 2 / 2) There are 125000 digits in fibo(4784969 / 2 / 2 / 2) ... That accounts for the sizes of ...
by gkreidl
Tue Jun 18, 2019 7:12 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

At every level of recursion a fibo(n) is making calls to fibo(n/2) and fibo(n/2 + 1) So the number of digits of the result of each recursion is half as many as the caller is calculating. 500000, 250000, 125000, 62500, 31250....etc. They get small pretty fast. That's not very precise. Here is a list...
by gkreidl
Tue Jun 18, 2019 7:04 pm
Forum: General discussion
Topic: GUI based video player PI3
Replies: 6
Views: 399

Re: GUI based video player PI3

Omxplayer does a great job playing videos, found that VLC does not. Would like however a GUI based player like VLC that does the trick, maybe with some options like playing all videos in a folder with a shuffle option? Anything available? Like Omxplayer and I could write a script I suppose but just...
by gkreidl
Sat Jun 15, 2019 9:00 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

To compare the speed of doing maths with big integers in Python and C we can look at the results of running ejolson's fibogmp.c and my fibo.py. Neither of these cheat by using any ready made fibo function, they just do regular maths operations on big ints. fibogmp.c $ time ./fibogmp | tail -c 100 G...
by gkreidl
Sat Jun 15, 2019 8:06 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

How much faster is GMP over Python's native BIGINT? Fibo function: 26 (Python 3) to 31 (Python 2) times faster. For small numbers the difference is smaller. The string conversion needed for printing is 240 times faster. The GMP fibo function is about 1.6 times faster than the Python function using ...
by gkreidl
Thu Jun 13, 2019 8:31 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

Here is my final Python Fibonacci challenge script (fibo_final.py). It can be used with Python 2 or 3 and also with pypy and uses the fastest available method (if not told otherwise) without cheating (using the fibo function built into GMP). That means, it will use GMP, if gmpy2 is available. Otherw...
by gkreidl
Tue Jun 11, 2019 6:10 am
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

The Python wrappings for GMP are in the repository, both for Python 2 and 3: sudo apt-get install python-gmpy2 python3-gmpy2 We do not have to change the fibo code at all, just add imports and redefine the fibs dictionary and the string conversion for printing. At the bottom of the script I have add...
by gkreidl
Sun Jun 09, 2019 5:24 am
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

Nobody has mentioned or tested the Python fibo challenge algorithms with pypy so far, which is a bit unfair when comparing it to JS, for example, as most modern JS engines include a JIT compiler. fiboch.py is my script using the Python algorithm from github. At the end I have added: t = time.time() ...
by gkreidl
Thu Jun 06, 2019 9:27 am
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

The riddle of slow or fast printing (Python, both algorithms) Before anything can be printed it has to be converted to a string. The conversion of the fibo(4784969) bigint takes about 301 seconds res = fibo(4784969) t = time.time() restr = str(res) print (time.time()-t) The conversion of the high pr...
by gkreidl
Wed Jun 05, 2019 5:52 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

gkreidl, Interesting. I have somewhat different results running on a Pi 3 (not +) under 64 bit Debian: With printing of the output removed in both cases: $ time python3 fibo.py 4784969 real 0m5.096s user 0m5.051s sys 0m0.044s $ time python3 fibo_phi.py 4784969 real 1m15.632s user 1m15.019s sys 0m0....
by gkreidl
Wed Jun 05, 2019 9:16 am
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 733
Views: 28149

Re: A Final Fibonacci Challenge

No idea, I never use Python. But the "python" command here uses python2. After a while I was wondering why it was not finishing... Now you know why I put days or month on it. I was thinking that could be a good approach because is only one calculation but each variable contains a lot of significant...
by gkreidl
Wed Jun 05, 2019 7:50 am
Forum: Raspbian
Topic: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)
Replies: 1524
Views: 636902

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thanks. I have to confess, I'm not sure about how the website is generated. I'm using version 3 of it: https://github.com/Manuel83/craftbeerpi3 Even if I start kweb with just: kweb http:localhost:5000 it only loads a dark screen below the address bar - nothing else. I've tried Midori also - same pr...

Go to advanced search