[FFmpeg-user] video to image seq. back to video - keep same length

me at renecalles.de me at renecalles.de
Mon Apr 23 17:54:15 CEST 2012


Hi,

this is because 25 fps is set by default.
Try using -r 29.97 before the -i switch.

Best,
René

On Mon, 23 Apr 2012 08:45:01 -0700, Damon Edwards wrote:
> I ran the PHP script from the command line and got the output - why 
> does it
> assume 25fps when I specify '-r RATE', is that not correct?  Here's 
> the
> output
>
> [root at localhost html]# sudo php filmstrip.php
> 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 1 codec frame rate differs from container frame rate: 
> 60000.00
> (60000/1) -> 29.97 (30000/1001)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
> '/var/www/html/video/switches.mp4':
>   Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: isomavc1mp42
>   Duration: 00:00:30.43, start: 0.000000, bitrate: 625 kb/s
>     Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 125 kb/s
>     Stream #0.1(und): Video: h264, yuv420p, 480x360 [PAR 1:1 DAR 
> 4:3], 498
> kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc
> Output #0, image2, to
> '/var/www/html/video/images/switches-sepia-test/%11d.jpg':
>   Metadata:
>     encoder         : Lavf52.64.2
>     Stream #0.0(und): Video: mjpeg, yuvj420p, 480x360 [PAR 1:1 DAR 
> 4:3],
> q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
> Stream mapping:
>   Stream #0.1 -> #0.0
> Press [q] to stop encoding
> frame=  912 fps=398 q=0.0 Lsize=      -0kB time=30.43 bitrate=  
> -0.0kbits/s
>
> video:32430kB audio:0kB global headers:0kB muxing overhead 
> -100.000066%
> 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
> [image2 @ 0x20dd670]max_analyze_duration reached
> Input #0, image2, from
> '/var/www/html/video/images/switches-sepia-test/%11d-sepia.jpg':
>   Duration: 00:00:36.48, start: 0.000000, bitrate: N/A
>     Stream #0.0: Video: mjpeg, yuvj420p, 480x360 [PAR 1:1 DAR 4:3], 
> 25 fps,
> 25 tbr, 25 tbn, 25 tbc
> [libx264 @ 0x2102dd0]using SAR=1/1
> [libx264 @ 0x2102dd0]using cpu capabilities: MMX2 SSE2Fast SSSE3
> FastShuffle SSE4.2
> [libx264 @ 0x2102dd0]profile High 4:4:4 Predictive, level 3.0, bit 
> depth 8
> [libx264 @ 0x2102dd0]64 - core 107 - H.264/MPEG-4 AVC codec - 
> Copyleft
> 2003-2010 - http://www.videolan.org/x264.html - options: cabac=0 
> ref=1
> deblock=1:0:0 analyse=0x1:0x11 me=hex subme=3 psy=0 mixed_ref=0 
> me_range=16
> chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0
> chroma_qp_offset=0 threads=1 sliced_threads=0 nr=0 decimate=1 
> interlaced=0
> constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25
> scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
> Output #0, mp4, to '/var/www/html/video/switches-test-sepia.mp4':
>   Metadata:
>     encoder         : Lavf52.64.2
>     Stream #0.0: Video: libx264, yuv420p, 480x360 [PAR 1:1 DAR 4:3],
> q=10-51, 625 kb/s, 853996 tbn, 29.97 tbc
> Stream mapping:
>   Stream #0.0 -> #0.0
> Press [q] to stop encoding
> frame=  912 fps=143 q=0.0 Lsize=   60681kB time=36.47
> bitrate=13630.4kbits/s
> video:60670kB audio:0kB global headers:0kB muxing overhead 0.017621%
> [libx264 @ 0x2102dd0]frame I:5     Avg QP: 0.00  size: 63229
> [libx264 @ 0x2102dd0]frame P:907   Avg QP: 0.00  size: 68147
> [libx264 @ 0x2102dd0]mb I  I16..4: 65.5%  0.0% 34.5%
> [libx264 @ 0x2102dd0]mb P  I16..4: 17.9%  0.0%  4.9%  P16..4: 31.5% 
> 17.0%
> 12.7%  0.0%  0.0%    skip:15.9%
> [libx264 @ 0x2102dd0]coded y,uvDC,uvAC intra: 86.9% 28.1% 28.1% 
> inter:
> 69.2% 42.1% 41.9%
> [libx264 @ 0x2102dd0]i16 v,h,dc,p: 28% 71%  0%  0%
> [libx264 @ 0x2102dd0]i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 45%  2%  2%  
> 2%  1%
>  2%  1%  1%
> [libx264 @ 0x2102dd0]i8c dc,h,v,p: 59% 32%  9%  0%
> [libx264 @ 0x2102dd0]kb/s:16332.49
> [root at localhost html]#
>
>
> On Mon, Apr 23, 2012 at 8:34 AM, Andrey Utkin <
> andrey.krieger.utkin at gmail.com> wrote:
>
>> 2012/4/23 Damon Edwards <dzedward at gmail.com>:
>> > Sorry:
>> >
>> > *to image sequence:*
>> > ffmpeg -i ' . $video_dir . $filename . '.mp4 -sameq ' . $image_dir 
>> .
>> > '/%11d.jpg
>> >
>> > *apply filters to images via PHP here*
>> >
>> > *back to video:*
>> > ffmpeg -f image2 -i ' . $image_dir . '/%11d-' . $filter . '.jpg 
>> -vcodec
>> > libx264 -b ' . $bitrate . ' -r ' . $framerate . ' -vpre 
>> lossless_fast ' .
>> > $video_dir . $filename . '-' . $unique . '-' . $filter . '.mp4
>> >
>> > I execute this via PHP exec().
>>
>> Ffmpeg output still missing.
>> I guess your video has frame rate different from 25.
>> image2 demuxer assumes framerate 25 by default.
>>
>> --
>> Andrey Utkin
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>



More information about the ffmpeg-user mailing list