script to play video file as needed
hi ,
I have slitaz 3.0 Here mplayer does not support xv video output (must be due to needs of my xfx card ). Anyway I can play using x11 but here scaling ain't available i.e pressing 'f' does not expand video to cover the whole screen. I have an idea as follows I will run 'my-play filename' my-play is a script like Code:
ffmpeg -i <input-to-my-play> |
I was able to redirect the standard error output like this,
by specifying /dev/null as the output file for the conversation. Code:
ffmpeg -i MVI_0286.AVI /dev/null 2>out.stderr Code:
fgrep -i Stream out.stderr | fgrep Video Code:
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p, 320x240, 15 tbr, 15 tbn, 15 tbc |
I thought . No one will reply .
I made a ragtag script which does my work Here it is You can suggest improvements (my questions are in blue below) Code:
echo i have to process following file : $1 |
Now I would like to add more features like
Code:
$# to see number of arguments For this I have thought (assuming I have just srt no .sub or any other format) Code:
ls -1 *srt > ~/list.txt I was using ffmpeg because it is more widespread . ffprobe would have been alright , too . Anyway I am past that . Thanks for suggestion . now , I need help for adding more features to script as mentioned above . Please suggest me how to do that ? |
You could use ffprobe or MediaInfo to supply the size information. Also look at ffplay which has a -s XxY option.
|
I don't know about bash scripting
Actually I intend to do following Code:
result=$(ls -1 *srt | wc -l) As you must have seen , I know little C programming . I need help in doing above abstract method using bash scripting |
Finally , I wrote the script as follows
Code:
$ cat /usr/bin/sumplay This has black band at bottom for subtitles too. |
I wanted to do the same in windows but unfortunately the filename passes to executable is in 8.3 format .So without full name of file cannot do.
|
Got some breakthrough .
The full file name can be found out using dir /b "<shortname>" I have tried this in command.com & cmd.exe . There , it worked . In my C program it does not . I don't know why ? Code:
#include<stdio.h> If you can compile this into executable then you can try <executable> C:\PROGRA~1 You will get log in c:\log.txt & c:\dirlog.txt |
Turns out I was using old borland c++ compiler version 3.0
I downloaded bcc 5.5 for free Here is the source C program which when compiled gives an executable which can be added to registry key My computer\HKCR\*\shell\autosub\command . Assign default with c:\autosub.exe "%1" Now I right click on any file & select autosub to play it with detected similiar srt file. Code:
#include<stdio.h> |
Can't you just use the -zoom mplayer option when using -vo x11? It should scale the video when in fullscreen mode without the need to specify the parameters of a scale filter.
Why can't you use xv? |
I tried it . It does not scale the image but just surrounds video on original resolution with black band. Slitaz is a tiny distro , it did not had drivers for my xfx card.
This thread started as need for slitaz & expanded to autodetecting subtitle file alongwith doing same on windows. I digressed . |
Quote:
|
to 414N
You were write the first time with x11 video output & zoom option pressing f gets full screen scaling . Now I realize. Thank You. I have fairly recent mplayer (from packages dvd of my slitaz) Code:
MPlayer SVN-r30817-4.4.1 (C) 2000-2010 MPlayer Team Anyway , the binary does not play webm rest formats (eg. mkv,3gp,flv,mp4,avi) are fine. I wish there was a portable binary of mplayer with dependent libraries etc. extracted in same folder. In windows I use kovensky build which is just a single file with everything present in it. |
You could always cook a slitaz package using tazwok.
First install slitaz-toolchain: Code:
tazpkg get-install slitaz-toolchain Code:
hg clone http://hg.slitaz.org/wok/ /home/slitaz/wok You should now be able to cook mplayer 1.1 with Code:
tazwok cook mplayer Code:
tar xf [...] |
All times are GMT -5. The time now is 07:01 PM. |