Programming :: Custom Progress Bar Of Video Conversion Script (FLV To XVID)
Aug 7, 2010
i have written a bash script to convert flv files (e.g. videos) to xvid to be played on my dvd player. the conversion is not really the issue, as it works. what i am dealing with now are 2 problems i have not found a good workarouond:
1. surpressing the shell output of mencoder completely ( i do not want to see all the mencoder messages). this i have only solved to a certain extend.
2. i want to create a progress bar. this one i have not yet cracked.
#start the script
main_menu
1. mencoder output: using /dev/null works more or less. for example: if mencoder detects a double frame while converting, a message is still printed on the bash screen
2. progressbar: i have no clue yet on how to do this. any link or tip is welcome.
my goal is something like this:
[56%] [time in progress] [timeleft]
I need a way to batch convert 720p video files from avc1 to xvid in Ubuntu 10.04. I'm not terribly concerned about file size, but I do wish to retain the picture quality as much as possible. I believe the audio is encoded as aac, which is fine for my purposes.
What would be the best and easiest way to do this? I've tried using Handbrake. During my first attempt, I had it using ffmpeg to convert to MPEG-4, but that just gave me a super-low quality video at twice the file size. Trying h.264 now, so we'll see how that works out. But just in case it doesn't pan out so well, what other ways do you recommend?
I was thinking I'd write a bash script to reencode the files one by one, but the problem is that I have very little knowledge about codecs and containers and whatnot - so I wouldn't know what parameters I would pass ffmpeg/mencoder.
I like this linux distribution more than the others that i have used, because is more stable for my work. But there are some little problems that I can't solve. I'm using it with a laptop HP G60 and i can run OpenOffice, Mozilla and some other programs (python, grass, qgis) that used for work at the office, but when I go home and want to watch a movie with my girl, listen some music or any other simple task, i find a lot of little problems:
1. Adjust the bright of the screen, the Power Management Guidance don't do it and I really need it.
2. Can't play movies in VLC "No suitable decoder module. VLC does not support the audio or video format XVID. Unfortunately there is no way for you to fix this"
3. And today I can't play music because there is a message "KDE detected that one or more internal sound devices were removed" this is: Output HDA Intel, INTEL HDMI 0 (HDMI Audio Output)
I know maybe these problems are stupid but in windows is easier to fix them. I'm tired of search in google because i just find solved problems for Ubuntu and it takes a lot of time.
I am running Debian 5.0.5 and want it to convert a video file after upload, then update in MySQL if possible? I have tryed ff-mpeg and yes I could convert to FLV but the Pixelation where very bad and and if I closed the browser it finished the conversion but didn't updated it in the database.
I have a full install on a dedicated partition. And the problem persists. I have tacked it down to the driver for my video card [nVidia 9600m GS]. When I disable the driver, it somewhat returns to normal [it works fine on shut down, but boot up is still buggy]. However, this makes Docky complain about compositing [it will still work, but there's a black void around it] not being enabled. I also assume that lacking the driver will cause problems if I try to do anything 3D.
I spent about a half hour wrestling with different website tutorials about how to convert a file with ffmpeg and figuring out how to get all the video quality options right. Then I discovered you can just use the -sameq option and it figures it all out for you if you don't want to change the vid quality but just want it in another format. Thought I'd leave this on the site in case anyone else finds himself in the same boat.
i am using ubuntu lucid now and using ubuntu for 2years now.except nokia pc-suite i do not miss other s/w for windows.i tried to convert audio and video for using in nokia 5800,but i am not very successful mainly due to my inexperience.i installed winff and ffmpeg and searched a bit in this forum.found a few guides but mostly the converted files shows 'unable to play video or audio' in nokia 5800.
Code: -r 29.97 -vcodec libxvid -vtag XVID -s 400x240 -aspect 16:9 -maxrate 1200k -b 1200k -qmin 3 -qmax 5 -bufsize 4096 -mbd 2 -bf 2 -flags +4mv -trellis -aic -cmp 2 -subcmp 2 -g 300 -acodec libmp3lame -ar 44100 -ab 160k -ac 2 -async1 this is the example of wiff preset command for nokian810(but not working for me).apparently there is no need for -i or output file(and here i get confused from the command lines posted in the forum.
After searching I cant find script that can deal with directories. All the found scripts work file to file and not directory to directory. Someone know script that can deal with all this situation?
Dear Advanced c/g++ on boost programers: I have copied and testd a simple (Copy a file with Boost) program from page 372, Example10-10, book(C++ cookbook)
entry->d_name is a 256 byte character array returned by readdir(), I would expect this line of code to convert that character array from ascii to a QString, but I get a seg fault and I'm not entirely sure why..
I would really like to capture the output of scp and my file's progress. Scp updates the transfer rate every 1 second, and I will like to save the transfer rate at every update. So for example, if the file transfer takes 30 seconds, I would like 30 reports of the transfer rate.
The output looks like: Code: file.dat 1% 3664KB 938.5KB/s 05:48
Whenever I try a simple redirect like: Code: scp file.dat 192.168.1.100:~/ &> output ... it does not save the rate at every update, it only shows the final rate.
If I try using typescript by starting "script" ... it's the same deal.
I've got a loop which is able to echo out how complete a process is after each loop (e.g says 25% if the loop has 4 elements and has run once through). Is there any way I can print characters, perhaps a progress bar? I was thinking of using the percentage as a count or something and using.
Code: I got told off for including code from work here.
I'm writing a script to automate rsync backups which so far is working great. I prefer to send output to a text file instead of watching it fly by but the blank output is slightly boring? I would love to use a progress bar. Not for each file but for overall progress. Something like
syncing /home directory 50% [++++++++]
I already know it's way over my head and maybe bash isn't even the right tool for the job.
I am busy writing this script to get a pixel count of a large batch of images in a directory for a research project. To do this I'm using a loop to get all the images in the directory. To make the whole procedure more user friendly for some colleagues I decided to use zenity, something I haven't yet really worked with. As not to make sure that the users don't have to watch to this blank screen during the actual processing of the images I'm trying to get the zenity progress bar working. So far the progress bar comes up but instead of changing over time it stays "empty" till all the images are processed and then becomes 100% when all images are done. What servers my needs for now, but since I am trying to learn more about zenity I was wondering how I could change the script to get the progress bar properly working? Below is the piece of script I am talking about.
Code: cd $input #goto path of image directory (for a in *jpg *JPG *jpeg *JPEG; do if [ -f "$a" ]; then #was it a image file b="$a" #set b to $a convert -resize 1000x1000! ${b} -depth 1 -format %c histogram:info:$b.txt #get pixelcount and write to .txt file fi done) | zenity --progress
I am writing a code to restore original packet type from encapsulated packet type. However the following error occurred. Below is an extract of my code. Would appreciate if someone could help me explain why the error occurred and how to resolve this.
packet.h struct hdr_cmn { packet_t ptype_; // packet type
I am attempting to "export" the progress bar from wget display using sed. Basically, we have an app that starts wget to download a large file and we want to show a progress bar. Our application has a dbus interface to receive the download progress.
So we were think of a command like: wget [] | sed [] | dbus-send[] The problem at the moment is, how do you get the matched string out of sed and into dbus-send? I can get the progress string by: sed -u 's/[0-9]*%/&/'
This populated '&' with the correct percentage, but I cannot seem to get this out of sed.
I've just updated my linux system (Debian) and went to compile some code I'm working on. However it causes some problems, presumable because of GCC up dates. I get many of my subject line errors for example
../../common/Version_Control.cpp: In function int VersionControl(): ../../common/Version_Control.cpp:55: warning: deprecated conversion from string constant to char*
So I check up the error and it comes from my error handler code which is a function
I am looking for a Ubuntu program with a graphical environmet that can convert different video formats into others, for example mp4 to avi, mkv to avi, and so on.I would also need to insert subtitles (srt files) in to avi files, to reproduce them in PS3.
I was trying to write a graph plotting program with c++. I need to convert the infix expression from user to postfix expression for quick evaluation. However, the evaluation of postfix is kind of interpreted, and thus kind of slow for evaluating huge number of values. Say if I plot an implicit function the penalty is quite huge. Is there a way that I can compile the infix expression from my running graph plotting application for high speed evaluation.
I have a very basic program which I wrote, to print the integer equivalents of an ASCII character. The code is below:
Code:
#include<stdio.h> int main(void) { char c;
[code]....
The code is supposed to take a character as input and print the integer equivalent of that character. But the problem is that, after printing the integer equivalent, it prints an extra '10', every time.
Code:
f 102 10
[code].....
Why does this extra '10' always come? When the code is just a simple:
Code:
#include<stdio.h> int main(void) {
[code]....
The code works just fine. There is no extra '10' displayed. I am using Ubuntu 9.10 with gcc-4.4.1.
Line 43 points at the snprintf() command.I think the error has to do with the function being virtual and the const after the function definition, however although I have been looking really hard I have not being able to find the reason nor the solution to the problem.
One workaround that I know is moving the block of source withing the virtual function, in the constructor, however having read around (boost library exceptions tutorials) it specifically said that formating of errors messages should not take place withing the construction of objects because we are risking throwing an exceptions and messing up the flow order.
I've been researching this for awhile now and cannot find anything that works. I'm trying to watch videos in a browser, either Chrome or Firefox, that are encoded with Xvid. Nothing has worked, and when I try to watch an Xvid video I get the following error:
"We're sorry, our content is not compatible with your computer configuration."
I've installed vlc, libxvidcore4, gecko-mediaplayer, ubuntu-restricted-extras, and numerous other libraries, none of which do anything.