1

i try to convert a mp4 movie taken by an galaxy s5 into dvnxhd but without success.

Here is my command:

ffmpeg -i "/media/elomin/20170805_221129.mp4" 
-map 0:0 -map 0:1 -threads 4 -aspect 16:9 -y 
-f mov -acodec pcm_s16le -b:a 256k -ar 48000 
-ac 2 -b:v 45000k -r 30.00 -vcodec dnxhd 
"/home/elomin/Videos/studio_test_1.mov"

An the output is:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/media/elomin/20170805_221129.mp4':

Metadata:
major_brand     : isom
minor_version   : 0
compatible_brands: isom3gp4
creation_time   : 2017-08-05 20:13:02
Duration: 00:01:32.12, start: 0.000000, bitrate: 17050 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16985 kb/s, 29.98 fps, 30 tbr, 90k tbn, 180k tbc (default)

Metadata:
rotate          : 270
creation_time   : 2017-08-05 20:13:02
handler_name    : VideoHandle
Side data:
displaymatrix: rotation of 90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)

Metadata:
creation_time   : 2017-08-05 20:13:02
handler_name    : SoundHandle

[dnxhd @ 0xed7500] video parameters incompatible with DNxHD. Valid DNxHD profiles:

...
[dnxhd @ 0xed7500] Frame size: 1920x1080p; bitrate: 45Mbps; pixel format: yuv422p; framerate: 30000/1001
...


Output #0, mov, to '/home/elomin/Videos/studio_test_1.mov':

Metadata:
major_brand     : isom
minor_version   : 0
compatible_brands: isom3gp4
Stream #0:0(eng): Video: dnxhd, none, q=2-31, 128 kb/s, SAR 256:81 DAR 0:0, 30 fps (default)

Metadata:
handler_name    : VideoHandle
creation_time   : 2017-08-05 20:13:02
encoder         : Lavc56.60.100 dnxhd
Stream #0:1(eng): Audio: pcm_s16le, 0 channels (default)

Metadata:
creation_time   : 2017-08-05 20:13:02
handler_name    : SoundHandle
encoder         : Lavc56.60.100 pcm_s16le
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> dnxhd (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

whats wrong here? Or isn‘t it possible to convert the orig. video in this format?

andrew.46
  • 39,359
Ben Wgr
  • 11

1 Answers1

1

As my colleague has pointed out there is a fixed set of frame sizes matched with a few other vital parameters for dnxhd encoding with FFmpeg.

For your file the following slightly simplified command line should achieve your goal:

ffmpeg -i "/media/elomin/20170805_221129.mp4" \
       -c:a pcm_s16le \
       -c:v dnxhd -vf scale=1920x1080,fps=24000/1001,format=yuv422p -b:v 115M  \
       "/home/elomin/Videos/studio_test_1.mov"

You do not actually need to rescale as your input video is the correct size for dnxhd but I leave it included to demonstrate the required syntax if the input video has incorrect dimensions.

References:

andrew.46
  • 39,359