寄托天下
查看: 2555|回复: 2
打印 上一主题 下一主题

[study] stripping audios from video clips under linux [复制链接]

Rank: 2

声望
0
寄托币
68
注册时间
2006-3-3
精华
0
帖子
0
跳转到指定楼层
楼主
发表于 2006-5-11 09:07:23 |只看该作者 |倒序浏览
I saw many people interested in the mp3 of "friends".
Here is the method I use to save audio stream of video clips(like friends, west wing, etc) under linux. It requires the newest version of  mplayer(the media player of linux), and lame(the mp3 encoder).
The following bash script will strip the sound of video clips stored in INPUT_DIR, pass them via a "pipe"  to "lame", who will re-encode them back into mp3, and store them in OUTPUT_DIR.

#!/bin/sh
# Be sure to change the following dir name to reflect the situation of ur system!!!

INPUT_DIR=/mnt/usbhd/emule_temp/incoming/clips
OUTPUT_DIR=/mnt/e/mp3/tmp
PIPE_NAME=/media/disk/amule_temp/incoming/test
BIT_RATE=64

#create the named pipe
mknod -m 666 $PIPE_NAME  p

#re-encoding the audio stream
for i in $INPUT_DIR/*;do
   echo $i;
   j=`basename $i '.rmvb'`;
   if ! [ -f "$OUTPUT_DIR/$j.$BIT_RATE.mp3" ]; then
       echo "recording $OUTPUT_DIR/$j.$BIT_RATE.mp3...";
       mplayer -vo null -vc dummy -ao pcm:file="$PIPE_NAME" $i > mlog.txt &
       lame -b $BIT_RATE "$PIPE_NAME" "$OUTPUT_DIR/$j.$BIT_RATE.mp3" &
       wait;
   else
       echo "$OUTPUT_DIR/$j.$BIT_RATE.mp3 already exist, skip";
   fi
done

[ 本帖最后由 hexiang129 于 2006-5-11 09:19 编辑 ]
0 0

使用道具 举报

Rank: 16Rank: 16Rank: 16Rank: 16

声望
19
寄托币
49553
注册时间
2003-6-1
精华
40
帖子
59

Scorpio天蝎座 荣誉版主

沙发
发表于 2006-5-12 02:26:18 |只看该作者
thanks for sharing, no idea though.
重返寄托

三十而立 战战兢兢
如临深渊 如履薄冰

使用道具 举报

Rank: 2

声望
0
寄托币
68
注册时间
2006-3-3
精华
0
帖子
0
板凳
发表于 2006-5-12 09:20:12 |只看该作者

回复 #2 davidjacky 的帖子

Never mind. This is the best method i know so far for this purpose. It deals with all formats, consumes no additional disk space, and takes <20min to re-encode an 1hr long episode.
I guess this bash script  is most convenient for linux users. For other uses, I still have to say sorry. I tried it under windows, but with no luck.

使用道具 举报

RE: stripping audios from video clips under linux [修改]
您需要登录后才可以回帖 登录 | 立即注册

问答
Offer
投票
面经
最新
精华
转发
转发该帖子
stripping audios from video clips under linux
https://bbs.gter.net/thread-461265-1-1.html
复制链接
发送
回顶部