I have found a way to crop the video successfully:  The windows program 
Winffmpeg is a GUI interface to ffmpeg for Windows.  Within it, you can specify 
the left/right/top/bottom crop parameters and it works fine.  I suspect that 
either it is using the old version of ffmpeg, or the authors have figured out 
how to successfully translate the simple crop parameters into the new -vf crop.

Murray

--- On Tue, 4/3/12, Murray Strome <wmstr...@yahoo.com> wrote:

From: Murray Strome <wmstr...@yahoo.com>
Subject: Re: [CinCV] Confused about ffmpeg -vf crop=h:w:x:y
To: cinelerra@skolelinux.no
Received: Tuesday, April 3, 2012, 4:44 AM

--- On Mon, 4/2/12, Ichthyostega <p...@ichthyostega.de> wrote:

From: Ichthyostega <p...@ichthyostega.de>
Subject: Re: [CinCV] Confused about ffmpeg -vf crop=h:w:x:y
To: cinelerra@skolelinux.no
Received: Monday, April 2, 2012, 4:41 PM

Am 02.04.2012 06:56, schrieb Murray Strome:
> I have a video which is .mpg 720X480, 16:9  with the active video centred and
> smaller than the full frame. I tried two things:

> 1. ffmpeg -i <In.mpg> -s hd720
 -b 8500k <out.mpg>

> 2. ffmpeg -i <in.mpg> -vf crop=540:304 -vf scale=1280:720 -s hd720 -b 8500k
> <out.mpg>

> I don't
 see any difference in the resulting two videos when I play them back
> in any of the LINUX video players on my LINUX distribution, nor any of the
> video players I see in Windows.

The second command specifies explicitly what to do, while the first command
just states "I want hd720 video output". Thus, some default behaviour of
ffmpeg kicks in here. My guess ist that this default behaviour does the
same as the explicitly specified processing instructions in the second command.

But wait -- doesn't ffmpeg print detailed diagnostics on what it actually does
while transforming the video. Maybe we could figure out from this output
what is actually done to the video stream?

Hermann V
Hi Herman,

Here is an example of the first part of the message. Here the video is 352X480 
aspect 4:3 and I want to get a result which cuts off the black bands at the top 
and bottom. I am assuming that the
 crop is supposed to work on the input video, so I set the crop to keep the 
original width but remove the top and bottom, then rescale. From this output, 
(and similar output from others with the 720X480 size input) it would appear to 
me that the -vf crop is being completely ignored. The question is, "Why?"

Murray
$ ffmpeg -i VTS_01_1.VOB -vf crop=352:270:0:0 -vf scale=1280:720 -s hd720 -b 
8500k WC-VOB-1B.mpg

ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the 
Libav developers
  built on Jan  4 2012 16:08:51 with gcc 4.6.1
  configuration: --extra-version='4:0.7.3-0ubuntu0.11.10.1' --arch=amd64 
--prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm 
--enable-libschroedinger --enable-libspeex --enable-libtheora 
--enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx 
--enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc 
--enable-swscale --enable-x11grab
 --enable-libdc1394 --enable-shared --disable-static
  WARNING: library configuration mismatch
  avutil      configuration: 
--extra-version='4:0.7.3ubuntu0.11.10.1+medibuntu1' --arch=amd64 --prefix=/usr 
--enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger 
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads 
--enable-zlib --enable-libvpx --enable-runtime-cpudetect 
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 
--enable-vaapi --enable-libopenjpeg --enable-libfaac --enable-nonfree 
--enable-gpl --enable-postproc --enable-swscale --enable-x11grab 
--enable-libdirac --enable-libmp3lame --enable-librtmp --enable-libx264 
--enable-libxvid --enable-libopencore-amrnb --enable-version3 
--enable-libopencore-amrwb --enable-version3 --enable-libvo-aacenc 
--enable-version3 --enable-libvo-amrwbenc --enable-version3 --enable-libdc1394 
--enable-shared
 --disable-static
  avcodec     configuration: 
--extra-version='4:0.7.3ubuntu0.11.10.1+medibuntu1' --arch=amd64 --prefix=/usr 
--enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger 
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads 
--enable-zlib --enable-libvpx --enable-runtime-cpudetect 
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 
--enable-vaapi --enable-libopenjpeg --enable-libfaac --enable-nonfree 
--enable-gpl --enable-postproc --enable-swscale --enable-x11grab 
--enable-libdirac --enable-libmp3lame --enable-librtmp --enable-libx264 
--enable-libxvid --enable-libopencore-amrnb --enable-version3 
--enable-libopencore-amrwb --enable-version3 --enable-libvo-aacenc 
--enable-version3 --enable-libvo-amrwbenc --enable-version3 --enable-libdc1394 
--enable-shared --disable-static
  libavutil    51.  7. 0 / 51.  7. 0
 
 libavcodec   53.  6. 0 / 53.  6. 0
  libavformat  53.  3. 0 / 53.  3. 0
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  4. 0 /  2.  4. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  52.  0. 0 / 52.  0. 0
[mpeg @ 0x2109560] max_analyze_duration reached
Input #0, mpeg, from 'VTS_01_1.VOB':
  Duration: 01:00:10.37, start: 0.521789, bitrate: 2379 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 352x480 [PAR 20:11 
DAR 4:3], 3758 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
[buffer @ 0x210b520] w:352 h:480 pixfmt:yuv420p
[scale @ 0x210b1e0] w:352 h:480 fmt:yuv420p -> w:1280 h:720 fmt:yuv420p 
flags:0x4
[scale @ 0x210fec0] w:1280 h:720
 fmt:yuv420p -> w:1280 h:720 fmt:yuv420p flags:0x4
[mpeg @ 0x2107940] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'WC-VOB-1B.mpg':
  Metadata:
    encoder         : Lavf53.3.0
    Stream #0.0: Video: mpeg1video, yuv420p, 1280x720 [PAR 20:11 DAR 320:99], 
q=2-31, 8500 kb/s, 90k tbn, 29.97 tbc
    Stream #0.1: Audio: mp2, 48000 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press ctrl-c to stop encoding


 I guess the main issue is that the video is not cropped.  As I said in an 
earlier post, under the old ffmpeg, to achieve the result I want, I would have
 done:

-cropleft 90 -cropright 90    ... etc

and the video would be cropped then the result scaled to fit the frame.  I can 
see that no cropping was done at all. 


Reply via email to