[FFmpeg-user] MXF to MP4 Conversion Problem

tsnider tim at spotmpg.com
Sat Sep 24 16:57:00 EEST 2016


Hello, I'm using a script that uses the command line to convert a video file
to a smaller size and embed the timecode track visually on the output. This
works great when working with H264 Quicktime Files, etc. I'm now trying to
get this to work with H264 MXF files from a Canon C300 MK II camera. I have
luck with some files and then no luck with others from the same camera. I'm
not sure if I'm missing a step, etc. Any help would be greatly appreciated.
Below I will paste the script and also the console output.

THE SCRIPT
#!/bin/sh
in="/Users/tsnider/Desktop/L078C154_160919JV_LHEN1_P.MXF"
out="/Users/tsnider/Desktop/ffmpeg_Test_Scripts/output/TEST_L051C378_160804A9_LHEN1_TEST.MP4"
fps_rate="23.98"
font="/Library/Fonts/Andale Mono.ttf"
fontsize=34
position="x=(w-tw)/2: y=h-(2*lh)" #"x=w-text_w-(text_w/6):y=text_h" # top
right
timecode=$(/Applications/Dubby.app/Contents/Resources/ffmpeg  -i "$in" 2>&1
| awk '$1 ~ /^timecode/ {print $NF}' )
tc_escaped=${timecode//:/\\:}

crf=30 #25 was default 26 was setting
preset=fast # (superfast, fast, slow, ...) fast

/Applications/Dubby.app/Contents/Resources/ffmpeg  -threads 0 -i "$in"
-acodec copy -vcodec  libx264 -preset $preset -crf $crf -deinterlace  -vf
"scale=640:360, drawtext=fontfile=$font: timecode='$tc_escaped':
r=$fps_rate: $position: fontcolor=white: fontsize=$fontsize: box=1:
boxcolor=black at 1: boxborderw=5" "$out"

HERE IS THE OUTPUT I'M GETTING
ffmpeg version 3.1.1-tessus Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm
--extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl
--enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopus --enable-libschroedinger
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265
--enable-libxavs --enable-libxvid --enable-libzmq --enable-version3
--disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0x7fddb482be00] Truncating likely oversized PPS
    Last message repeated 3 times
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
Input #0, mxf, from '/Users/tsnider/Desktop/L078C154_160919JV_LHEN1_P.MXF':
  Metadata:
    uid             : 3ac93850-7605-4901-802a-a02232400093
    generation_uid  : 3ac93850-7605-4903-802a-a02232400093
    company_name    : CANON
    product_name    : EOS C300 Mark II
    product_version : 1.00
    product_uid     : 060e2b34-0401-010d-0e15-0056454f0200
    modification_date: 2016-09-19 11:50:09
    material_package_umid:
0x060A2B340101010501010D43138000008DADD639507605800000852232400093
    timecode        : 11:50:30:21
  Duration: 00:14:18.36, start: 0.000000, bitrate: 16352 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709/bt709/unknown),
1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23.98 tbn, 47.95 tbc
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152
kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152
kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152
kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152
kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
[libx264 @ 0x7fddb4a74c00] using SAR=1/1
[libx264 @ 0x7fddb4a74c00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fddb4a74c00] profile High, level 3.0
[libx264 @ 0x7fddb4a74c00] 264 - core 148 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1
ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 threads=11 lookahead_threads=1
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40
intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=30.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7fddb4a5cc00] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
[mp4 @ 0x7fddb4a5cc00] Could not find tag for codec pcm_s24le in stream #1,
codec not currently supported in container
Output #0, mp4, to
'/Users/tsnider/Desktop/ffmpeg_Test_Scripts/output/TEST_L051C378_160804A9_LHEN1_TEST.MP4':
  Metadata:
    uid             : 3ac93850-7605-4901-802a-a02232400093
    generation_uid  : 3ac93850-7605-4903-802a-a02232400093
    company_name    : CANON
    product_name    : EOS C300 Mark II
    product_version : 1.00
    product_uid     : 060e2b34-0401-010d-0e15-0056454f0200
    modification_date: 2016-09-19 11:50:09
    material_package_umid:
0x060A2B340101010501010D43138000008DADD639507605800000852232400093
    timecode        : 11:50:30:21
    encoder         : Lavf57.41.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
640x360 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
      encoder         : Lavc57.48.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono (24 bit), 1152 kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010D43138000008DADD638507605800000852232400093
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?):
Invalid argument






--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/MXF-to-MP4-Conversion-Problem-tp4677660.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list