[FFmpeg-user] (no subject)

Cley Faye cleyfaye at gmail.com
Sun Jul 24 19:16:14 EEST 2016


2016-07-24 17:45 GMT+02:00 Walid Salman <bza.salman at gmail.com>:

>
> [root at ns1 ~]
> ​​
> # ffmpeg -i /home/lamas44747/public_html/sarmaye.mp4 -ss
> 00:00:10 -to 00:00:20 -c copy /home/lamas44747/public_html/split.mp4
>
> the server show this error :
>
> FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
>   built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
>   configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
> --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth
> --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC'
> --enable-avfilter --enable-avfilter-lavf --enable-libdc1394
> --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin
> --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger
> --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl
> --enable-nonfree --enable-postproc --enable-pthreads --enable-shared
> --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
>   libavutil     50.15. 1 / 50.15. 1
>   libavcodec    52.72. 2 / 52.72. 2
>   libavformat   52.64. 2 / 52.64. 2
>   libavdevice   52. 2. 0 / 52. 2. 0
>   libavfilter    1.19. 0 /  1.19. 0
>   libswscale     0.11. 0 /  0.11. 0
>   libpostproc   51. 2. 0 / 51. 2. 0
>
> Seems stream 0 codec frame rate differs from container frame rate: 48.00
> (705505/14698) -> 24.00 (705505/29396)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
> '/home/lamas44747/public_html/sarmaye.mp4':
>   Metadata:
>     major_brand     : isom
>     minor_version   : 512
>     compatible_brands: isomiso2avc1mp41
>     encoder         : Lavf56.40.101
>     comment         : http://www.aparat.com/kshahrvandi
>   Duration: 00:00:58.88, start: 0.-46440, bitrate: 662 kb/s
>     Stream #0.0(eng): Video: h264, yuv420p, 640x360 [PAR 1:1 DAR 16:9], 562
> kb/s, 24 fps, 24 tbr, 705505.00 tbn, 48 tbc
>     Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16, 96 kb/s
> Unrecognized option 'to'


​There are multiple ways to do this, but I assume in this case you want
your input to start at 00:00:10 and end at 00:00:20 from the input video ?
First, know that using copy, it is possible that the cut won't begin
exactly where you want it: to produce a readable output, a lot of codecs
requires the stream to start on an iframe. If you want exact cut, you might
need to reencode a part of your video.

Second, I believe that this time (I was wrong on this before), you want to
-ss and -to to be *input* options and not *output* options. With ffmpeg,
the argument order is important: any option related to an input or an
output must be provided before the input/output. If you have an option that
is related to an input, it must be before the corresponding "-i".
Also note that depending on which option you choose, the relative timestamp
of your input might change. The "-t" option allows you to specify a
duration instead of a timestamp if this is an issue.​

​If I'm not wrong, your command line would look something like this:​
​​# ffmpeg -ss 00:00:10 -to 00:00:20 -i
/home/lamas44747/public_html/sarmaye.mp4 -c copy
/home/lamas44747/public_html/split.mp4​

​Here, "-ss" and "-to" relate to the input file, "​-c copy" relate to the
output.


More information about the ffmpeg-user mailing list