ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I created a script that converts a youtube flash video to an mp3 then adds fake stereo sound and moves it into my mp3 folder. It creates the mp3 from the .flv ok but I think it is getting hung up after that.
Code:
#!/bin/bash
echo "Please type in name of file"
read NAME
sudo cp /tmp/Flash* /home/$USER/mp3/$NAME.flv
cd /home/$USER/mp3
sudo chown $USER:$GROUP $NAME.flv
ffmpeg -i $NAME.flv $NAME.mp3
sudo ecasound -i $NAME.mp3 -etf:8 -o /home/$USER/$NAME.mp3
cd /home/$USER
sudo chown $USER:$GROUP $NAME.mp3
sudo mv /home/$USER/$NAME.mp3 /media/Space/JasonC/My_Shared_Folder21
cd /home/$USER/mp3
rm *.*
I am also having a permissions problem with my external hard drive (media/Space) so that could be a part of it.
Looks wierd, you should only need sudo for doing 'root' type things (occasionally).
What you are trying to do should not need that.
Please post your /etc/fstab and /etc/mtab files.
Well, it sounds like you downloaded that file as root, not a good idea.
If you downloaded it as yourself, it should work.
If not, maybe it is the disk/mount perms, but it's a while since I knew that stuff. Maybe someone else can help or you can google it (fstab permissions vfat).
You could have a prob that vfat doesn't understand Unix perms, prob need to mount it rw for the world or as your own uid/gid.
Never mind, I found the problem. The line where it saves it to my shared folder. I accidentally renamed that folder and it had an erroneous space in the name. I could kick myself.
This script could easily convert to mp4 because it usees FFMPEG. See the ffmpeg man (http://swoolley.org/man.cgi/1/ffmpeg) it might just require setting the output filename to *.mp4 (ffmpeg is rather slick like that) or require setting the output muxer to mp4 and audio codec to mp4a.
What is more irritating/difficult is getting it to recognize the input bitrate and leave it unchanged or detect it properly without using vbr/abr. FFMPEG isn't reliable to scrape output from (wasn't created for this) and libavcodec is rather undocumented and hard to use.
From some examples I've seen, it should be relatively easy to convert to mp4. I'm having a problem with my ffmpeg though. for some reason when I compile with mp4 support it still doesn't recognoxe it. I get this error:
I've had this error at as well, although I'm using the ffmpeg in the ubuntu repos. You may wish to try -acodec to force the codec and you can also force the fourcc code (which I heard may be the cause of that error). Mencoder does a good job too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.