[FFmpeg-user] Is pcm_bluray to pcm_s16le lossless?

wtfux wtfux.dev at googlemail.com
Tue Sep 18 21:55:11 CEST 2012


Hello,
this is a short question: Is converting pcm_bluray to pcm_s16le lossless?

Long story:
I got a Blu-Ray m2ts container with:

Input #0, mpegts, from '00003.m2ts':
  Duration: 00:47:23.17, start: 4198.958300, bitrate: 36670 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100]: Audio: pcm_bluray (HDMV / 0x564D4448), 48000 Hz,
stereo, s16, 1536 kb/s

I used this command to mux it into a mkv container while converting
pcm_bluray (with afaik is signed 16bit big endian) to pcm_s16le (signed
16bit little endian) and copying the H.264 stream.
ffmpeg -i 00003.m2ts -c:a pcm_s16le -c:v copy 00003.mkv

Result:

Input #0, matroska,webm, from '00003_wav.mkv':
  Metadata:
    ENCODER         : Lavf54.25.104
  Duration: 00:47:23.17, start: 0.000000, bitrate: 34856 kb/s
    Stream #0:0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9],
23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
(default)

To my understanding this should be lossless, right? But somehow the m2ts
container is 12.1 GB large and the mkv container is 11.5 GB. There are no
further streams or attachments in .m2ts and just copying the h264 stream
shouldn't change the size either. I'm not quite familiar with m2ts
container but that would be a huge overhead for just the container.

I need to be sure that audio didn't loose quality. Please let me know if
you got an idea why the file size is smaller. Thanks.

I also included the log but there doesn't seem to be anything special:


ffmpeg -i 00003.m2ts -c:a pcm_s16le -c:v copy 00003_test.mkv
ffmpeg version git-2012-09-04-3b6e9cd Copyright (c) 2000-2012 the FFmpeg
develop
ers
  built on Sep  6 2012 18:09:41 with gcc 4.7.1 (GCC)
  configuration: --pkg-config=pkg-config --prefix=/root/win32
--enable-memalign-
hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32-
--enable-li
bfaac --enable-libfdk-aac --enable-libx264 --enable-gpl --enable-nonfree
--enabl
e-version3 --enable-avfilter --enable-avisynth
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.103 /  3. 15.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpegts, from '00003.m2ts':
  Duration: 00:47:23.17, start: 4198.958300, bitrate: 36670 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p,
1920x1
080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100]: Audio: pcm_bluray (HDMV / 0x564D4448), 48000 Hz,
stereo
, s16, 1536 kb/s
Output #0, matroska, to '00003_test.mkv':
  Metadata:
    encoder         : Lavf54.25.104
    Stream #0:0: Video: h264 (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR
1:1 DA
R 16:9], q=2-31, 23.98 fps, 1k tbn, 90k tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (pcm_bluray -> pcm_s16le)
Press [q] to stop, [?] for help
frame=  316 fps=0.0 q=-1.0 size=   58333kB time=00:00:13.24
bitrate=36087.1kbits
frame=  620 fps=619 q=-1.0 size=  114283kB time=00:00:25.86
bitrate=36193.1kbits
frame=  945 fps=630 q=-1.0 size=  174947kB time=00:00:39.48
bitrate=36294.6kbits
frame= 1286 fps=643 q=-1.0 size=  237587kB time=00:00:53.73
bitrate=36219.2kbits
frame= 1320 fps=528 q=-1.0 size=  243853kB time=00:00:55.13
bitrate=36230.6kbits
frame= 1458 fps=520 q=-1.0 Lsize=  270550kB time=00:01:01.13
bitrate=36255.0kbit
s/s
...#nothing special here
video:11559471kB audio:533088kB subtitle:0 global headers:0kB muxing
overhead 0.
040539%


More information about the ffmpeg-user mailing list