mlt icon indicating copy to clipboard operation
mlt copied to clipboard

melt - command-line: 8fps to 25fps

Open andchir opened this issue 8 years ago • 3 comments

melt 6.3.0

Input video: 8 fps, 5 min 19 sec

My command:

/usr/bin/melt \
"/var/www/userfiles/input/1/1478553451_5820ef6b72975.mp4" \
-consumer avformat:"/var/www/userfiles/output/out.mp4" \
width=640 height=360 display_aspect_num=16 display_aspect_den=9 r=25 vcodec=libx264 vb=1228800 acodec=aac ab=128k frequency=44100 deinterlace=1

Output video: 25 fps, 5 min 19 sec - GOOD!

But if I render from XML, I have problem.

Command 1:

/usr/bin/melt \
"/var/www/userfiles/input/1/1478553451_5820ef6b72975.mp4" \
-consumer xml:/var/www/userfiles/tmp/1/5820f57887283.mlt

Command 2:

/usr/bin/melt \
xml:"/var/www/userfiles/tmp/1/5820f57887283.mlt" \
-consumer avformat:"/var/www/userfiles/output/1/1478555000.mp4" \
width=640 height=360 display_aspect_num=16 display_aspect_den=9 r=25 vcodec=libx264 vb=1228800 acodec=aac ab=128k frequency=44100 deinterlace=1

Output video: 25fps, 1 min 40 sec

Video is cuted.

2515 / 25 / 60 / 60 = 1 min 40 sec

How do I fix this?

XML:

<?xml version="1.0" encoding="utf-8"?>
<mlt LC_NUMERIC="C" version="6.3.0" root="/var/www/" title="1478553451_5820ef6b72975.mp4">
  <profile description="automatic" width="1280" height="720" progressive="1" sample_aspect_num="1" sample_aspect_den="1" display_aspect_num="1280" display_aspect_den="720" frame_rate_num="10064" frame_rate_den="1277" colorspace="709"/>
  <producer id="producer0" in="0" out="2515">
    <property name="length">2516</property>
    <property name="eof">pause</property>
    <property name="resource">userfiles/input/1/1478553451_5820ef6b72975.mp4</property>
    <property name="meta.media.nb_streams">2</property>
    <property name="meta.media.0.stream.type">video</property>
    <property name="meta.media.0.stream.frame_rate">7.88097</property>
    <property name="meta.media.0.stream.sample_aspect_ratio">0</property>
    <property name="meta.media.0.codec.width">1280</property>
    <property name="meta.media.0.codec.height">720</property>
    <property name="meta.media.0.codec.rotate">0</property>
    <property name="meta.media.0.codec.frame_rate">8</property>
    <property name="meta.media.0.codec.pix_fmt">yuv420p</property>
    <property name="meta.media.0.codec.sample_aspect_ratio">1</property>
    <property name="meta.media.0.codec.colorspace">709</property>
    <property name="meta.media.0.codec.color_trc">1</property>
    <property name="meta.media.0.codec.name">h264</property>
    <property name="meta.media.0.codec.long_name">H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10</property>
    <property name="meta.media.0.codec.bit_rate">1079736</property>
    <property name="meta.attr.0.stream.handler_name.markup">VideoHandler</property>
    <property name="meta.media.1.stream.type">audio</property>
    <property name="meta.media.1.codec.sample_fmt">fltp</property>
    <property name="meta.media.1.codec.sample_rate">44100</property>
    <property name="meta.media.1.codec.channels">2</property>
    <property name="meta.media.1.codec.name">aac</property>
    <property name="meta.media.1.codec.long_name">AAC (Advanced Audio Coding)</property>
    <property name="meta.media.1.codec.bit_rate">191999</property>
    <property name="meta.attr.1.stream.creation_time.markup">2016-10-31 20:42:38</property>
    <property name="meta.attr.1.stream.handler_name.markup">IsoMedia File Produced by Google, 5-11-2011</property>
    <property name="meta.attr.major_brand.markup">mp42</property>
    <property name="meta.attr.minor_version.markup">0</property>
    <property name="meta.attr.compatible_brands.markup">isommp42</property>
    <property name="meta.attr.creation_time.markup">2016-10-31 20:42:38</property>
    <property name="seekable">1</property>
    <property name="meta.media.sample_aspect_num">1</property>
    <property name="meta.media.sample_aspect_den">1</property>
    <property name="aspect_ratio">1</property>
    <property name="audio_index">1</property>
    <property name="video_index">0</property>
    <property name="mute_on_pause">1</property>
    <property name="mlt_service">avformat</property>
  </producer>
  <playlist id="playlist0">
    <entry producer="producer0" in="0" out="2515"/>
  </playlist>
  <tractor id="tractor0" title="1478553451_5820ef6b72975.mp4" global_feed="1" in="0" out="2515">
    <track producer="playlist0"/>
  </tractor>
</mlt>

andchir avatar Nov 07 '16 22:11 andchir

In command 1, you can specify a profile with 25 fps using the -profile option.

It seems there is a bug such that time values (in frames) are not interpreted according to the in the XML but according to the overriding frame rate specified on the consumer in command 2.

ddennedy avatar Nov 07 '16 23:11 ddennedy

I added "-profile hdv_1080_25p" to Command 1 And now everything seems fine. Thank you for your help!

andchir avatar Nov 07 '16 23:11 andchir

@andchir I hope you are doing well. Could you help me? I am facing an issue to convert to convert video.

I got the following error.

/usr/local/Cellar/mlt/7.4.0_2/bin/melt /tmp/templates/template-001/40288ac07f0d38bf017f0d456be100ab.mlt -consumer avformat:/tmp/templates/template-001/40288ac07f0d38bf017f0d456be100ab.mp4
mlt_repository_init: no plugins found in "/usr/local/Cellar/mlt/7.4.0_2/PlugIns/mlt"

devbinod avatar Feb 18 '22 16:02 devbinod