[FFmpeg-user] Duplicates frames when converting interlaced h264 to png frames and double length when converting interlaced .png to interlaced mp4

Lionel Trésaugues lionel.tresaugues at gmail.com
Fri Nov 18 22:39:08 CET 2011


Dear FFmpeg users,

I am currently encountering two major problems during my video-editing
process (I am running the 64bits edition of Ubuntu Linux 11.10). My
camcorder (Panasonic HDC-SD60) shots 1080/50i (AVCHD in a mts
container).

First problem)

I want, in a first step, to convert the .mts into a sequence of .png
frames while preserving the interlacing.

To do so, I used the following FFmpeg command-line:

ffmpeg -i 00030.MTS -an -vcodec png -r 50 -flags +ilme+ildct+mv4+aic
-top 1 -qscale 1 -s 1920x1080 -sameq 00030%05d.png

Then for a 2min21sec long .mts movie, ffmpeg produces 7080 frames each
of them clearly showing signs of interlacing (which was the expected
result) (and 7080/50=2min21sec).

But, indeed, two consecutive frames are absolutely identical (e.g
frames 1 and 2 are identical, 3 and 4 are identical, 5 and 6, etc..)

When I try to do the same process using avisynth and VirtualDub (on
windows), while using this avisynth script :
DirectShowSource("E:\00030.MTS").AssumeTFF().DoubleWeave()
I, then obtain once again 7080 interlaced png frames but this time
they all are different.

So, first question, how would I be able to produce the same results
with ffmpeg ?

Second problem)

Then, I want to convert the interlaced png frames (ideally after
processing in Blender) and merge them with an audio track into a mp4
container and still want to preserve the interlacing.

I used the following command-line :

ffmpeg -threads 2 -i %05d.png -i audio.aac -qscale 1 -vcodec mpeg4
-acodec copy -minrate 0 -b 50000k -mbd 2 -trellis 2 -cmp 2 -subcmp 2
-g 300 -r 50 -flags +ilme+ildct+mv4+aic -top 1 -f mp4 00030.mp4

And I obtain a slow-motion interlaced movie which lasts twice the
duration of the initial footage. The problem is the same whether I use
the 7080 frames produced by ffmpeg (containing duplicates) or the 7080
frames (without duplicates) produced by VirtualDub.

How would I be able to use the sequence of .png frames to produce an
interlaced movie (50i) in a mp4 container correctly ?

Thanks a lot for your suggestions

/lionel

These are some informations about the version of FFmpeg I am using :

ffmpeg version 0.7.2-4:0.7.2-1ubuntu1, Copyright (c) 2000-2011 the
Libav developers
  built on Oct  2 2011 15:13:26 with gcc 4.6.1
  configuration: --extra-version='4:0.7.2-1ubuntu1' --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.2.1ubuntu1+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.2.1ubuntu1+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.  5. 0 / 53.  5. 0
  libavformat  53.  2. 0 / 53.  2. 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


More information about the ffmpeg-user mailing list