LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-04-2008, 08:00 PM   #1
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Rep: Reputation: 30
Help with youtube script


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.
 
Old 03-04-2008, 11:55 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.
 
Old 03-05-2008, 07:53 AM   #3
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
It won't work without the sudo's. Maybe I'll go back and change permissions for the command or something.


Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=6d2fa9c7-7cfc-462d-b3fb-129b40212975 /               ext3    defaults,errors=remount-ro 0       1
# /dev/sda5
UUID=8fb93399-287d-468e-babb-7808433d2447 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0

/dev/sdb3 /media/Games vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
/dev/sdb4 /media/disk vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
/dev/sdb2 /media/Windows vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
/dev/sdb1 /media/Space vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
Code:
Mtab
/dev/sda1 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.22-14-generic/volatile tmpfs rw 0 0
/dev/sdb3 /media/Games vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
/dev/sdb4 /media/disk vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
/dev/sdb2 /media/Windows vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
/dev/sdb1 /media/Space vfat rw,nosuid,nodev,shortname=mixed,uid=1000,gid=1000,utf8,umask=077,usefree 0 0
securityfs /sys/kernel/security securityfs rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
 
Old 03-05-2008, 07:49 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.
 
Old 03-06-2008, 03:04 PM   #5
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
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.
 
Old 03-07-2008, 01:28 AM   #6
Bobzilla2639716495
Member
 
Registered: Nov 2007
Posts: 60

Rep: Reputation: 15
you think that you could set this up to create wav or mp4?
 
Old 03-07-2008, 10:42 AM   #7
nullmind
LQ Newbie
 
Registered: Mar 2008
Posts: 9

Rep: Reputation: 0
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.

Cheers,
Kris
 
Old 03-07-2008, 02:07 PM   #8
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
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:
Code:
 Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.92 (359/12)
Input #0, flv, from 'flash.flv':
  Duration: 00:03:47.9, start: 0.000000, bitrate: 8 kb/s
    Stream #0.0: Video: flv, yuv420p, 320x240, 29.92 tb(r)
    Stream #0.1: Audio: mp3, 22050 Hz, mono, 8 kb/s
File 'new.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'new.mp4':
    Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 200 kb/s, 29.92 tb(c)
    Stream #0.1: Audio: 0x0000, 22050 Hz, mono, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Unsupported codec for output stream #0.1
I don't know how to fix that.
 
Old 03-07-2008, 11:58 PM   #9
nullmind
LQ Newbie
 
Registered: Mar 2008
Posts: 9

Rep: Reputation: 0
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.

Cheers,
Kris
 
Old 03-09-2008, 10:43 PM   #10
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
I'll try the force codec option. Do you know the command you would use for the mencoder option?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
youtube problem manolakis Debian 11 12-29-2007 03:28 PM
Kubuntu And Youtube Chronothread Linux - Software 3 12-09-2007 08:13 PM
youtube downloader talpa_sai Linux - Newbie 2 06-06-2007 07:13 AM
Youtube.com = no sound Micro420 Ubuntu 6 07-21-2006 12:53 AM
no volume in youtube? lilili Linux - Newbie 6 07-20-2006 09:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration