[FFmpeg-user] 回复: questions about audio filter "atempo"

韩瑞松 550399108 at qq.com
Wed Jul 18 08:11:57 CEST 2012


Thank you ,Pavel :
      I tried the video filter "setpts" like this:
ffmpeg -y -i youku.mp4 -analyzeduration 2G -vcodec libx264 -b 512k -r 25 -s 576x312 -aspect 576:312 -psnr -acodec libfaac -ab 64k -ar 44100 -ac 2 -vf setpts=0.5*PTS -af atempo=2 -f flv -map_chapters -1 -g 50 youku.mp4.flv


It's output:


ffmpeg version git-2012-07-18-56ae592 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 18 2012 11:12:33 with gcc 4.4.3
  configuration: --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvorbis --enable-libtheora --enable-shared --enable-ffplay --enable-libxvid --enable-libvpx
  libavutil      51. 65.100 / 51. 65.100
  libavcodec     54. 41.100 / 54. 41.100
  libavformat    54. 17.100 / 54. 17.100
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  2.100 /  3.  2.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'youku.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 1941-02-22 02:53:21
  Duration: 00:06:01.48, start: 0.000000, bitrate: 592 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 576x312 [SAR 577:576 DAR 577:312], 557 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc
    Metadata:
      creation_time   : 1941-02-22 02:53:21
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 32 kb/s
    Metadata:
      creation_time   : 1941-02-22 02:53:27
      handler_name    : GPAC ISO Audio Handler
Please use -b:a or -b:v, -b is ambiguous
[libx264 @ 0x9867a00] --psnr used with psy on: results will be invalid!
[libx264 @ 0x9867a00] --tune psnr should be used if attempting to benchmark psnr!
[libx264 @ 0x9867a00] using SAR=1/1
[libx264 @ 0x9867a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle Cache64
[libx264 @ 0x9867a00] profile High, level 2.1
[libx264 @ 0x9867a00] 264 - core 125 r2 5f615f7 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=512 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'youku.mp4.flv':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf54.17.100
    Stream #0:0(und): Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 576x312 [SAR 1:1 DAR 24:13], q=-1--1, 512 kb/s, 1k tbn, 25 tbc
    Metadata:
      creation_time   : 1941-02-22 02:53:21
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, stereo, s16, 64 kb/s
    Metadata:
      creation_time   : 1941-02-22 02:53:27
      handler_name    : GPAC ISO Audio Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> libfaac)
Press [q] to stop, [?] for help
Segmentation fault




the same result as use -af atempo=2 only!


How did you compile x264,ffmpeg on you server machine?
Maybe I compiled wrong!







------------------ 原始邮件 ------------------
发件人: "Pavel Koshevoy"<pkoshevoy at gmail.com>;
发送时间: 2012年7月18日(星期三) 中午1:35
收件人: "ffmpeg-user"<ffmpeg-user at ffmpeg.org>; 

主题: Re: [FFmpeg-user] questions about audio filter "atempo"



On 7/17/2012 9:58 PM, 韩瑞松 wrote:
> Why did I get a "Segmentation fault"?
> I used this command line:
> ffmpeg -y -i youku.mp4 -analyzeduration 2G -vcodec libx264 -b 512k -r 25 -s 576x312 -aspect 576:312 -psnr -acodec libfaac -ab 64k -ar 44100 -ac 2 -vf "movie=2.jpg,scale=100:100[logo];[in][logo]overlay=5:5[out]" -af atempo=2 -f flv -map_chapters -1 -g 50 youku.mp4.flv
> it's output:

A stack trace would be helpful.

When you set atempo=2 you double the audio playback rate and cut down 
the soundtrack duration in half. However, this does not affect the video 
track. You need to adjust the video track rate to match the audio track.

I haven't tried this myself, but you probably need to use setpts filter 
for the video track (try setpts=0.5*PTS).

http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
http://ffmpeg.org/ffmpeg.html#setpts

Pavel.

_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list