07-11-2012, 12:31 PM | #121 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
For max decode speed and minimum code, I still want 600x800 pre-dithered video, and let zcat to the decompression. |
|
07-11-2012, 12:38 PM | #122 |
( ͡° ͜ʖ ͡°){ʇ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
|
information encoding
I was trying to figure out the total data load for each frame.
it's bugger all compared to the video. I think just sandwiching it on for a quickie test now wouldn't hurt as POC. Then tidy it up once it's proven to work. Your thoughts? If I'm honest I'm rather struggling to visualise how to manually get the file I need to get cracking decoding/streaming it. I guess its going to be in the ffmeg stuff perhaps. I'll try to find something to encode not sure I'll have much in the way of video. donations gratefully accepted. Perhaps I can grab an open license one from somewhere. not my area of expertise I'm afraid. |
Advert | |
|
07-11-2012, 12:44 PM | #123 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I think I pubished raw2gmv awhile back. Here: https://www.mobileread.com/forums/sho....php?p=2074379 You would need to interleave audio in raw2gmv (perhaps stdin plus a name pipe in). Then deinterleave in gmplay. Or, perhaps use two named pipes (/tmp/gmv and /tmp/gma) for raw2gmv input? I think ffmpeg can output to named pipes. Last edited by geekmaster; 07-11-2012 at 01:29 PM. Reason: fixed bad URL |
|
07-11-2012, 12:48 PM | #124 | |
( ͡° ͜ʖ ͡°){ʇ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:
I want a single file that I will process with a single piece of code, incorporating your video code and the sound code. It can be made portable after I get it working on the slowest device, which I would suggest is the device to start on anyways. hardest first and all. |
|
07-11-2012, 12:52 PM | #125 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
BTW, I have a parallel dithering algorithm now that does 32-bits (4-pixels) per operation. The ARM processors prefer 32-bit ops. I have not finished coding it, but on paper it looks good. Last edited by geekmaster; 07-11-2012 at 12:55 PM. |
|
Advert | |
|
07-11-2012, 01:02 PM | #126 | |
( ͡° ͜ʖ ͡°){ʇ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:
Well. any pointers to getting the file out of ffmpeg gratefully accepted, I'm reading the man page... monolithic, yes. Single c file. I'll play with obfuscated "call" compression later, ALSA is wordy and there is not much avoiding it but I've seen a few nice shorthand examples that I may be able to weld - ahem - glue - into the final result. |
|
07-11-2012, 01:07 PM | #127 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Crap. I have tons of copy/paste problems in my VM. That link is self-referential. Now I have to search again. A few posts before the raw2gmv download it shows ffmpeg commands to get video raw out of it pipe to raw2gmv...
Okay, here is my video transcoder sub-thread: https://www.mobileread.com/forums/sho....php?p=2074379 EDIT: Also fixed in the previous post, but not in twobob's quoted copy of the old post. Last edited by geekmaster; 07-11-2012 at 01:31 PM. |
07-11-2012, 01:18 PM | #128 | ||
( ͡° ͜ʖ ͡°){ʇ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:
Except I was thinking cant raw to GMV be adjusted to also encode the audio info into the frames? And to reiterate, for future reference you can assume I have read all your posts on this subject, probably 4 times now. So I'm thinking Quote:
-pix_fmt gray -someAudioFlags? -f rawvideo? -vf pad=800:600:0:75 -s 800x450 -|./raw2gmvWithAudio > SomeResultingHelpfulFile.gmv Am I on the right lines? |
||
07-11-2012, 01:22 PM | #129 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
To do simultaneous dither and render, look at the animation demos. I split them apart here so I could post a tiny video player that did not contain the transcoder, in the tradition of linux tools that you just pipe together into a long one-liner.
My algorithms keep evolving in small increments, each time I post a new demo. The "no dither table" algorithm was my original creation, using logic tools including Karnaugh maps and DeMorgan's theorem (usually used for digital logic hardware simplification). It was an evolutionary step beyond my "formula 42" dithering that supported all kindle models in that formula. The key idea was to make it cache-friendly by elimination of conditional branching logic that can flush the cache, and later to avoid small cache flushes caused by RAM-resident table lookups. The latest branch-free formula also contains contrast and brightness adjustments. In the future it will do all that, and do 4-pixels per operation at no extra cost (and perhaps some savings making it more than 4 times faster). Last edited by geekmaster; 07-11-2012 at 02:31 PM. Reason: fix typo: Carnaugh -> Karnaugh |
07-11-2012, 01:28 PM | #130 |
( ͡° ͜ʖ ͡°){ʇ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
|
pipes are bad mmmkay
Piping introduces an unknown overhead though doesn't it?
I thought the pipe stream needed to be handled in some way internally that put about a .4 second delay in each section using a pipe. (Which, while fine for many purposes, isn't the kind of thing I like to think about when doing audio. All the more reason to use audio striped into the datastream.) I am probably entirely wrong. I often am. Anyway, I'm digging. Thanks. |
07-11-2012, 01:33 PM | #131 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Piping is bad because multiprocessing has a relatively large overhead. That is why I am a fan of Simon Tatham's (brain damaging) coroutines, that are evolved from Duff's Device (which I also use a lot). Of course, assembler language stack swaps are better than coroutines, but not portable.
The piping is handy for initial testing (small evolutionary changes to existing code). Once it works, it can be refactored into a monolithic loop (perhaps using a state-machine if it gets too complicated). For monolithic loops that contain subfunctions that need to be performed at different rates, I use a DDA (digital differential algorithm) to do rate conversion to decide when to fire various periodic events. For really slow primitive processors with tiny RAM but big ROM, I do all my timing with a huge jump table, and interleave all my periodic events evenly through it (dithered to prevent too many events firing on the same clock interrupt). I also do deferred non-maskable interrupt processing after saving the critical measurement. You know -- how to squeeze jaw-dropping performance out of tiny resources. Last edited by geekmaster; 07-11-2012 at 01:40 PM. |
07-11-2012, 01:35 PM | #132 | |
( ͡° ͜ʖ ͡°){ʇ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:
I do have a very fantastic audio book on its way to throw some fancy maths at and I have more than my fair share of experience in hacking working system together once I have the files. I'm just struggling to visualise exactly the right settings in ffmpeg. Ah well I'm playing now, Ill figure it out I too aim to evolve the demos to be more robust and informative and the audio thread to contain at least enough data to get most audio requiring apps off the ground. It's really not that much info out there at the moment in terms of great demos. I have trawled google into the floor trying to find further implementations or polling for alsa. Frankly I'm happy to rub shoulders with giants on this one. It's a bit of an arcane art and the calls are all low level stuff but I find that comforting since it will probably result in a few neat ways to do the basic stuff we want and then the rest can be ignored. rather than some unwieldy do-it-all setup system that can not be circumnavigated. ffmpeg here I come. |
|
07-11-2012, 01:49 PM | #133 |
( ͡° ͜ʖ ͡°){ʇ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
|
Okay I have my output.raw from ffmpeg.
Next up the wav output I guess. EDIT: FOR THE FUTURE READER I am reading here: http://ffmpeg.org/ffmpeg.html Okay so this looks pretty promising: ‘-attach filename (output)’ Add an attachment to the output file. This is supported by a few formats like Matroska for e.g. fonts used in rendering subtitles. Attachments are implemented as a specific type of stream, so this option will add a new stream to the file. It is then possible to use per-stream options on this stream in the usual way. Attachment streams created with this option will be created after all the other streams (i.e. those created with -map or automatic mappings). ffmpeg -i INPUT -attach Mystuff.wav Am I right in thinking I could weld - err - glue the audio like this? Just a thought, or maybe i'll just cross encode them by hand in the absence of other routes. So as to not go too OT I will shift the remainder of this dialog to: https://www.mobileread.com/forums/sho...=183528&page=7 Thanks Last edited by twobob; 07-11-2012 at 01:59 PM. Reason: added future refs + possible route |
07-11-2012, 02:06 PM | #134 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Just for reference, I posted this in the other thread:
Code:
#!/bin/sh ./ffmpeg -d -i $1 -an -pix_fmt gray -sws_flags neighbor -f rawvideo -s 800x600 -|./raw2gmv|./gmplay & ./ffmpeg -d -i $1 -vn -f s16le -acodec pcm_s16le -ar 44100 -|aplay -f cd |
07-11-2012, 02:08 PM | #135 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
|
|
|
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 |