Transcoding audio and video

What is the best way to transcode audio and video for display on the Internet?

I need to do this programmatically. I would like to do something like YouTube or Google Video, where users can download any format they want and encode it to FLV, mp3 and / or mp4. I could do this on our server, but I would rather use an EC2 instance or even a web service. We have a Windows 2008 server.

+3
source share
8 answers

I highly recommend ffmpeg. On Windows, I found this site to host good binaries.

+2
source

, . ( ) , ffmpeg, , iprove, , (Rhozet, Inlet, Digital Rapids 3 ).

+3

ffmpeg , , libavcodec. . LPGL, . , libavcodec .

+2

Flv (, , ), :

ffmpeg -hq -y -i $directory/$file -r 20 -s 300x200 -deinterlace -ar 22050 $directory/$file.flv 1>/dev/null 2>/dev/null

, Linux, : -).

+2

, ffmpeg GPL. , libpostproc , , . , , .

+1

GPL:

, sox. ! ! Linux.

LAME mp3 [audio].

, mencoder ! mplayer. . , - . ( . 9. MEncoder 10. MEncoder.)

, . mpeg4, mpeg2, dvd-mpeg, flv . ( flv, google , .)

, jpeg + sound → mpeg4 movie:

nice +20 $MENCODER mf://${JPEGFILE}  -mf w=720:h=480:fps=1/${SOUNDLENGTH}:type=jpeg -audiofile ${SOUNDFILE} -ovc lavc -oac lavc -lavcopts vcodec=mpeg4 -ofps 30000/1001 -o ${MENU_MPG}

dvd- mpeg:

nice +20 $MENCODER -edl ${EDL} -ovc lavc -oac lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=${VBITRATE}:keyint=18:acodec=ac3:abitrate=192:aspect=4/3:trell:mbd=2:dia=4:cmp=3:precmp=3:ildctcmp=3:subcmp=3:mbcmp=3:cbp:mv0:dc=10 -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -ofps 30000/1001 -o ./${INFILE}.reformatted  ${FILEPATH}

-edl/-edlout [ ] , , .

${VBITRATE} 5000 DVD-MPEG-. , dvd. , .

scale = 720: 480, harddup - dvdplayer harddup "el cheapo".

( , 4x3, "aspect = 16/9", "-vf scale = 560: 480, expand = 720: 480, harddup". , .)

This is not the most effective set of mencoder options to date! This can take a long time. But I had other goals ...

+1
source

Rhozet Carbon Coder can handle a wide range of formats, plus you can use plugins to modify the video (for example, add a watermark)

0
source

Source: https://habr.com/ru/post/1696390/


All Articles