Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-08-2012, 08:42 AM   #46
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
Like everything else, it is just a matter of time (and few productive people have enough of that to spare).
Perhaps this project has reached the point where you could put it into a public repository (github? the mobileread project repo?) so that others could help and contribute.
knc1 is offline   Reply With Quote
Old 05-08-2012, 09:22 AM   #47
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
Perhaps this project has reached the point where you could put it into a public repository (github? the mobileread project repo?) so that others could help and contribute.
Perhaps. This demo video player was not meant to be standalone. I want it to become a video output filter for a static build of mplayer that works on all eink kindles without library version conflicts. I did not publish the dither-conversion transcoder program yet -- it contains unfinished motion-blur code. I have too many public domain videos in my collection that I converted, but which have too much action for this lower eink framerate. My previous frame-dropping method only works for slower motion like in the published videos. I want to make a video frame contain faded copies of previously-dropped frames, so that motion direction is obvious even when viewing a still frame (like on a DX and DXG that show the most recent frame every 1.5 seconds). When I have satisfactory video results for high-motion action scenes, I will publish my "kindle video transcoder" too. For now, the gmplay source code is in the first post of this thread, and it contains proof-of-concept core code showing how to play pre-dithered video on all eink kindle models.

Although not the original goal for gmplay, it is useful enough on its own that I also want a simple standalone (low-resource) enhanced version of gmplay to play pre-dithered videos such as those posted above, and which does not need mplayer, but it will need (framebuffer-based) progress bar, file chooser, and DVR buttons, etc.

The code in the first post also serves as a generic demonstration of how to do framebuffer graphics and eink updates in a portable way that works efficiently on all eink kindles. The lower you go the more performance you can get from the hardware. Unless you add my code above to the framework, how would you do video and animation using only high-level framework-based GUI code?



Last edited by geekmaster; 05-08-2012 at 10:20 AM.
geekmaster is offline   Reply With Quote
Old 05-08-2012, 10:17 AM   #48
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
This thread currently has more than 1,400 hits, but the video downloads only have about a dozen hits. That seems rather strange to me...
geekmaster is offline   Reply With Quote
Old 05-08-2012, 10:36 AM   #49
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
I think the number of users who dare to go to a CLI interface is much lower than one might think by looking at this forum. You'll probably find that doing a youtube video (even if vid quality is bad) of a kindle playing video will also get lots of hits fast. Unfortunately, there are less developers in the developer board than one might think at first.
hawhill is offline   Reply With Quote
Old 05-08-2012, 10:46 AM   #50
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
This thread currently has more than 1,400 hits, but the video downloads only have about a dozen hits. That seems rather strange to me...
Seems right on the money according to my experience -
10% of readers (lurkers) find the post interesting;
10% of those interested in the post download.
You might be short one or two downloads at most.
knc1 is offline   Reply With Quote
Old 05-08-2012, 11:44 AM   #51
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
Seems right on the money according to my experience -
10% of readers (lurkers) find the post interesting;
10% of those interested in the post download.
You might be short one or two downloads at most.
That one-percent estimate fits well with LOTs of things. Back when I used to find new clients by cold-calling (knocking on doors), I had about a one-percent success rate.

SPAM (junk email) is popular because (sadly) the spammers actual make the sale on about one percent of what they send out. That is why they can afford to PAY for time on botnets...

And based on download counts on my debricking repair image files (hundreds of hits for each file), I suspect that the success reports in the "simple debricking" sticky only cover about one-percent of ACTUAL successful debrickings (especially when so many people get bricks from too many books, or failed firmware updates).

So, the world is 99% full of non-productive lurkers, huh? ("Non-productive" in this context means content-consumers who are not also content-producers).

EDIT: So, to please the OTHER 99% (consumers), we (producers) need to post youtube videos of these then, right?


P.S. What do you think of the "harvey" video? Rather creepy for a short film presented at a computer animation conference (Siggraph 2001), IMHO. I chose it because the original is black and white, with no dialog, and slow movement (and it is completely different from the other videos, for a broader potential audience).

I have a lot of videos I did not post because the action sequences are not good for eink, so I plan to try motion-blur variations to see what makes them reasonably watchable on eink. Eink does not like high-contrast fast-moving objects, and motion-blur should reduce the contrast and provide progressively fading in-betweens to help determine motion during chaotic fight scenes (such as in Sintel from the producers of Big Buck Bunny).

The thing to take into account for eink-specific motion-blur is that the eink drivers can quickly update black pixels, but can delay drawing white pixels for up to 300msec here (or can leave a trail of alternating ghosting for up to 2 seconds in extreme cases like the spatiotemporal random-dither demos).



Last edited by geekmaster; 03-10-2016 at 03:30 PM. Reason: Rename "forensic" to "debricking repair".
geekmaster is offline   Reply With Quote
Old 05-08-2012, 12:07 PM   #52
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post

So, the world is 99% full of non-productive lurkers, huh? ("Non-productive" in this context means content-consumers who are not also content-producers).
From your own observations of the de-brick downloads vs reports -
Some of those 99% are people who do read the first forum thread,
fix their problem, and quietly go away. (Which is just fine, that is why it is sticky.)
knc1 is offline   Reply With Quote
Old 05-08-2012, 12:39 PM   #53
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
From your own observations of the de-brick downloads vs reports -
Some of those 99% are people who do read the first forum thread,
fix their problem, and quietly go away. (Which is just fine, that is why it is sticky.)
And the fact that you can read and download as an anonymous lurker, but you have to REGISTER to leave a success report, only contributes to this high "quietly go away" ratio...

EDIT: Regarding the image downloads, amazon techs told me that providing the images for debricking purposes "should be okay", but they never followed that up with written permission from their legal staff as I requested. Until I get written permission, I will keep access to the debricking repair images in the form of non-clickable URLs on a pastebin.com page, as can be seen in the sticky first post (to comply with the MR "no direct links to IP" rule ridgidly enforced in the parent forum).


Last edited by geekmaster; 03-10-2016 at 09:24 PM. Reason: Rename "forensic" to "debricking repair".
geekmaster is offline   Reply With Quote
Old 05-08-2012, 02:30 PM   #54
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Woohoo! The weighted motion blur on in-between frames makes the resulting action scenes MUCH better on eink! Now I want to go back and re-encode all the videos, so the bunny's ears do not look so jerky, for example. Subtle little things can make a huge difference in perceived quality. But first, to re-encode the ones that were too jerky to post...
geekmaster is offline   Reply With Quote
Old 05-08-2012, 03:12 PM   #55
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Careful, you might drag these Kindles into the 19th century:
http://en.wikipedia.org/wiki/File:Telephonoscope.jpg

Hmm...
I guess they didn't have BlueTooth headsets in 1879.

Or later, like the 20th century:
http://en.wikipedia.org/wiki/Videoph...one_technology
They (AT&T) boasted of (up to) 10 frames/second but 3 frames/second was more common in the real world.

So except for the slowest model - your already there - slow-scan video calls on a "book" isn't all that bad.

Might have to re-awaken that SIP thread (which seemed to die off at finding matching audio library versions).

Last edited by knc1; 05-08-2012 at 03:44 PM.
knc1 is offline   Reply With Quote
Old 05-08-2012, 04:39 PM   #56
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Another big woohoo! I added double-buffering to gmplay, then I added the ability to specify msec per update on the gmplay command line. On the K4, although the eink drivers fall behind doing 30FPS fullscreen, it does 24FPS just fine (41msec/frame). That means that the K5 (and K4diags) should be able to play movies at full speed with no dropped frames.

I now have 800x600 24FPS video running on my K4 and it is very smooth. This would be great for video games. This is ready for Doom or Quake -- absolutely... ;-)

I am actually quite surprised considering that the Reference Manual for the chipset used in the K4 says you need to wait 300msec between updates in DU (pure black and white) mode, and I am "overclocking" the eink by ignoring completion status and sending update at 2.5x normal speed in the published gmplay, and 7x in my private copy and there are no eink artifacts (except for fast moving high contrast stuff) using dithering like I am. If we control our source content we can go quite fast.

The K3 cannot go faster than 2.5x, so I set my standard framerate in my .gmv.gz files as 2.5x. going faster will make much larger video files, but can be done in a video game (or video demo) with no file size penalty.

And... I am doing full-screen updates at this speed -- cool!

I have learned a LOT, which does not show because my code has gotten MUCH smaller and simpler even while it has drastically gained performance over my earlier experimental eink code.

Last edited by geekmaster; 05-08-2012 at 05:39 PM.
geekmaster is offline   Reply With Quote
Old 05-08-2012, 05:09 PM   #57
MaPePeR
Connoisseur
MaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughingMaPePeR can shake the floor when laughing
 
Posts: 58
Karma: 63518
Join Date: Apr 2012
Device: KT
I think you could drag even more attention when you add videos of your videos to your first post (for non kindle-owners, etc).
maybe engadget will notice you

Also: Awesome work!

Quote:
I am actually quite surprising considering that the Reference Manual for the chipset used in the K4 says you need to wait 300msec between updates in DU (pure black and white) mode
Most of the time they have reasons to write that in the manual.
MaPePeR is offline   Reply With Quote
Old 05-08-2012, 05:42 PM   #58
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Except it is okay to cheat the specs in this case, because we are not running life-critical or mission-critical apps here. Technically, by calling for eink updates well before the drivers say they are ready, we are performing eink overclocking here.
geekmaster is offline   Reply With Quote
Old 05-08-2012, 07:27 PM   #59
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
I figured out the parameters for ffmpeg to convert a video on the web (sintel.org) and pipe its output to my "raw2gmv" dither filter then to "nc -l 5555". On my kindle I do "nc 192.168.1.201|./gmplay" and it works.

Because ubuntu ffmpeg is missing the transpose (and all other "-filters" options) O set the size to 600x400, and it played 2-up (600x400 above another 600x400 image).

After compiling ffmeg from source to get all the filters (https://ffmpeg.org/trac/ffmpeg/wiki/...mpilationGuide) I now am playing "normally" 800x600. Everything is a bit tall and narrow with no letterbox, but I can add one with ffmpeg if I want it. Stretched to full screen gives a lot more detail than letterboxing.

Anyway, the point is that I am now playing a live High-definition stream (http://mirrorblender.top-ix.org/movi...8-surround.mp4) directly from the web server to my kindle, through a transcoder/proxy on my host PC.

transcode/proxy (2-up image 400x600) using ffmpeg installed with ubuntu apt-get:
PHP Code:
ffmpeg -i http://mirrorblender.top-ix.org/movies/sintel-2048-surround.mp4 \
 
-pix_fmt gray -vf transpose=-vcodec rawvideo -f rawvideo --s 600x400 - | \
 
raw2gmv nc -l 5555 


transcode/proxy rotated 800x600 video using ffmpeg (with filters) built from source:
PHP Code:
~/ffmpeg/ffmpeg -i http://mirrorblender.top-ix.org/movies/sintel-2048-surround.mp4 \
 
-pix_fmt gray -vf transpose=-vcodec rawvideo -f rawvideo --s 600x400 - | \
 
raw2gmv nc -l 5555 


One thing interesting here is that I do not have to do the framedropping myself like I did when I was using mplayer to convert to raw video. ffmpeg is automatically dropping frames at the rate set by gmplay running on the kindle. My latest gmplay lets me adjust that on the command line.

Okay, I am playing it at 24FPS on my K5 now, and there are screen artifacts on fast moving high contrast objects (the fight scene). Now running 12FPS (waiting for fight scene). The eink display really can get by with much less FPS than light-emitting displays. Oh... it looked great until the fight scene. Back th K3-compatible 7.7FPS (which looks great on eink -- something you could never get away with on LCD or CRT).



Last edited by geekmaster; 05-08-2012 at 08:37 PM.
geekmaster is offline   Reply With Quote
Old 05-08-2012, 09:17 PM   #60
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Arrow geekmaster kindle video transcoder

I added 90-degree rotate right to my "geekmaster video transcoder" so there is no need to compile ffmpeg from source code to get the video rotate function. While adding this feature, my code shrunk down to about 10-percent of the code it had before. Last time it shrunk a lot was when I added contrast and brightness adjustments. I like when adding features makes your code smaller.

Here is my simple, efficient and elegant video transcoder that takes 800x600 grayscale raw video piped from ffmpeg (or any other source of raw video), then does rotate right, "no dither table" ordered dither, and 8-pixel-per-byte packing.

I can find no evidence that performing an ordered dither using a logical expression derived by applying Karnaugh mapping to a dither table has been used before.

Here is the source code:
PHP Code:
//====================================================
// raw2gmv 1.0a - raw to geekmaster video transcoder
// Copyright (C) 2012 by geekmaster, with MIT license:
// http://www.opensource.org/licenses/mit-license.php
//----------------------------------------------------
#include <stdio.h>  // stdin,stdout
typedef unsigned char u8typedef unsigned int u32;
int main(void) {
    
u8 o,to,tb,wb0[800*600]; u32 x,y,xi,yi,c=250,b=120// c=contrast, b=brightness
    
while (fread(wb0,800*600,1,stdin)) for (y=0;y<800;y++) { xi=ytb=0;
        for (
x=0;x<600;x++) { yi=599-xo=x^y;
            
to=(y>>2&1|o>>1&2|y<<1&4|o<<2&8|y<<4&16|o<<5&32)-(wb0[yi*800+xi]*63+b)/c>>8;
            
tb=(tb>>1)|(to&128); if (7==(x&7)) { fwrite(&tb,1,1,stdout); tb=0; }
        }
    } return 
0;

Here is how I proxy a video stream to my kindle with 16:9 aspect ratio:
PHP Code:
ffmpeg -i http://mirrorblender.top-ix.org/movies/sintel-2048-surround.mp4 \
 
-pix_fmt gray -f rawvideo -vf pad=800:600:0:75 -s 800x450 -|./raw2gmv|nc -l 5555 
And here is a command to play a file from the host pc at full 800x600 resolution:
PHP Code:
ffmpeg -i SundayPicnic.mp4 -pix_fmt gray -f rawvideo -s 800x600 -|./raw2gmv|nc -l 5555 
Here is how I play those video streams on my kindle, after starting them on the PC:
PHP Code:
nc 192.168.15.201 5555|./gmplay 
UPDATE: I compiled this with gcc and again with arm-linux-gcc, so I can run it on either side of the network connection (host PC or kindle). It also works fine when compiled with tcc.

HINT: To pipe the output to a file (before or after transcoding) you need to add "-r 7.7" to the ffmpeg command line. When the kindle display is at the end of the chain (even over the USBnet using nc) ffmpeg automatically adapts to 7.7 Hz framerate (the max that a K3 can do). Such a low framerate makes for better compression and works amazingly (and surprisingly) well on eink. You could never go that slow on a light-emitting display.

I plan to combine this new transcoder inside gmplay, adding command-line switches to select input (raw or transcoded) and output (transcoded or framebuffer). Piping data between a transcoder and player adds a LOT of overhead passing video between two processes piped on the command line. Combining them will save a lot of energy, especially when running from battery. Because both functions can run inside the nested loops together, the total lines of code will be a lot smaller. I like that...


The ffmpeg commands above were for linux ffmpeg installed with apt-get.

We can do this in Windows too. Here are some download links:
EDIT: There are reports that some versions of netcat (nc) on the host PC need a "-p" before the port number (nc -l -p 5555). The command without the "-p" works fine on my linux host PC, so YMMV.


Last edited by geekmaster; 07-11-2012 at 05:56 PM.
geekmaster is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 06:46 AM.


MobileRead.com is a privately owned, operated and funded community.