[FFmpeg-trac] #5743(avformat:open): SAR changes when stream copying y4m video to Matroska when SAR is present in source
FFmpeg
trac at avcodec.org
Thu Jul 28 12:25:56 EEST 2016
#5743: SAR changes when stream copying y4m video to Matroska when SAR is present
in source
------------------------------------+------------------------------------
Reporter: kieranjol | Owner:
Type: defect | Status: open
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: mkv aspect | Blocked By:
Blocking: | Reproduced by developer: 1
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Comment (by kieranjol):
It is. I tried to reproduce the attributes of my y4m file with testsrc,
but my -vf setsar option was altered. I asked for a sar of 128:117 but I
got a SAR of 93:85 . Possibly something to do with yuv420p?
3 outputs:
1. testsrc generation
2. stream copy to matroska
3. ffmpeg -i of out.mkv
1. testsrc generation
{{{
fmpeg -f lavfi -i testsrc=size=176x144 -vf setsar=128:117 -pix_fmt yuv420p
-t 1 out.y4m
ffmpeg version N-43802-g376d8fb Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-
libfreetype --enable-ffplay --disable-lzma --enable-libopenjpeg --disable-
decoder=jpeg2000 --extra-
cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-
vda
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 51.100 / 57. 51.100
libavformat 57. 44.100 / 57. 44.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 49.100 / 6. 49.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, lavfi, from 'testsrc=size=176x144':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 176x144
[SAR 1:1 DAR 11:9], 25 tbr, 25 tbn, 25 tbc
File 'out.y4m' already exists. Overwrite ? [y/N] y
[Parsed_setsar_0 @ 0x7f831b600000] num:den syntax is deprecated, please
use num/den or named options instead
[yuv4mpegpipe @ 0x7f831b812400] Using AVStream.codec to pass codec
parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, yuv4mpegpipe, to 'out.y4m':
Metadata:
encoder : Lavf57.44.100
Stream #0:0: Video: wrapped_avframe, yuv420p, 176x144 [SAR 93:85 DAR
341:255], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.51.100 wrapped_avframe
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
frame= 25 fps=0.0 q=-0.0 Lsize= 928kB time=00:00:01.00
bitrate=7604.9kbits/s speed= 181x
video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 7691.885254%
}}}
2. stream copy to matroska
{{{
ffmpeg -i out.y4m -c copy sar.mkv
ffmpeg version N-43802-g376d8fb Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-
libfreetype --enable-ffplay --disable-lzma --enable-libopenjpeg --disable-
decoder=jpeg2000 --extra-
cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-
vda
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 51.100 / 57. 51.100
libavformat 57. 44.100 / 57. 44.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 49.100 / 6. 49.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, yuv4mpegpipe, from 'out.y4m':
Duration: 00:00:01.00, start: 0.000000, bitrate: 7604 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 176x144,
SAR 93:85 DAR 341:255, 25 fps, 25 tbr, 25 tbn, 25 tbc
File 'sar.mkv' already exists. Overwrite ? [y/N] y
[matroska @ 0x7fa19882ac00] Using AVStream.codec to pass codec parameters
to muxers is deprecated, use AVStream.codecpar instead.
Output #0, matroska, to 'sar.mkv':
Metadata:
encoder : Lavf57.44.100
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 176x144
[SAR 93:85 DAR 341:255], q=2-31, 25 fps, 25 tbr, 1k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 25 fps=0.0 q=-1.0 Lsize= 930kB time=00:00:00.96
bitrate=7925.7kbits/s speed= 556x
video:928kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.175610%
}}}
3. ffmpeg -i of out.mkv
{{{
ffmpeg -i sar.mkv
ffmpeg version N-43802-g376d8fb Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-
libfreetype --enable-ffplay --disable-lzma --enable-libopenjpeg --disable-
decoder=jpeg2000 --extra-
cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-
vda
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 51.100 / 57. 51.100
libavformat 57. 44.100 / 57. 44.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 49.100 / 6. 49.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from 'sar.mkv':
Metadata:
ENCODER : Lavf57.44.100
Duration: 00:00:01.00, start: 0.000000, bitrate: 7616 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 176x144,
SAR 193:176 DAR 193:144, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
Metadata:
DURATION : 00:00:01.000000000
At least one output file must be specified
ifi-mac-pro:~ admin$
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5743#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list