New submission from hfl1000 <[email protected]>:
Converting to mpeg1 video may have incorrect PAR/DAR values in output file, if
the specified output PAR/DAR are different from input video.
ffmpeg detects that my mov file has 720x576 [PAR 16:15 DAR 4:3]
I use this command to convert mov file to mpeg 352x288 [PAR 1:1 DAR 11:9]
ffmpeg -i 101208_short.mov -threads 1 -ac 2 -ar 44100 -ab 128k -y -vcodec
mpeg1video -s 352x288 -aspect 11:9 -vb 1024k -acodec mp2 101208.mpg
Conversion process is fine, output stream 0.0 shows 352x288 [PAR 1:1 DAR 11:9]
Playing back the output mpeg shows wrong frame size, and ffprobe and ffmpeg show
that the output mpeg has 352x288 [PAR 178:163 DAR 1958:1467]
Using mp4 as intermediate has worked
(1) convert to mp4 352x288 [PAR 1:1 DAR 11:9]
(2) convert from mp4 to mpg
ffmpeg -i 101208_short.mov -threads 0 -ac 2 -ar 44100 -ab 128k -y -vcodec
libx264 -fpre libx264-medium.ffpreset -s 352x288 -aspect 11:9 -vb 1024k -acodec
aac -strict experimental 101208.mp4
ffmpeg -i 101208.mp4 -threads 1 -ac 2 -ar 44100 -ab 128k -y -vcodec mpeg1video
-s 352x288 -aspect 11:9 -vb 1024k -acodec mp2 101208.mp4.mpg
This time the output mpg has [PAR 1:1 DAR 11:9]
I also tried ffmpeg-r26041-swscale-r32676, it has same problem.
Here is the console output:
ffmpeg -i 101208_short.mov -threads 1 -ac 2 -ar 44100 -ab 128k -y -vcodec
mpeg1video -s 352x288 -aspect 11:9 -vb 1024k -acodec mp2 101208.mpg
FFmpeg version SVN-r25942, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 13 2010 04:07:42 with gcc 4.4.2
configuration: --enable-gpl --enable-version3 --enable-libgsm
--enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex
--enable-lib
mp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb
--enable-libopencore_amrnb --enable-libvpx --disable-decoder=libvpx -
-arch=x86 --enable-runtime-cpudetect --enable-libxvid --enable-libx264
--extra-libs='-lx264 -lpthread' --enable-librtmp --extra-libs='-lrtmp -lpolarss
l -lws2_32 -lwinmm' --target-os=mingw32 --enable-avisynth
--cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc'
--enable-memalign-hack
libavutil 50.34. 0 / 50.34. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.99. 1 / 52.99. 1
libavformat 52.88. 0 / 52.88. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.69. 0 / 1.69. 0
libswscale 0.12. 0 / 0.12. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '101208_short.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : 1970-01-01 00:00:00
encoder : Lavf52.88.0
Duration: 00:00:10.00, start: 0.000000, bitrate: 557 kb/s
Stream #0.0(eng): Video: mpeg4, yuv420p, 720x576 [PAR 16:15 DAR 4:3], 487
kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 64 kb/s
Metadata:
creation_time : 1970-01-01 00:00:00
[buffer @ 017bbf00] w:720 h:576 pixfmt:yuv420p
[scale @ 017b0f30] w:720 h:576 fmt:yuv420p -> w:352 h:288 fmt:yuv420p flags:0x4
[mpeg @ 03ce0050] VBV buffer size not set, muxing may fail
Output #0, mpeg, to '101208.mpg':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : 1970-01-01 00:00:00
encoder : Lavf52.88.0
Stream #0.0(eng): Video: mpeg1video, yuv420p, 352x288 [PAR 1:1 DAR 11:9],
q=2-31, 1024 kb/s, 90k tbn, 25 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(eng): Audio: mp2, 44100 Hz, stereo, s16, 128 kb/s
Metadata:
creation_time : 1970-01-01 00:00:00
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 250 fps=107 q=5.6 Lsize= 1620kB time=9.96 bitrate=1332.4kbits/s
video:1449kB audio:157kB global headers:0kB muxing overhead 0.910020%
ffprobe -unit -sexagesimal -pretty -show_format -show_streams 101208.mpg
FFprobe version SVN-r25942, Copyright (c) 2007-2010 the FFmpeg developers
built on Dec 13 2010 04:07:42 with gcc 4.4.2
configuration: --enable-gpl --enable-version3 --enable-libgsm
--enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex
--enable-lib
mp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb
--enable-libopencore_amrnb --enable-libvpx --disable-decoder=libvpx -
-arch=x86 --enable-runtime-cpudetect --enable-libxvid --enable-libx264
--extra-libs='-lx264 -lpthread' --enable-librtmp --extra-libs='-lrtmp -lpolarss
l -lws2_32 -lwinmm' --target-os=mingw32 --enable-avisynth
--cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc'
--enable-memalign-hack
libavutil 50.34. 0 / 50.34. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.99. 1 / 52.99. 1
libavformat 52.88. 0 / 52.88. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.69. 0 / 1.69. 0
libswscale 0.12. 0 / 0.12. 0
[mpeg @ 0366e170] max_analyze_duration reached
Input #0, mpeg, from '101208.mpg':
Duration: 00:00:09.96, start: 1.000000, bitrate: 1332 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352x288 [PAR 178:163 DAR
1958:1467], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, 2 channels, s16, 128 kb/s
[STREAM]
index=0
codec_name=mpeg1video
codec_long_name=MPEG-1 video
codec_type=video
codec_time_base=1/25
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=352
height=288
has_b_frames=1
sample_aspect_ratio=178:163
display_aspect_ratio=1958:1467
pix_fmt=yuv420p
id=0x1e0
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/90000
start_time=0:00:01.000000
duration=0:00:09.960000
[/STREAM]
[STREAM]
index=1
codec_name=mp2
codec_long_name=MP2 (MPEG audio layer 2)
codec_type=audio
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_rate=44.100 KHz
channels=2
bits_per_sample=0
id=0x1c0
r_frame_rate=0/0
avg_frame_rate=25151/657
time_base=1/90000
start_time=0:00:01.000000
duration=0:00:09.900411
[/STREAM]
[FORMAT]
filename=101208.mpg
nb_streams=2
format_name=mpeg
format_long_name=MPEG-PS format
start_time=0:00:01.000000
duration=0:00:09.960000
size=1.582 Mibyte
bit_rate=1.332 Mbit/s
[/FORMAT]
ffmpeg -i 101208_short.mov -threads 0 -ac 2 -ar 44100 -ab 128k -y -vcodec
libx264 -fpre libx264-medium.ffpreset -s 352x288 -aspect 11:9 -vb 1024k -acodec
aac -strict experimental 101208.mp4
ffmpeg -i 101208.mp4 -threads 1 -ac 2 -ar 44100 -ab 128k -y -vcodec mpeg1video
-s 352x288 -aspect 11:9 -vb 1024k -acodec mp2 101208.mp4.mpg
ffprobe -unit -sexagesimal -pretty -show_format -show_streams 101208.mp4.mpg
FFprobe version SVN-r25942, Copyright (c) 2007-2010 the FFmpeg developers
built on Dec 13 2010 04:07:42 with gcc 4.4.2
configuration: --enable-gpl --enable-version3 --enable-libgsm
--enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex
--enable-lib
mp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb
--enable-libopencore_amrnb --enable-libvpx --disable-decoder=libvpx -
-arch=x86 --enable-runtime-cpudetect --enable-libxvid --enable-libx264
--extra-libs='-lx264 -lpthread' --enable-librtmp --extra-libs='-lrtmp -lpolarss
l -lws2_32 -lwinmm' --target-os=mingw32 --enable-avisynth
--cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc'
--enable-memalign-hack
libavutil 50.34. 0 / 50.34. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.99. 1 / 52.99. 1
libavformat 52.88. 0 / 52.88. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.69. 0 / 1.69. 0
libswscale 0.12. 0 / 0.12. 0
[mpeg @ 015de140] max_analyze_duration reached
Input #0, mpeg, from '101208.mp4.mpg':
Duration: 00:00:09.92, start: 1.000000, bitrate: 1339 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352x288 [PAR 1:1 DAR 11:9],
104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, 2 channels, s16, 128 kb/s
[STREAM]
index=0
codec_name=mpeg1video
codec_long_name=MPEG-1 video
codec_type=video
codec_time_base=1/25
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=352
height=288
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=11:9
pix_fmt=yuv420p
id=0x1e0
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/90000
start_time=0:00:01.000000
duration=0:00:09.920000
[/STREAM]
[STREAM]
index=1
codec_name=mp2
codec_long_name=MP2 (MPEG audio layer 2)
codec_type=audio
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_rate=44.100 KHz
channels=2
bits_per_sample=0
id=0x1c0
r_frame_rate=0/0
avg_frame_rate=25151/657
time_base=1/90000
start_time=0:00:01.000000
duration=0:00:09.900411
[/STREAM]
[FORMAT]
filename=101208.mp4.mpg
nb_streams=2
format_name=mpeg
format_long_name=MPEG-PS format
start_time=0:00:01.000000
duration=0:00:09.920000
size=1.584 Mibyte
bit_rate=1.339 Mbit/s
[/FORMAT]
----------
messages: 12993
priority: normal
status: new
substatus: new
title: Converting to mpeg1 video may have incorrect PAR/DAR
type: bug
________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2434>
________________________________________________