[FFmpeg-user] Force input format for video and audio / Mapping streams to the correct encoders/muxers

racer at gmx.ch racer at gmx.ch
Fri Aug 24 01:00:00 EEST 2018


Hi ffmegy's and ffmegers,

 

I'm trying to get a conversion to a youtube compatible format to work. Imho,
with this one it means, converting the audio from PCM se24be to, say, aac,
since when uploading, I only get noise/static on the audio. Without using
-f, I get the same noise on the audio after conversion, as I get when
uploading Test1.mp4 directly to Youtube. So, I figured, I should define the
input, but can't get it to work. I could be only a mapping problem.

 

The input file showing all the available streams:

 

C:\Downloads>ffmpeg -i "Test1.mp4"

ffmpeg version N-91655-g7e0df5910e Copyright (c) 2000-2018 the FFmpeg
developers

  built with gcc 8.2.1 (GCC) 20180813

  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
--enable-avisynth

  libavutil      56. 19.100 / 56. 19.100

  libavcodec     58. 24.101 / 58. 24.101

  libavformat    58. 17.103 / 58. 17.103

  libavdevice    58.  4.101 / 58.  4.101

  libavfilter     7. 26.100 /  7. 26.100

  libswscale      5.  2.100 /  5.  2.100

  libswresample   3.  2.100 /  3.  2.100

  libpostproc    55.  2.100 / 55.  2.100

Guessed Channel Layout for Input Stream #0.1 : stereo

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Test1.mp4':

  Metadata:

    major_brand     : isom

    minor_version   : 1

    compatible_brands: iso4avc1isom

    creation_time   : 2018-08-18T02:41:11.000000Z

  Duration: 00:02:47.26, start: 0.000000, bitrate: 13724 kb/s

    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
bt709, progressive), 1920x1080, 10539 kb/s, SAR 1:1 DAR 16:9, 50 fps, 50
tbr, 50 tbn, 100 tbc (default)

    Metadata:

      creation_time   : 2018-08-18T02:41:11.000000Z

      handler_name    : ?Apple Video Media Handler

      encoder         : H264/AVC

      timecode        : 00:00:00:00

    Stream #0:1(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz,
stereo, s32 (24 bit), 2304 kb/s (default)

    Metadata:

      creation_time   : 2018-08-18T02:41:11.000000Z

      handler_name    : ?Apple Sound Media Handler

      timecode        : 00:00:00:00

    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)

    Metadata:

      creation_time   : 2018-08-18T02:41:11.000000Z

      handler_name    : ?Time Code Media Handler

      timecode        : 00:00:00:00                     

 

 

 

 

This seems to define the first stream as a pcm format, ignoring the rest,
but see for yourselves. Note, that the video stream seems to be totally
omitted. What am I missing here? Do I need to map the streams?

 

C:\Downloads>ffmpeg -f s24be -sample_rate 48000 -ac 2 -i "Test1.mp4" -c:v
copy -c:a aac -b:a 192k Test1_converted.mp4

ffmpeg version N-91655-g7e0df5910e Copyright (c) 2000-2018 the FFmpeg
developers

  built with gcc 8.2.1 (GCC) 20180813

  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
--enable-avisynth

  libavutil      56. 19.100 / 56. 19.100

  libavcodec     58. 24.101 / 58. 24.101

  libavformat    58. 17.103 / 58. 17.103

  libavdevice    58.  4.101 / 58.  4.101

  libavfilter     7. 26.100 /  7. 26.100

  libswscale      5.  2.100 /  5.  2.100

  libswresample   3.  2.100 /  3.  2.100

  libpostproc    55.  2.100 / 55.  2.100

[s24be @ 000002029294ad40] Estimating duration from bitrate, this may be
inaccurate

Guessed Channel Layout for Input Stream #0.0 : stereo

Input #0, s24be, from 'Test1.mp4':

  Duration: 00:16:36.32, bitrate: 2303 kb/s

    Stream #0:0: Audio: pcm_s24be, 48000 Hz, stereo, s32 (24 bit), 2304 kb/s

Stream mapping:

  Stream #0:0 -> #0:0 (pcm_s24be (native) -> aac (native))

Press [q] to stop, [?] for help

Output #0, mp4, to 'Test1_converted.mp4':

  Metadata:

    encoder         : Lavf58.17.103

    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
(24 bit), 192 kb/s

    Metadata:

      encoder         : Lavc58.24.101 aac

[pcm_s24be @ 00000202929a8f40] Multiple frames in a packet.d=74.6x

[pcm_s24be @ 00000202929a8f40] Invalid PCM packet, data has size 4 but at
least a size of 6 was expected

Error while decoding stream #0:0: Invalid data found when processing input

size=   23508kB time=00:16:36.33 bitrate= 193.3kbits/s speed=74.6x

video:0kB audio:23325kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.786819%

[aac @ 00000202929cc0c0] Qavg: 395.107

 

 

I appreciate your help on this.

 

Thank you and best regards.

Urs

 

 



More information about the ffmpeg-user mailing list