Trying to create matching multi-audio-track mp4s from ProRes sources

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to create matching multi-audio-track mp4s from ProRes sources

Harvey Pikelberger
I've got a bunch of 4- and 5-audio-track ProRes sources.
I want to create h.264/mp4 proxies of each, matching the source audio assigns
The FFmpeg code I'm using is tripping up over time code and codec issues.

Here's the code:
-i '/Path/To/ProRes/Source.mov' -map 0 -g 48 -c:v libx264 -profile:v baseline -crf 16 -c:a aac -b:a 256k -vf scale=1280:720 -pix_fmt yuv420p '/Path/To/Mp4/Dest.mp4'

As I understand -map 0 is what conforms the audio assigns.
Not sure what -g 48 is doing, but removing still gets errors.

Here are the errors:
[mp4 @ 0x7fe633006000] You requested a copy of the original timecode track so timecode metadata are now ignored
[mp4 @ 0x7fe633006000] Could not find tag for codec none in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
[aac @ 0x7fe633801e00] Qavg: nan
Conversion failed!



Here's the full console output:
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libspeex --enable-videotoolbox
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Guessed Channel Layout for Input Stream #0.1 : 5.0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Path/To/ProRes/Source.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  ARRI
    creation_time   : 2019-01-30T12:47:45.000000Z
    com.apple.finalcutstudio.media.uuid: 3D1B7ACC-EAFF-477C-AFB7-7FC259FA0B59
    com.arri.camera.CameraId: R0TS
    com.arri.camera.CameraIndex: A
    com.arri.camera.CameraModel: ARRI ALEXA Mini
    com.arri.camera.CameraSerialNumber: 21072
    com.arri.camera.ColorGammaSxS: LOG-C
    com.arri.camera.ExposureIndexAsa: 800
    com.arri.camera.LookFileBurnedIn: No
    com.arri.camera.ProductionInfoOperator:
    com.arri.camera.NdFilterDensity: 0
    com.arri.camera.NdFilterType: 0
    com.arri.camera.ProductionInfoCinematographer:
    com.arri.camera.ProductionInfoDirector:
    com.arri.camera.ProductionInfoLocation:
    com.arri.camera.ProductionInfoProduction:
    com.arri.camera.ProductionInfoUser1:
    com.arri.camera.ProductionInfoUser2:
    com.arri.camera.ProjectFps: 23976
    com.arri.camera.ReelName: A001R0TS
    com.arri.camera.SensorFps: 23976
    com.arri.camera.ShutterAngle: 1800
    com.arri.camera.SoundReel:
    com.arri.camera.SupVersion: 5.04.13
    com.arri.camera.SxsSerialNumber: 31256162323390004845
    com.arri.camera.UserDate: 20190130
    com.arri.camera.UserTime: 12h47m45
    com.arri.camera.WhiteBalanceKelvin: 5000
    com.arri.camera.WhiteBalanceTintCc: 0
    com.arri.camera.CameraClipName: A001C001_190130_R0TS.mov
    com.arri.camera.Product: 2
    com.arri.camera.SubProduct: 1
    com.arri.camera.look.name: ARRI 709.AML
    com.arri.camera.look.user_lut: 0
    com.apple.proapps.color.asc-cdl:
    com.arri.camera.look.lut3d:
    com.arri.camera.look.lut3d_with_cdl:
    com.arri.camera.look.video_param_with_target_colorspace:
    com.arri.camera.ProductionInfoCompany:
    com.arri.camera.SceneName:
    com.arri.camera.TakeName:
    com.arri.camera.audio.Configuration:
    com.arri.camera.LensSerialNumber: 13054
    com.arri.camera.LensType: Fujinon Alura AZ30-80 T2.8
    com.arri.camera.UnitPreference: Metric
    com.arri.camera.WbTracking: 0
    com.arri.camera.ImageOrientation: 0
    com.arri.camera.ImageSharpness: 0
    com.arri.camera.ImageDetail: 0
    com.arri.camera.ImageDenoising: 0
    com.arri.camera.DynamicMetadataVersion: 65536
    com.arri.camera.audio.BluetoothEnabled: 0
    com.arri.camera.sensor.PhotoSites: 3200x1800
    com.arri.camera.PixelAspectRatio: 0.000000
    com.arri.camera.FramelineFileName1: None
    com.arri.camera.UserPixelMasking: 0
    com.arri.camera.EfIsActive: 0
    timecode        : 12:50:58:15
  Duration: 00:32:55.85, start: 0.000000, bitrate: 994138 kb/s
    Stream #0:0(eng): Video: prores (ap4h / 0x68347061), yuv444p10le(tv, GBR, progressive), 3840x2160, 988342 kb/s, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 24k tbn, 24k tbc (default)
    Metadata:
      creation_time   : 2019-01-30T12:47:45.000000Z
      handler_name    : ?Apple Video Media Handler
      encoder         : Apple ProRes 4444
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 5.0, s32 (24 bit), 5760 kb/s (default)
    Metadata:
      creation_time   : 2019-01-30T12:47:45.000000Z
      handler_name    : ?Apple Sound Media Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2019-01-30T12:47:45.000000Z
      handler_name    : ?Time Code Media Handler
      reel_name       : A001R0TS
      timecode        : 12:50:58:15
Stream mapping:
  Stream #0:0 -> #0:0 (prores (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s24le (native) -> aac (native))
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x7fe633800600] using SAR=1/1
[libx264 @ 0x7fe633800600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fe633800600] profile Constrained Baseline, level 3.1
[libx264 @ 0x7fe633800600] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=48 keyint_min=4 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=16.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7fe633006000] You requested a copy of the original timecode track so timecode metadata are now ignored
[mp4 @ 0x7fe633006000] Could not find tag for codec none in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
[aac @ 0x7fe633801e00] Qavg: nan
Conversion failed!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to create matching multi-audio-track mp4s from ProRes sources

kumowoon1025
> On Feb 13, 2019, at 12:02 PM, Harvey Pikelberger <[hidden email]> wrote:
>
> [mp4 @ 0x7fe633006000] You requested a copy of the original timecode track so timecode metadata are now ignored
> [mp4 @ 0x7fe633006000] Could not find tag for codec none in stream #2, codec not currently supported in container
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

I wonder if adding -f mov to the output options, or just using mov extension makes it handle the timecode track?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to create matching multi-audio-track mp4s from ProRes sources

Gyan
In reply to this post by Harvey Pikelberger


On 13-02-2019 10:32 PM, Harvey Pikelberger wrote:

> I've got a bunch of 4- and 5-audio-track ProRes sources.
> I want to create h.264/mp4 proxies of each, matching the source audio assigns
> The FFmpeg code I'm using is tripping up over time code and codec issues.
>
> Here's the code:
> -i '/Path/To/ProRes/Source.mov' -map 0 -g 48 -c:v libx264 -profile:v baseline -crf 16 -c:a aac -b:a 256k -vf scale=1280:720 -pix_fmt yuv420p '/Path/To/Mp4/Dest.mp4'
>
> As I understand -map 0 is what conforms the audio assigns.
> Not sure what -g 48 is doing, but removing still gets errors.
>
> Here are the errors:
> [mp4 @ 0x7fe633006000] You requested a copy of the original timecode track so timecode metadata are now ignored
> [mp4 @ 0x7fe633006000] Could not find tag for codec none in stream #2, codec not currently supported in container
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
> Error initializing output stream 0:1 --
> [aac @ 0x7fe633801e00] Qavg: nan
> Conversion failed!
>

`-map 0` maps all streams for output including those that the output may
not be able to handle, like the single-packet timecode stream. However,
ffmpeg will copy it using the metadata entry created when reading the input.

So, unmap the data streams,

     -i '/Path/To/ProRes/Source.mov' -map 0 0 -map -0:d -g 48 -c:v
libx264 -profile:v baseline -crf 16 -c:a aac -b:a 256k -vf
scale=1280:720 -pix_fmt yuv420p '/Path/To/Mp4/Dest.mp4'

Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to create matching multi-audio-track mp4s from ProRes sources

Gyan


On 14-02-2019 12:27 AM, Gyan wrote:
>
>
> On 13-02-2019 10:32 PM, Harvey Pikelberger wrote:
>
>
>     -i '/Path/To/ProRes/Source.mov' -map 0 -map -0:d -g 48 -c:v
> libx264 -profile:v baseline -crf 16 -c:a aac -b:a 256k -vf
> scale=1280:720 -pix_fmt yuv420p '/Path/To/Mp4/Dest.mp4'
>

Oops,  removed the stray 0.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to create matching multi-audio-track mp4s from ProRes sources

Harvey Pikelberger
In reply to this post by kumowoon1025
> On Feb 13, 2019, at 10:04 AM, Ted Park <[hidden email]> wrote:
>
> I wonder if adding -f mov to the output options, or just using mov extension makes it handle the timecode track?



Thanks Ted.

I'm not familiar with the -f option and didn't immediately find it in the FFmpeg documentation
How does that work?

Tried simply switching to the .mov extension instead of .mp4
The tracks mapped properly, the quality is good, and -- though it didn't occur to me until your suggestion -- .mov is preferable to .mp4 for our workflow.
So thanks for the suggestion.  An "obvious" idea that only became obvious after you suggested it.

BUT for some reason the time code changed.  So a clip that had started at TC start/end of 12:31:20:13 / 12:31:42:16 converted to 12:30:35:12 / 12:30:57:15.
Duration matches, frame rate matches, but the start/end TCs are earlier by 45:01.




> On Feb 13, 2019, at 10:57 AM, Gyan <[hidden email]> wrote:
>
> unmap the data streams,
>
>     -i '/Path/To/ProRes/Source.mov' -map 0 -map -0:d -g 48 -c:v libx264 -profile:v baseline -crf 16 -c:a aac -b:a 256k -vf scale=1280:720 -pix_fmt yuv420p '/Path/To/Mp4/Dest.mp4'


Gyan
-map -0:d fixed the problem entirely.
Audio Tracks are good / TC is good both for .mov and .mp4

Any idea why failing to un-map the data streams causes the time code to change?

Thanks to both of you.  Very helpful!!



_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trying to create matching multi-audio-track mp4s from ProRes sources

kumowoon1025
> On Feb 13, 2019, at 3:01 PM, Harvey Pikelberger <[hidden email]> wrote:
>
> BUT for some reason the time code changed.  So a clip that had started at TC start/end of 12:31:20:13 / 12:31:42:16 converted to 12:30:35:12 / 12:30:57:15.

The 0.1% change makes me think the timecode was converted to/from drop frame. Take another look at the separator before sub-second time to see if they really are both “:”

> I'm not familiar with the -f option and didn't immediately find it in the FFmpeg documentation
> How does that work?

It sets the output file format, overriding what is guessed from the filename extension. There are some subtle (and some not so subtle) differences between quicktime, iso base media and mp4 formats. Files with timecode and edit list from an NLE, sometimes with references to external files = qt in my mind.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".