[Ardour-Users] "Extract LTC from audio and align video" menu option missing from "Transcode/Import Video file" popup

robertlazarski robertlazarski at gmail.com
Sat Apr 7 16:56:06 PDT 2018


Thanks for the help Chris, see my answers inline.

On Thu, Apr 5, 2018 at 8:12 PM, Chris Caudle <chris at chriscaudle.org> wrote:

> On Thu, April 5, 2018 2:30 pm, robertlazarski . wrote:
> > I was not selecting "file timestamp", which explains why I was not seeing
> > the timecode I was expecting in Xjadeo. This option fixed that problem.
>
> OK, I think you are getting close.  I imported the file you created,
> 180404-T004.WAV, and when I selected import at file timestamp it was moved
> to 6:05:27 as expected.
>
> I noticed in your screen capture that there was a message which flashed up
> about sample rate conversion.  Just for future reference you will probably
> want to set your session sample rate to 48k when working with audio for
> video, that is the standard sample rate for essentially all video formats.
>

I was wondering where to fix that, now I know I need to choose 48KHZ when
creating the session - thanks!

>
> > However when choosing that option, I no longer see video in Xjadeo but I
> > do hear audio.
>
> I also do not see video, so I think something is not correct with my
> harvid and xjadeo setup, or there are transcoding problems with the video.
>  I am selecting to resize the video to 820x480 so it won't be full screen
> on my monitor, but I do see individual frame thumbnails in the video
> timeline, so at least some of the video import is happening correctly.
> I see these messages in Ardour log, perhaps indicating a firewall problem,
> or maybe harvid just is not running correctly:
> HTTP request failed: (7) Failed to connect to 127.0.0.1 port 1554:
> Connection refused
>
> Other than that, I still do not have the video import lining up correctly
> on the timeline.
> This is what I have done so far to try to debug, maybe one of the ardour
> devs or someone else using timecode will recognize what is going on:
>
> In the session/openvideo dialog, after selecting the file and the second
> dialog opens, I select extract audio, click the checkbox for extract LTC
> and align video, and also the checkbox for debug mode.  That should log
> the output from ffmpeg so you can see if there are any errors transcoding
> the video, or extracting the audio, but I do not see as many messages from
> ffmpeg as I expected showing up in the ardour log.
>
> After importing the video, it is lined up about a minute later than the
> audio in the timeline.
> Checking the Ardour log window, I see these messages:
> [WARNING]: Failed to set session-framerate: '29.917' does not have a
> corresponding option setting in Ardour.
> [WARNING]: Video file's framerate is not equal to Ardour session
> timecode's framerate: '29.917' vs '30'
> [INFO]: Align video-start to 1055787966 [samples]
>
> I have my session set to 48k, so 10557887966/48000 is around 367 minutes,
> or
> about 6 hours and 6 minutes, so that matches where it is place in the
> timeline.
> What I don't see is any message about timecode count or any indication of
> how that sample count was derived.
>
> I'm also not sure where that 29.917 frame rate came from.
>
> Looking at the video file info with ffmpeg -i I see  this information
> about the video stream:
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20180405_060536.mp4':
>   Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: isommp42
>     creation_time   : 2018-04-05T12:06:20.000000Z
>     com.android.version: 7.0
>   Duration: 00:00:42.29, start: 0.000000, bitrate: 17200 kb/s
>     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
> bt709), 1920x1080, 16984 kb/s, SAR 1:1 DAR 16:9, 29.89 fps, 29.92 tbr,
> 90k tbn, 180k tbc (default)
>     Metadata:
>       creation_time   : 2018-04-05T12:06:20.000000Z
>       handler_name    : VideoHandle
>
> Note the frame rate of 29.89 frames per second.  That does not match a
> common video frame rate ( I would expect either 30 frames per second, or
> 29.979 frames per second, but not 29.89).
> Perhaps that is just a round off error because the video is short, but it
> also doesn't match the 29.917 value that Ardour printed.
>
> So I went to Session/RemoveVideo, then Session/Properties, and in the
> Timecode frames-per-second setting change to 29.97 so that the session is
> manually set to 29.97 (you cannot enter arbitrary values, so there is no
> way to see what happens if I set the session frame rate to the 29.917 that
> the video is detected as having).
>
> I went back to Session/OpenVideo, find your file again, and uncheck the
> "Adjust session framerate to match video framerate" selection box.
>
> After that in the Ardour log I still see this:
> [WARNING]: Video file's framerate is not equal to Ardour session
> timecode's framerate: '29.917' vs '29.97'
> [INFO]: Align video-start to 1055787966 [samples]
>
> The sample value used for alignment is still the same, changing the
> session frame rate from 30fps to 29.97fps did not change that.
>
> Possibly the discontinuity message displayed by ltcdump from the beginning
> of the video file audio track is confusing the Ardour import.  Try cutting
> the input gain on your audio interface until the timecode is coming in at
> around -12dB or -15dB.
>
> Other than that I don't have any ideas yet of what could be throwing off
> the timeline calculation.
> Maybe Robin knows how to get more verbose logs from Ardour as it imports.
>
>
> --
> Chris Caudle
>
>
>
I seen these errors too but I was not sure what they meant. My harvid
server is seemingly working.

I tried a few things but I am still stuck with no video, as both us are
experiencing:

1) I put a preamp (Sound Devices usbpre2) with nice meters in between the
F8 and the Irig DUO interface that goes to the phone. I tweaked the levels
until the LTC and scratch track peaked at -20DB on its outputs.
Unfortunately I still see the DISCONTINUITY message from ltcdump. And it
didn't help in Ardour.

I'd be willing to post more files if that would be helpful.

2) These frame rate issues are strange, but I tried several Android phones
and none of them show exactly 30 fps according to ffmpeg. So I re-encoded a
phone video with ffmpeg to 30 fps. See below for the command. That seemed
to fix the log errors, but I still see no video. I can only see video, when
I don't set the import on the F8 wav to use the file timestamp. When the F8
file is imported using session start at 00:00:00 I can see video but the
audio comes in about as late as the delay from pressing start on the F8 to
pressing start on the camera.

ffmpeg -i VID_20180407_131539.mp4  -r 30 output.mp4

3) See below for the logs. I couldn't figure out how to increase logging.
I'd be willing to try to debug the source, since I compiled the source -
that took several hours though so any tips how I could only compile a
relevant module or something would be helpful.

[linux-7cab(iksrazal)]
 /home/iksrazal> ardour5
bind txt domain [gtk2_ardour5] to /usr/local/share/ardour5/locale
Ardour5.12.0 (built using 5.12 and GCC version 4.8.5)
ardour: [INFO]: Your system is configured to limit Ardour to only 4096 open
files
ardour: [INFO]: Loading system configuration file
/usr/local/etc/ardour5/system_config
ardour: [INFO]: Loading user configuration file
/home/iksrazal/.config/ardour5/config
ardour: [INFO]: CPU vendor: GenuineIntel
ardour: [INFO]: AVX-capable processor
ardour: [INFO]: CPU brand: Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz
ardour: [INFO]: Using SSE optimized routines
ardour: [INFO]: Loading default ui configuration file
/usr/local/etc/ardour5/default_ui_config
ardour: [INFO]: Loading user ui configuration file
/home/iksrazal/.config/ardour5/ui_config
Color shuttle bg not found
ardour: [INFO]: Loading color file
/usr/local/share/ardour5/themes/dark-ardour.colors
ardour: [INFO]: Loading ui configuration file
/usr/local/etc/ardour5/clearlooks.rc
ardour: [INFO]: Loading ui configuration file
/usr/local/etc/ardour5/clearlooks.rc

(ardour-5.12.0:4531): Gtk-WARNING **: Theme directory base/ of theme oxygen
has no size field

Found nothing along
/home/iksrazal/.config/ardour5/templates:/usr/local/share/ardour5/templates
run dialog
pingback: No Error
protocol Generic MIDI active ? 0
protocol PreSonus FaderPort8 active ? 0
protocol Mackie active ? 0
protocol PreSonus FaderPort active ? 0
protocol Steinberg CC121 active ? 0
protocol Open Sound Control (OSC) active ? 0
Scanning folders for bundled LV2s: /usr/local/lib/ardour5/LV2
Set cursor set to default
Set buffering params to 262144|131072|10|10
Set buffering params to 262144|131072|10|10
Skip explicit buffer seconds, preset in use
Skip explicit buffer seconds, preset in use
JackGraphManager::Connect already connected port_src = 7 port_dst = 3
JackGraphManager::Connect already connected port_src = 8 port_dst = 4
JackGraphManager::Connect already connected port_src = 1 port_dst = 5
JackGraphManager::Connect already connected port_src = 23 port_dst = 3
JackGraphManager::Connect already connected port_src = 24 port_dst = 4
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 3.8 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 4.5 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 5.5 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 3.5 ms
Pool: 'import events' max: 0 / 64
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 8.6 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 7.6 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 8.2 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 8.0 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.ardour
saved state in 9.6 ms
TRANSCODE VIDEO:
/usr/local/bin/ffmpeg_harvid -i /home/iksrazal/output.mp4 -b:v 10000k -s
1920x1080 -y -vcodec mjpeg -an -intra -g 1
/home/iksrazal/Desktop/ml27/interchange/ml27/videofiles/output.avi
ffmpeg: 'ffmpeg version 2.8.2'
ffmpeg: ' Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (Debian 4.7.2-5)
  configuration: --enable-gpl --enable-libmp3lame --enable-libx264
--enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libopenjpeg --enable-libopus --enable-libschroedinger
--enable-libspeex --enable-libbluray --enable-libgsm --disable-vaapi
--disable-x11grab --disable-devices --extra-cflags='-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64' --enable-shared --enable-static
--prefix=/home/rgareus/local
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100'
ffmpeg: 'Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/home/iksrazal/output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
  Duration: 00:00:49.63, start: 0.021333, bitrate: 5643 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 5505 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler'
ffmpeg: '[swscaler @ 0x4414e60] deprecated pixel format used, make sure you
did set range correctly
Output #0, avi, to
'/home/iksrazal/Desktop/ml27/interchange/ml27/videofiles/output.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    ISFT            : Lavf56.40.101
    Stream #0:0(eng): Video: mjpeg (MJPG / 0x47504A4D), yuvj420p(pc),
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 10000 kb/s, 30 fps, 30 tbn, 30 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc56.60.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help'
EXTRACT AUDIO:
/usr/local/bin/ffmpeg_harvid -i /home/iksrazal/output.mp4 -ac 2 -map 0:1
-vn -acodec pcm_f32le -y
/home/iksrazal/Desktop/ml27/interchange/ml27/videofiles/output.avi.wav
(null) (null)
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.pending
saved state in 76.0 ms
actually writing state to /home/iksrazal/Desktop/ml27/ml27.tmp
renaming state to /home/iksrazal/Desktop/ml27/ml27.pending
saved state in 70.9 ms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ardour.org/pipermail/ardour-users-ardour.org/attachments/20180407/de82a1d6/attachment.htm>


More information about the Ardour-Users mailing list