[FFmpeg-user] problems with IPB Frames

Henk D. Schoneveld belcampo at zonnet.nl
Fri Jan 31 15:23:34 CET 2014


On 31 Jan 2014, at 14:25, Guido Holz <guido at sportograf.com> wrote:

> I tried now to get from my first cut-out all-I-Frames with the option "-g
> 1" like
> 
> ffmpeg.exe -ss 00:07:12.0 -i 00005.MTS -vf yadif=1 -r 25 -g 1 -t 00:00:20.0
> -an -y tmp.mp4
> 
> When I do this
> 
> ffmpeg.exe -i tmp.mp4 -ss 00:00:04.0 -t 00:00:12.0 -y out.mp4
> 
> should I get normaly  a piece of footage beginning with an I-Frame, right?
No, I don’t think so, your source-file has to be all-I-frames first. I don’t think that tmp.mp4 will be encoded, you don’t tell which encoder to use.
ffmpeg -i source.MTS -vf yadif=1 -c:a copy. -c:v libx264 -r 25 -g 1 
you’ll have reencode the source first.
> 
> So I would like to cut only out a piece of footage from a given big video
> and I don't no realy how to get this
> 
> thansk for help
> 
> 
> 
> 2014-01-28 Henk D. Schoneveld <belcampo at zonnet.nl>
> 
>> 
>> On 28 Jan 2014, at 16:03, Guido Holz <guido.holz at googlemail.com> wrote:
>> 
>>> The job is to cut quikly out a piece from a big videostream (MTS) and to
>>> stitch this piece with others together. The problem is, that I have many
>>> times no I-frame as my first frame what means that I have some artifacts
>> at
>>> the beginning.
>>> 
>>> first I cut quick a bigger piece out of the big stream.
>>> 
>>> \>ffmpeg.exe -ss 00:07:12.0 -i 00005.MTS -vf yadif=1 -r 25 -t 00:00:20.0
>>> -an -y tmp.mp4
>>> 
>>> after I let run the video 4 seconds to cut after 4 seconds 12 seconds out
>>> of the video (to catch an I-Frame for getting a smooth start of the
>> video)
>>> 
>>> \>ffmpeg.exe -i tmp.mp4 -ss 00:00:04.0 -t 00:00:12.0 -y out.mp4
>>> 
>>> I need to convert from mp4 to ts because after I have to concatenate the
>>> videos together
>>> 
>>> \>ffmpeg.exe -i out.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y
>> out.ts
>>> 
>>> \>ffmpeg -i "concat:out.ts|out.ts" -i  a_sound_file.aac -c copy -bsf:a
>>> aac_adtstoasc -y finish.mp4
>> What you basically do is 'copying' chunks of a file. Without reencoding
>> you'll always have these hit/miss situations, unless the source is
>> all-i-frames.
>>> 
>>> the  ouptut of the source-video is
>>> 
>>> ffmpeg.exe -i 00005.MTS
>>> ffmpeg version N-60202-g6369766 Copyright (c) 2000-2014 the FFmpeg
>>> developers
>>> built on Jan 27 2014 02:02:32 with gcc 4.8.2 (GCC)
>>> configuration: --enable-gpl --enable-version3 --disable-w32threads
>>> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
>>> --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
>>> --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc
>>> --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
>>> --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
>>> --enable-librtmp --enable-libschroedinger --enable-libsoxr
>>> --enable-libspeex --enable-libtheora --enable-libtwolame
>>> --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
>>> --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264
>>> --enable-libxavs --enable-libxvid --enable-zlib
>>> libavutil      52. 63.100 / 52. 63.100
>>> libavcodec     55. 49.100 / 55. 49.100
>>> libavformat    55. 26.100 / 55. 26.100
>>> libavdevice    55.  5.102 / 55.  5.102
>>> libavfilter     4.  1.101 /  4.  1.101
>>> libswscale      2.  5.101 /  2.  5.101
>>> libswresample   0. 17.104 /  0. 17.104
>>> libpostproc    52.  3.100 / 52.  3.100
>>> Input #0, mpegts, from '00005.MTS':
>>> Duration: 00:16:31.57, start: 4961.872000, bitrate: 17147 kb/s
>>> Program 1
>>>   Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p,
>>> 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
>>>   Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo,
>>> fltp, 256 kb/s
>>>   Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] /
>>> 0x0090), 1920x1080
>>> At least one output file must be specified
>>> 
>>> 
>>> what can I do to get no artifacts?
>>> 
>>> --
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> ffmpeg-user at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> 
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> 
> 
> 
> 
> -- 
> 
> Guido Holz
> managing director
> 
> www.sportograf.com :: photography for the love of sport
> 
> Sportograf GmbH & Co. KG
> Dennewartstr. 25/27 :: 52068 Aachen :: Germany
> tel/fax:  +49 (0) 241 9633 180
> mobil:   +49 (0) 173 5184498
> mail:     guido at sportograf.com
> 
> Amtsgericht Aachen
> HRB 15932
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list