[FFmpeg-user] converting 1080p50 to PAL interlaced dv format
Konrad Karl
kk_konrad at gmx.at
Thu Jan 26 19:32:35 CET 2012
Hello,
(to Bostjan: putting conversation back to mailing list)
On Wed, Jan 25, 2012 at 01:30:25PM +0100, Cl??ment B??sch wrote:
> On Wed, Jan 25, 2012 at 01:15:08PM +0100, Konrad Karl wrote:
> > On Wed, Jan 25, 2012 at 12:37:48PM +0200, Maksym Veremeyenko wrote:
> > > 24.01.12 21:01, Bo??tjan Strojan ??????????????(????):
> > > >5. reinterlace (maybe using tinterlace)
> > > ^^^^^^^^^^
> > >
> > > -vf "scale=720:576,tinterlace=5"
> >
> > on which version of ffmpeg and mplayer should this work?
> >
>
> Try latest git:
>
> commit 42a8ac94d9481a5ab7e016d3621d265e3e1364d3
> Author: Stefano Sabatini <stefasab at gmail.com>
> Date: Sat Dec 31 14:12:01 2011 +0100
>
> vf_tinterlace: implement interlace mode 5
finally I managed to compile latest git ffmpeg and x264 on Fedora 16
which was a major pain because there are a lot of dependent
packages (e.g mplayer et al) - so I created an x264-local and
ffmpeg-local package which can co-exist. If anyone is interested I can
give more detail.
now I can do eg:
/usr/local/bin/ffmpeg -i 00020.MTS -vf "crop=1348:1080:0:0,scale=720:576,tinterlace=5" \
-r 25 -vcodec dvvideo -acodec pcm_s16le -ac 2 -ar 48000 00020.dv
I needed to add -r25 else ffmpeg complains a lot:
[dvvideo @ 0x89fda0] Can't process DV frame #0. Insufficient audio data or severe sync problem.
below is the full output of the conversion, ffprobe and mplayer -identify
It plays ok and I see also the typical interlace comb distortions but somehow the
video looks more like a 25p material. (just guessing due to temporal lack of dv captures)
Q1: how does the ffprobe and mplayer output tell me that it is interlaced material?
will ffprobe also with files captures directly from the DV camcorder and compare (at home).
Q2: what is the meaning of the ....., 50 tbr, 90k tbn, 100 tbc ?
(it says 100 tbc on 1080p50 and 50 tbc on 1080i50, both from panasonic sd909)
Thanks all very much for your valuable hints so far,
Konrad
------------------------------------------------------------------------
ffprobe 00020.MTS says about the original clip:
Input #0, mpegts, from '00020.MTS':
Duration: 00:00:32.17, start: 0.355678, bitrate: 24820 kb/s
Program 1
Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 384 kb/s
Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
bash> /usr/local/bin/ffmpeg -t 3 -y -i 00020.MTS -vf "crop=1348:1080:0:0,scale=720:576,tinterlace=5" -r 25 -vcodec dvvideo -acodec pcm_s16le -ac 2 -ar 48000 00020.dv
Copyright (c) 2000-2012 the FFmpeg developers
built on Jan 26 2012 12:55:34 with gcc 4.6.2 20111027 (Red Hat 4.6.2-1)
configuration: --extra-ldflags=-L/usr/local/lib64 --extra-cflags=-I/usr/local/include --prefix=/usr/local --bindir=/usr/local/bin --datadir=/usr/local/share/ffmpeg --incdir=/usr/local/include/ffmpeg
--libdir=/usr/local/lib64 --mandir=/usr/local/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
-mtune=generic' --enable-bzlib --enable-libdc1394 --enable-libcelt --enable-libdirac --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --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/local/lib64 --enable-runtime-cpudetect
libavutil 51. 34.101 / 51. 34.101
libavcodec 53. 60.100 / 53. 60.100
libavformat 53. 31.100 / 53. 31.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 60.100 / 2. 60.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
[h264 @ 0x14174c0] Increasing reorder buffer to 1
Input #0, mpegts, from '00020.MTS':
Duration: 00:00:32.17, start: 0.355678, bitrate: 24820 kb/s
Program 1
Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 384 kb/s
Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
[buffer @ 0x1412280] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[crop @ 0x14191c0] w:1920 h:1080 -> w:1348 h:1080
[scale @ 0x141ad20] w:1348 h:1080 fmt:yuv420p -> w:720 h:576 fmt:yuv420p flags:0x4
[tinterlace @ 0x141b540] mode:5 h:576 -> h:576
Output #0, dv, to '00020.dv':
Metadata:
encoder : Lavf53.31.100
Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 674:675 DAR 337:270], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> dvvideo)
Stream #0:1 -> #0:1 (ac3 -> pcm_s16le)
Press [q] to stop, [?] for help
Input stream #0:1 frame changed from rate:48000 fmt:s16 ch:6 to rate:48000 fmt:s16 ch:2
frame= 75 fps= 22 q=0.0 Lsize= 10547kB time=00:00:03.00 bitrate=28800.0kbits/s
video:10547kB audio:564kB global headers:0kB muxing overhead -5.076108%
---------------
/usr/local/bin/ffprobe 00020.dv
ffprobe version 0.9.1.git Copyright (c) 2007-2012 the FFmpeg developers
built on Jan 26 2012 12:55:34 with gcc 4.6.2 20111027 (Red Hat 4.6.2-1)
configuration: --extra-ldflags=-L/usr/local/lib64 --extra-cflags=-I/usr/local/include --prefix=/usr/local --bindir=/usr/local/bin --datadir=/usr/local/share/ffmpeg --incdir=/usr/local/include/ffmpeg
--libdir=/usr/local/lib64 --mandir=/usr/local/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
-mtune=generic' --enable-bzlib --enable-libdc1394 --enable-libcelt --enable-libdirac --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --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/local/lib64 --enable-runtime-cpudetect
libavutil 51. 34.101 / 51. 34.101
libavcodec 53. 60.100 / 53. 60.100
libavformat 53. 31.100 / 53. 31.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 60.100 / 2. 60.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
[dv @ 0x25d2720] Estimating duration from bitrate, this may be inaccurate
Input #0, dv, from '00020.dv':
Metadata:
timecode : 00:00:00:00
Duration: 00:00:03.00, start: 0.000000, bitrate: 28800 kb/s
Stream #0:0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, SAR 16:15 DAR 4:3, 25 tbr, 25 tbn, 25 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
------------------
mplayer -identify 00020.dv
MPlayer SVN-r33996-4.6.2 (C) 2000-2011 MPlayer Team
Playing 00020.dv.
Invalid seek to negative position ffffffffffffffff!
ID_VIDEO_ID=0
libavformat file format detected.
[dv @ 0x7f36216cdc40]Estimating duration from bitrate, this may be inaccurate
ID_VIDEO_ID=0
[lavf] stream 0: video (dvvideo), -vid 0
ID_AUDIO_ID=0
[lavf] stream 1: audio (pcm_s16le), -aid 0
VIDEO: [dvsd] 720x576 0bpp 25.000 fps 28800.0 kbps (3515.6 kbyte/s)
Load subtitles in ./
ID_FILENAME=00020.dv
ID_DEMUXER=lavf
ID_VIDEO_FORMAT=dvsd
ID_VIDEO_BITRATE=28800000
ID_VIDEO_WIDTH=720
ID_VIDEO_HEIGHT=576
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=1536000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_START_TIME=0.00
ID_LENGTH=3.00
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffdv] vfm: ffmpeg (FFmpeg DV)
==========================================================================
ID_VIDEO_CODEC=ffdv
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
ID_AUDIO_BITRATE=1536000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.3333
VO: [xv] 720x576 => 768x576 Planar YV12
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.3333
VO: [xv] 720x576 => 768x576 Planar YV12
A: 0.8 V: 0.8 A-V: 0.007 ct: 0.035 0/ 0 14% 2% 1.1% 0 0
Capturing not enabled (forgot -capture parameter?)
A: 1.2 V: 1.2 A-V: 0.002 ct: 0.039 0/ 0 13% 1% 1.0% 0 0
Exiting... (Quit)
-------------------------------------------------
More information about the ffmpeg-user
mailing list