07-11-2012, 02:12 PM | #136 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Real tools indeed need to be robust. But tutorial demos need to be crystallized into their bare essence with no distracting baggage (like error handling that can easily swamp the inner algorithm). I am also a big fan of getting as much of the important stuff "above the fold" (no scrolling) as possible, which means minimal white space. You can always expand it with AStyle later... |
|
07-11-2012, 03:24 PM | #137 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
Ill have look what my options are EDIT: I'm looking. And I noticed this: If your computer is not fast enough, you can speed up the compression at the expense of the compression ratio. You can use ’-me zero’ to speed up motion estimation, and ’-g 0’ to disable motion estimation completely (you have only I-frames, which means it is about as good as JPEG compression). Which I thought I would mention. Last edited by twobob; 07-11-2012 at 03:36 PM. Reason: Added interesting snippet |
|
Advert | |
|
07-11-2012, 03:37 PM | #138 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
|
|
07-13-2012, 01:01 AM | #139 | |
Padawan Learner
Posts: 33
Karma: 86
Join Date: Jul 2012
Location: Galactic Sector ZZ9 Plural Z Alpha
Device: Kindle Touch
|
Quote:
post more thoroughly, and i saw what you said at the end about another way to check for a keypress event. well i was fumbling around blindly while a video was going, trying to close the video(i had forgotten about ctr c) and i somehow typed in hd, which displays keypresses like command prompt in windows displays ctrl commands... with alot of arrows and a letter corresponding to the keypress. i was wondering... could there be someway to use that to close videos? btw sorry for grammatical/spelling errors, im typing this on my kindle... XD |
|
07-13-2012, 01:27 AM | #140 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Last edited by geekmaster; 07-13-2012 at 01:31 AM. |
|
Advert | |
|
07-13-2012, 11:29 PM | #141 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
zcat santa.raw.gz |./Balsamic plughw:0 ./santa8kmono.wav
This doesn't actually work by the way. video is miles out of sync (I only scoop every 4 frames right now while I get it going) - also don't want the separate files - or separate inputs - or to run to mem - and various other bad things. EDIT: I Added threading, The video is MILES out of sync but is pictures and sound. And now not so jerky, Proof of utterly mangled concept, A true coding horror but with a little massage and some process unification I think this will get the job done. the principle of seperate files is fundamentally flawed (as I knew it would be) but I wanted sound and vision and I got it. Time to tidy up the file handling and unify the data stream Spoiler:
Tomorrows job - make this actually work at all heheheh still sound and video together is always good, however mangled and wrong It's the future. Last edited by twobob; 07-14-2012 at 10:37 AM. Reason: added call structure, and some sense - and partial success |
07-14-2012, 12:07 AM | #142 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I think we should skip the vsync call and sync to the audio stream instead.
On a K3, it spends all its time in the eink update. The vsync does not really do anything on a K3 because it is set for 7FPS and the eink call returns at 7FPS average (+/- a little). Sometimes it waits a tiny amount of time, and sometimes it is a little late (compensated on next frame by next teu+=130. The vsync is really there for the K4/K5 that have asynchronous eink updates (which return WAY before the eink is ready). You really must wait awhile on them before touching the framebuffer. As I see it, we need two threads that each spend virtually all their time inside the update call (sound or eink). For any interactivity (scanning for keyboard or touchscreen events) we need a third GUI thread too. Doing it with callbacks cannot work while the thread is almost ALWAYS stalled inside the eink update on a K3. pthreads is not all that difficult. Even the ALSA docs say you need multiple threads (just like I suggested above). And with threads, we can just use the tiny sound support I used in my "noisy rhythm" demo. With interleaved raw A/V input (compressed with gzip or other compression) we do not need all that "visual space hogging" AVI support. IMHO. Need sleep now. Will try adding threads and stripping out the fluff tomorrow. Tomorrow I will pick up where you left off here (or in a PM, whichever is newer). After it works, I will add simple decompression inside this code so we do not need to pipe from zcat. Or you do it. Whichever gets there first. Or I might add audio to my sound demo. I will sleep on it. Cannot make decisions now. TTYL... Last edited by geekmaster; 07-14-2012 at 07:54 AM. |
07-14-2012, 07:21 AM | #143 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Right. Vsync. Threads. Yep this was never about showing it working. Simply about making sound and vision together before I got in bed.
: ) Thanks for your great and as always sage feedback. EDIT: Updated the above code and forwarded via PM. Running this code now WITHOUT a stdin stream produces less than 1% use on K3 TODO: Unified format - striped in some way to be determined. Settle on an audio format (or make it dynamically determine format of audio (or fix this) / channel count / rate etc. and setup the buffer skips accordingly.) Look into Timestamped/timeindexed data stream and maybe locking via mtuex all protected stream info Replace stdin and Zcat Zcat uses about 7% of sys resources at the moment. that will be a nice saving assuming the internal de/compression aces that for performance. Try threading audio rather than callback (although audio is now pretty solid), add some thread efficiency monitoring code. Look into suspending audio buffers and providing << >> |> [] ["] Transport options. Add a GUI. Nice to have Last edited by twobob; 07-14-2012 at 10:58 AM. Reason: added that I updated the code, added TODO list |
07-15-2012, 01:01 AM | #144 |
Padawan Learner
Posts: 33
Karma: 86
Join Date: Jul 2012
Location: Galactic Sector ZZ9 Plural Z Alpha
Device: Kindle Touch
|
so would the waitforkey command or whatever i end up using to shutdoen the player, how would i implement it into the kindle? would i ave to repack the videoplayer or something, or would i just need to add a command to execute the script when i launch the videoplayer?
|
07-15-2012, 01:16 AM | #145 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
You can also process keypresses by reading the binary /dev/event* device data for the keyboard (using hexdump from a script, or in a C program). There are other ways to, but they would require more research. Last edited by geekmaster; 07-15-2012 at 09:20 AM. |
|
07-15-2012, 03:43 AM | #146 |
Connoisseur
Posts: 93
Karma: 498332
Join Date: Jun 2012
Device: 2 * K3 with 3G, Sony PRS-T1
|
Fascinating, would have thought that such a thing was impossible?
|
07-15-2012, 09:22 AM | #147 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Things are only "impossible" if you give up trying new ways to solve them before you find a working solution. Doing the "impossible" takes a LOT of persistence (and creativity) in many cases. Much of my life has been defined by successfully doing things that others claimed was "impossible" (which I took as a challenge). I like seeing people (literally) "drop their jaws" when I show them my stuff.
Last edited by geekmaster; 07-16-2012 at 08:38 AM. |
07-16-2012, 06:25 PM | #148 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I have a gmplay-2.0, which plays video in one thread and "noisy rhythms" audio in another thread. On my k5, it plays perfectly, using abou 12% CPU. Of course, knowing that the K3 eink update burns CPU, I need to test it there too... EDIT: On the K3, it burns 93% CPU (mostly in the eink update call). But the video plays full speed even with synthesized sound. EDIT2: After recompiling with optimization (-O3) it now uses 82% CPU on the K3 -- a useful improvement.
Old message: Spoiler:
UPDATE: My K3 sound works (for noisy and tones) after turning down the volume. It must have some kind of overload detection that makes it drop out for a bit if it is too loud. I had it turned up for the quiet 8kb8mono.wav|aplay test (which is still quite even at max volume). So, if there are sound dropouts, turn down the volume. The next step in this path of combined Audio/Video evolution of gmplay is to use sound interleaved into the video file, instead of synthesizing it. Last edited by geekmaster; 07-16-2012 at 06:43 PM. |
07-16-2012, 07:52 PM | #149 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Movies with sound, coming soon to a kindle near you!
This is a "Work In Progress". It is gmplay 2.0 (now with sound). This is just a demo showing multithreaded sound and video. The main thread is where future GUI stuff will go. The video thread exits after the video is done playing. The audio continues indefinately, until killed when the main program exits.
The sound in this demo is synthesized, as described in the "noisy rhythms" demo in the "geekmaster's sound demos" thread). The next step is to add sound to the .gmv.gz movie files, and replace synthesized sound with recorded sound. On a K3, if you get periodic sound dropouts, turn down your sound a bit with the Vol- button. PHP Code:
Last edited by geekmaster; 07-17-2012 at 10:31 PM. |
07-16-2012, 09:58 PM | #150 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
kindle audio/video gmv format
Below is a detailed description about how I plan to add sound into my GMV (geekmaster video) file format, in a (mostly) backward-compatible way. Also described is a little bit about how to process that data to overcome potential problems caused by eink update time variability. Click the show button if that sort of thing interests you.
Technical Details: Spoiler:
After the GMV files have embedded sound, I will change the gmplay 2.0 code you can see in the previous post so that it can play this new audio sound track on the kindle speakers (or headphones) while simultaneously playing the video on the kindle eink screen. Last edited by geekmaster; 07-17-2012 at 09:44 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hacks free kindle video player | geekmaster | Amazon Kindle | 0 | 05-07-2012 12:17 AM |
Video Player | wilbrich | Kobo Tablets | 1 | 11-24-2011 02:40 PM |
Video player, Video streaming,Remote | mint121 | enTourage eDGe | 1 | 11-18-2011 03:31 PM |
Frustrated with the video player | TonyToews | Kobo Tablets | 10 | 11-01-2011 01:15 PM |