[FFmpeg-user] Resizing dvb streams keeping Aspect ratio

Mike Martin mike at redtux.org.uk
Tue May 7 19:49:07 CEST 2013


Hi

I do lot of transcoding of DVB captures, currently to mp4 (h264), in two
stages.

One to an intermediate files so I can cut the adverts and then a final mp4
file

As people may be aware, at least in the UK, these TS streams can contain
several resolutions/Aspect Ratios, typically the program, adverts and
station blurbs can each be different.

However at least with mp4 the diffent resolutions seem to get transcoded to
one resoltion


Command line

ffmpeg -async 24 -v 35 -i
"/home/mike/videos/CharmedREC_2013_05_07_13_54_351.mpeg"  -c:v libx264
-preset ultrafast  -crf 18 -g 25 -c:a copy -movflags faststart -threads 2
-vf scale="352:trunc(ow/a/2)*2",fps="fps= 20" -y
 "/storage/burn/CharmedREC_2013_05_07_13_54_351_enf.mp4"

ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec  4 2012 08:14:17 with gcc 4.7.2 (GCC) 20121109 (Red Hat
4.7.2-8)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack
--enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal
--enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264
--enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc
--enable-pthreads --disable-static --enable-shared --enable-gpl
--disable-debug --disable-stripping --shlibdir=/usr/lib64
--enable-runtime-cpudetect
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0xc17780] PES packet size mismatch
[mpeg2video @ 0xc2cea0] mpeg_decode_postinit() failure
    Last message repeated 7 times
[mpegts @ 0xc17780] max_analyze_duration 5000000 reached at 5000000
[mpegts @ 0xc17780] PES packet size mismatch
Input #0, mpegts, from
'/home/mike/videos/CharmedREC_2013_05_07_13_54_351.mpeg':
  Duration: 01:06:59.85, start: 52384.162233, bitrate: 2260 kb/s
    Stream #0:0[0x305]: Video: mpeg2video (Main), yuv420p, 544x576 [SAR
32:17 DAR 16:9], 15000 kb/s, 26.17 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x306]: Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
[libx264 @ 0xc2f2a0] using SAR=62/33
[libx264 @ 0xc2f2a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0xc2f2a0] profile Constrained Baseline, level 2.1
[libx264 @ 0xc2f2a0] 264 - core 128 r2223 f6a8615 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0
ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=0 threads=2 lookahead_threads=1
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=0 weightp=0 keyint=25 keyint_min=2 scenecut=0
intra_refresh=0 rc=crf mbtree=0 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69
qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '/storage/burn/CharmedREC_2013_05_07_13_54_351_enf.mp4':
  Metadata:
    encoder         : Lavf54.29.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 352x372
[SAR 62:33 DAR 16:9], q=-1--1, 20 tbn, 20 tbc
    Stream #0:1: Audio: mp2 (i[0][0][0] / 0x0069), 48000 Hz, stereo, 192
kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libx264)
  Stream #0:1 -> #0:1 (copy)

Any ideas on this


More information about the ffmpeg-user mailing list