1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Sunday, October 25, 2009

Batch Convert FLV to MP3

Four Loves Four: Batch Convert FLV to MP3

Many times on youtube I find concert videos or acoustic shows that I want to keep for later. Using the Firefox plugin VideoDownloader, I can download these videos as flv files but these flv's are not as portable as mp3. So I searched for a way to convert flv to mp3 and found help on the Ubuntu forums.

After looking at the script and looking at my flv files, I noticed that it would be very inefficient to do each file individually. Therefore, I modified the script to convert a whole folder of flv's. I will show the whole script itself and how to run it, but first lets install some programs that we need in order to convert the flv's.
sudo apt-get install ecasound mpg123 lame ffmpeg
The script itself is the following:
#!/bin/bash
# FLV to MP3
#flv2mp3.sh

FLV_FILE=/home/ditto/Videos/
cd $FLV_FILE

for vid in *.flv
do
ffmpeg -i $vid -f mp3 -vn -acodec copy /tmp/temp.mp3
ecasound -i /tmp/temp.mp3 -etf:8 -o ${vid/.flv}.mp3
rm -f /tmp/temp.mp3
done

exit 0
I save my scripts in a ~/scripts and don't forget to make the script executable.
chmod u+x flv2mp3.sh
Run as follows:
user@home:/scripts~$ ./flv2mp3
Let's take a closer look at the code.
FLV_FILE=/home/ditto/Videos/
cd $FLV_FILE
FLV_FILE is the location of the flv video files that we want to be converted. In the next line, the directory is changed to the location of the videos.

Next, we will look through the files in that directory, only using the .flv files. Notice:
for vid in *.flv
Next we will convert the video to mono audio and create a temporary mp3 called temp.mp3
ffmpeg -i $vid -f mp3 -vn -acodec copy /tmp/temp.mp3
Since the audio by default is mono, we will then convert it to stereo, output it into the current directory, and save it as an mp3, while keeping the basename. The file is renamed by ${vid/.flv}.mp3
ecasound -i /tmp/temp.mp3 -etf:8 -o ${vid/.flv}.mp3
rm -f /tmp/temp.mp3
That is pretty much it. Any comments or ways to make it better, please let me know.

Download YouTube Videos on Linux and Convert FLV to MPG Movies and rip MP3 Audio

Download YouTube Videos on Linux and Convert FLV to MPG Movies and rip MP3 Audio | Webmaster Tips

This tutorial shows how to bulk download YouTube videos on Linux and then convert the FLV files to MPG video and MP3 audio files.

Required Software

I am using Ubuntu Linux, but the concept should be the same for other distros. Make sure you already have all of the multimedia codecs including ffmpeg and mplayer. You will also need to install youtube-dl:

sudo apt-get install youtube-dl

Downloading YouTube Videos on Linux

To download YouTube videos on Linux, use youtube-dl in the terminal like this:

youtube-dl [options] video_url

To see available options type man youtube-dl in a terminal.

Converting YouTube Videos to MPG on Linux

To convert YouTube movies from FLV to MPG on Linux use ffmpeg like this in the terminal:

ffmpeg -i old-file.flv new-file.mpg

Ripping MP3s from YouTube Videos on Linux

It is easy to extract MP3 audio from a YouTube movie on Linux with mplayer.

The method to rip MP3 audio from FLV files with ffmpeg from this site doesn't work on my computer so I use mplayer to do it:

mplayer -dumpaudio old-file.flv -dumpfile new-file.mp3

Automating the Process with a Shell Script

If you want to download a set of YouTube movies and convert them to MP3 audio, or save them as MPG movies on your hard drive, you can automate the process with a shell script.

This is just a quick script showing how it might be done. Use the following code at your own risk, and make sure you understand what it does before doing it. It will delete all the FLV files in the current directory after it processes them.

#!/bin/sh  # This script downloads YouTube videos and converts them # You will end up with an MPG video and MP3 audio of each YouTube movie # You need to install the following three programs: # youtube_dl, ffmpeg, and mplayer  # Use this script at your own risk! # Make sure that you understand how it works before you use it!  # USAGE: # Make a file called videos.txt with the URL of 1 YouTube video on each line. # Don't leave any blank lines in the file # Put the videos.txt file in an empty folder along with this script # run this script with the following commands: # $ ./youtube_downloader.sh # It will take a long time to run, depending on # how many videos you have in your videos.txt file.  while read inputline do   youtube_url="$(echo $inputline)"   youtube-dl $youtube_url done < videos.txt  # Convert the flv files to mpg and mp3 files for i in *.flv do   ffmpeg -i $i $i.mpg   # comment out the next line if you don't want MP3's extracted   mplayer -dumpaudio $i -dumpfile $i.mp3   # The next line deletes all FLV files in the current directory to cleanup   rm $i done 

See also pytube...

Attachment
youtube_downloader.sh.txt

Convert .flv (Google Videos) to .mpg using ffmpeg on Ubuntu

Convert .flv (Google Videos) to .mpg using ffmpeg | Ubuntu Geek

Install ffmpeg Ubuntu

sudo apt-get install ffmpeg

convert .flv to .mpg using ffmpeg

First you need to download your .flv file to a folder and you need to Open a terminal window and go in to the .flv file folder and type the following command

ffmpeg -i jokes.flv jokes.mpg

or:

ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpg

jokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jokes.mpg whatever you want as long as it has the .mpg extension.

-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)

-ab bitrate: set the audio bitrate in kbit/s (default = 64)

-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)

-s size: set frame size. The format is WxH (default 160×128 )

支持UCenter的PHP建站程序一览

支持UCenter的PHP建站程序一览-月光博客

  建站程序是站长运营网站的根本,如何结合整合各个不同系统的程序、数据表、架构,提供统一的网站会员系统,一直是困扰很多站长的问题,而使用UCenter可以较为简单的实现不同系统之间的整合问题。

  UCenter是康盛创想推出的免费开源的建站工具,是各个建站产品之间信息直接传递的一个工具,康盛的Team在其Discuz论坛上收集了一批官方支持UCenter的建站产品,以对其进行双向推广,这里我对这个列表进行一些补充,添加一些最新的官方和非官方的支持UCenter的产品。

  支持 UCenter 建站程序一览表

  一、Discuz!

  http://www.comsenz.com/products/discuz
  论坛(BBS)程序站长应用率第一,php,开源,70万以上用户
  康盛创想官方支持UCenter产品,官方Discuz!论坛基础之上推出的UCenter产品
  历史版本 Discuz! 6.1.0
  当前版本 Discuz! 7.0.0

  二、UCenter Home

  http://www.comsenz.com/products/uchome
  国内SNS(社交网络)建站程序站长应用率第一,php,开源,5万以上用户
  康盛创想官方支持UCenter产品
  历史版本 UCenter Home 1.0.0 UCenter Home 1.2.0 UCenter Home 1.5.0
  当前版本 UCenter Home 2.0.0

  三、SupeSite

  http://www.comsenz.com/products/supesite
  网络社区站长常用的CMS产品,php,依托康盛创想社区产品开发
  康盛创想官方支持UCenter产品。
  历史版本 SupeSite 6.0.0_UC
  当前版本 SupeSite 7.0.0

  四、帝国CMS(ecms)

  http://www.phome.net 
  php型CMS程序站长应用目前支持率较高,php,2009年12月8日开源。
  官方支持UCenter
  历史版本 帝国 eCMS 5.1
  当前版本 帝国 eCMS V6.0测试版

  五、PHPcms
  
  http://www.phpcms.cn
  php型CMS程序中小门型应用目前支持率较高,php,开源产品。
  官方支持UCenter
  历史版本 PHPcms 2008 正式版
  当前版本 PHPcms 2008 SP1 正式版

  六、HDwiki 
  
  http://kaiyuan.hudong.com
  国内Wiki程序应用率第一,php,开源
  官方支持UCenter
  历史版本 HDWiki 3.0.0 HDWiki 4.0.0 HDWiki 4.0.2
  当前版本 HDWiki 4.0.5 正式版

  七、PBdigg
  
  http://www.pbdigg.com
  Digg类CMS,php
  官方支持UCenter
  当前版本 PBdigg 2.0

  八、爱聚合
  
  http://www.aijuhe.net
  国内独创的聚合型CMS,php,根据关键词自动聚合资讯、话题、图片和视频4大类内容
  官方支持UCenter
  历史版本 爱聚合 AiJuhe 4.0.0 AiJuhe V5.0
  当前版本 爱聚合 中文版 AiJuhe V6.0

  九、Modoer
  
  http://www.modoer.com
  点评功能CMS,php
  官方支持UCenter
  历史版本 Modoer 1.1
  当前版本 Modoer v1.2 正式版

  十、Feedig
  
  http://www.feedig.com
  feed类博客聚合CMS,php,主要针对UCenter home开发版本
  官方支持 UCenter
  当前版本 Feedig for Ucenter Home

  十一、ECShop
  
  http://www.ecshop.com
  商城类(B2C)建站程序,php
  官方支持 UCenter
  当前版本 ECShop 2.6.1

  十二、ECMall
  
  http://ecmall.shopex.cn
  商城类(C2C)建站程序,php
  官方支持UCenter
  当前版本 ECMall 1.1 final

  十三、SupeV
  
  http://union.ku6.com
  影视CMS,php
  官方支持UCenter
  当前版本 SupeV 1.01

  十四、落伍分类信息(ebcms)
  
  http://www.php.com.cn
  分类信息CMS,php
  官方支持UCenter
  历史版本 ebcms 1.0
  当前版本 落伍php分类v2.0 beta版本

  十五、 织梦CMS(DedeCms)
  
  http://www.dedecms.com
  php型CMS程序中小门型应用目前支持率较高,php,开源。
  官方支持UCenter
  历史版本 DedeCms 5.3
  当前版本 DedeCms 5.5

  十六、赛问(cyask)
  
  http://www.cyask.com
  php的问答类应用,类似百度知道,开源。
  官方支持UCenter
  当前版本 Cyask3.2
  
  十七、PHPsay

  http://www.phpsay.com
  基于PHP+MYSQL架构的WEB2.0开源家族贴吧系统,类似百度贴吧。
  支持UCenter
  当前版本 PhpSay 2.0.6

  十八、Mediawiki 1.13.2
  
  http://www.mediawiki.org
  Mediawiki 1.13.2+UCenter GBK整合精简版
  整合方案:http://www.discuz.net/thread-1077748-1-2.html

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...