Requirement number 2 from my previous post was:
2. Videos in the folder /root/.bookmarks/bv/vid/ can easily be transferred to my portable video player (Philips PV7005/12)
I had to modify the script
cv.sh to make this work how I wanted it to.
The problem was that my microSD cards (16GB and 8GB) when formatted to FAT32 were very fussy about the file names.
Also the filenames I was using were only a timestamp and were not descriptive enough for my old media player which did not use playlists, only filenames.
So I did some work on the script to shorten the date and time stamp.
Old timestamp: YYYY-MM-DD_HH:MM:SS
New timestamp: yyMMDDHHMM
I then appended a variation of the video title with spaces replaced by underscores.
The filenames are now 'FAT32 friendly' and 'old media player friendly' with times and titles in the filenames.
Here is the modified bit of code, it is commented to show what is modified and where it goes.
Code: Select all
#!/bin/bash
timestamp() {
# 20160919 modification to timestamp to be more compatible with FAT32 filenames removed colons [:]
date +"%y%m%d%H%M"
}
# enter a title
title=$(echo $title | yad --mouse --width=1000 --title="Add Video Title" --entry --button="gtk-ok:0")
if [[ $title = "" ]]; then title=$(echo "no title"); fi
sleep 0.5
title1=$(echo $title | cut -c 1-64)
video_title=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g')
echo $video_title
# convert the VOB file to mp4
dialog=$(yad --on-top --mouse --title "Convert VOB file" --form --field="Paste address")
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
address=$(echo $dialog | awk 'BEGIN {FS="|" }{print $1}')
time=$(echo $(timestamp))
# 20160919 modification to filename to be more compatible with old FAT32 media players.
# Added bookmark title and removed [: and spaces] and appended to yyMMDDHHMM
file_title=$(echo $video_title | sed 's/ /_/g' | sed 's/:/_/g')
time=$time"_"$file_title
#same as original cv.sh from here onwards
sorttime=$(echo $((0-$(date +%s))))
mencoder "$address" -o "/root/.bookmarks/bv/vid/"$time".mp4" -ovc xvid -vf crop=706:440:0:80,scale=706:440 -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 | yad --width=900 --on-top --mouse --title "Converting . . . then please wait for save menu" --progress --pulsate --auto-close
sleep 0.5
On the computer and using the Pale Moon Bookmarking Script to launch mplayer . . .
For viewing with mplayer, depending on what video hardware and drivers you are using
it might be necessary to edit the mplayer config file to force full screen zooming.
One of my computers will toggle zoomed full screen with double click left mouse button, or by pressing the keyboard F button.
Another of my computers won't do it with the mouse, only with the F button
/root/.mplayer/config
Code: Select all
# Write your default config options here!
osdlevel=3
vo=x11
zoom=yes
I am now happily watching sub-titled foreign 'soaps' on my portable media player, which is a great way to learn a foreign language.
The files are on a 16GB microSD card.
I might buy a 32GB card to see whether that works.
Quick tip.
I formatted the microSD card with GParted to FAT32 in an SD card reader.
I put the card in the media player and waited for it to acknowledge insertion.
I then formatted the card using the media player settings formatting option.
I then plugged a USB lead from media player to PC and used pmount and Xfe file manager.
It is important to wait at each stage and to not rush as the media player has to connect and transfer info and data.
I hope this is useful.