Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


Prores multiple monochannels to AAC 2.0, sound cut halfway

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

Prores multiple monochannels to AAC 2.0, sound cut halfway

Postby dragmore88 » Sun Apr 02, 2017 4:45 pm

hi. Im trying to encode a stereo LC-AAC track from 2 monotracks in a 10000 frame PRO-RES source file.
I get a aac compliant file but only ca. 5000 frames worth.. midways in playing the video i get silence. From what i can see in mediainfo, the audiotrack is exactly half of the videos length..

Workflow:

1. Extract 10000 frames from the prores

Code: Select all
ffmpeg -ss 00:10:10 -i JUNGLES_HDR.mov -map 0:v -vcodec copy -map 0:a -acodec copy -frames 1000 output.mov


2. Encode prores to hevc:

Pass1:
Code: Select all
ffmpeg -i "output2.mov" -strict -1 -vf scale=out_color_matrix=bt2020nc:out_h_chr_pos=0:out_v_chr_pos=0,format=yuv420p10 -an -r 25 -f yuv4mpegpipe - | "x265.exe" --y4m - --output-depth 10 --input-res 3840x2160 --fps 25 --preset veryslow --b-adapt 2 --ref 4 --open-gop --keyint 48 --profile main10 --level-idc 5.1 --no-high-tier --sar 1:1 --colorprim bt2020 --transfer smpte-st-2084 --colormatrix bt2020nc --b-pyramid --bframes 4 --hrd --vbv-bufsize 35000 --bitrate 35000 --vbv-maxrate 40000 --slow-firstpass --pass 1 --stats "test_HDR10.stats" --aud --chromaloc 2 --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,0.0050)" --output nul


Pass2:
Code: Select all
ffmpeg -i "output2.mov" -strict -1 -vf scale=out_color_matrix=bt2020nc:out_h_chr_pos=0:out_v_chr_pos=0,format=yuv420p10 -an -r 25 -f yuv4mpegpipe - | "x265.exe" --y4m - --output-depth 10 --input-res 3840x2160 --fps 25 --preset slow --b-adapt 2 --ref 4 --open-gop --keyint 48 --profile main10 --level-idc 5.1 --no-high-tier --sar 1:1 --colorprim bt2020 --transfer smpte-st-2084 --colormatrix bt2020nc --b-pyramid --bframes 4 --hrd --vbv-bufsize 35000 --bitrate 35000 --vbv-maxrate 40000 --slow-firstpass --pass 2 --stats "test_HDR10.stats" --aud --chromaloc 2 --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,0.0050)" --output "test_HDR10.hevc"



3. Encode prores to aac:

Code: Select all
E:\>ffmpeg -i "output2.mov" -codec:a aac -strict -2 -filter_complex [0:a:0][0:a:1]amerge test.aac
ffmpeg version N-82909-g0ed4993 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 6.2.0 (Rev2, Built by MSYS2 project)
  configuration:  --enable-avisynth --enable-gmp --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --disable-w32threads --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libwebp --enable-libxavs --enable-libxvid --enable-libzimg --enable-libsnappy --enable-gpl --enable-nvenc --enable-version3 --enable-filter=frei0r --disable-debug
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 70.100 / 57. 70.100
  libavformat    57. 61.100 / 57. 61.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Guessed Channel Layout for Input Stream #0.6 : mono
Guessed Channel Layout for Input Stream #0.7 : mono
Guessed Channel Layout for Input Stream #0.8 : mono
Guessed Channel Layout for Input Stream #0.9 : mono
Guessed Channel Layout for Input Stream #0.10 : mono
Guessed Channel Layout for Input Stream #0.11 : mono
Guessed Channel Layout for Input Stream #0.12 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output2.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.61.100
  Duration: 00:06:40.00, start: 0.000000, bitrate: 738853 kb/s
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(progressive), 3840x2160, 731648 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Apple ProRes 422 HQ
      timecode        : 09:59:30:00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:7(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:8(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:9(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:10(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:11(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:12(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:13(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : DataHandler
      timecode        : 09:59:30:00
[Parsed_amerge_0 @ 000001c39f13aaa0] No channel layout for input 1
[Parsed_amerge_0 @ 000001c39f13aaa0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, adts, to 'test.aac':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.61.100
    Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      encoder         : Lavc57.70.100 aac
Stream mapping:
  Stream #0:1 (pcm_s24le) -> amerge:in0
  Stream #0:2 (pcm_s24le) -> amerge:in1
  amerge -> Stream #0:0 (aac)
Press [q] to stop, [?] for help
size=    3381kB time=00:03:27.76 bitrate= 133.3kbits/s speed=16.9x
video:0kB audio:3314kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.008857%
[aac @ 000001c39f12e300] Qavg: 545.592


4. use mkvtoolnix to merge

Anyone know why this is happning?
dragmore88
 
Posts: 3
Joined: Sun Apr 02, 2017 4:38 pm

Re: Prores multiple monochannels to AAC 2.0, sound cut halfw

Postby mulvya » Sun Apr 02, 2017 5:09 pm

My guess is that your frames option in Step 1 is being applied to all streams. Audio frames != Video frames. Substitute with -frames:v 10000 and check.
mulvya
 
Posts: 534
Joined: Mon Oct 26, 2015 6:58 am

Re: Prores multiple monochannels to AAC 2.0, sound cut halfw

Postby dragmore88 » Sun Apr 09, 2017 9:50 pm

u were correct sir! thx ;)
dragmore88
 
Posts: 3
Joined: Sun Apr 02, 2017 4:38 pm


Return to ffmpeg

Who is online

Users browsing this forum: No registered users and 12 guests