mplayer resume ability fixed #480
Replies: 13 comments
-
There are still bugs with it:
|
Beta Was this translation helpful? Give feedback.
-
First bug fixed:
|
Beta Was this translation helpful? Give feedback.
-
Add a
That's where the |
Beta Was this translation helpful? Give feedback.
-
You're correct! 😃 The following code fixes both bugs:
|
Beta Was this translation helpful? Give feedback.
-
It can actually be simplified with:
Since we don't need to keep the resume file if the playback was not in progress and properly saved. |
Beta Was this translation helpful? Give feedback.
-
Hmm... 🤔 Wouldn't it be simpler and more reliable to simply
This would allow us to resume playback even if a clean shutdown didn't take place -- if the resume file is corrupted. |
Beta Was this translation helpful? Give feedback.
-
Here is a more forwards-compatible and better documented and optimised version of this script. One that doesn't continually write to the SD card as you're watching (prolonging your SD card's life):
It's set to save the resume state whenever you quit Mplayer (until you've reached the end of the video). Alternatively, if you want Mplayer to save the resume state on every single occasion (even when it force-quits or crashes) except when you've reached the end of the file (finished watching the video), then swap the SAVEVALID and SAVECOND values in this section, like so:
Mplayer is now able to resume playback even from a badly/differently formatted resume save (so long as the timestamps are there). |
Beta Was this translation helpful? Give feedback.
-
I've recently encoded a couple of movies for the PocketGo. I think that had to do with the constant writing to the |
Beta Was this translation helpful? Give feedback.
-
Could be -- the continuous writing to the SD card would also impose a throttle on the read-write (data transfer) speed of the card, and how much data can pass through at once. Also, use these settings when converting videos for Miyoo: Encoding: MPEG-4 See here for guidance/tips: #351 |
Beta Was this translation helpful? Give feedback.
-
For anyone using and testing this script (the latter one), I'd be interested to hear how it performs on lengthier videos, over 2 hours long. There is one potential drawback with this method, and that is that the resume state is being stored in the RAM until Mplayer exits, and that there's a limit to how much data can be stored in memory. I'm pretty certain it will hold up fine, but, nonetheless, I'd be interested to hear if anyone notices any issues with very long audios or videos. |
Beta Was this translation helpful? Give feedback.
-
Okay, I've just tested a 2 and a half hour long, 1.3 GB size film. These are my experiences/observations:
(Considering we're working with only 32 MB of RAM here as the only available system memory, that's not bad at all!) 50 minutes of watching a film produced about 3 MB of save data (which was successfully written to disk). Therefore watching a 2.5 hour long film, if the device can handle the whole thing in one session, will produce about 9 MB of save data in Mplayer (to be stored in memory and written to the disk).
If anyone has any other experiences, let me know. |
Beta Was this translation helpful? Give feedback.
-
Here's an update to the script to add audio file resume support as well (when there's no video to play):
Mplayer can now be used to listen to audiobooks as well (and save progress). |
Beta Was this translation helpful? Give feedback.
-
thank you - It seems to be working for me - very much appreciated |
Beta Was this translation helpful? Give feedback.
-
It does not only check if there is a
.resume
file, but also, if the file is valid.If it's invalid, it will play the video from the start, just as if there was none.
If the video is finished, and an invalid
.resume
file is produced, it will be deleted, just as if it was a legit(End of file)
.Explanation:
At the end of a video, the return value of
mplayer
isn't producing the expected output withExiting... (End of file)
as the last line.I tested it and it works as expected. You don't even have to delete any
.resume
files manually.edit
main/apps/mplayer/run.sh
on your sd-card to the followingEnjoy!
Beta Was this translation helpful? Give feedback.
All reactions