MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007544ardourbugspublic2018-01-20 05:012018-01-25 05:31
Reporterjohne53 
Assigned Tojohne53 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformWindowsOSprobably allOS Versionprobably all
Product Version5.X git (version in description) 
Target VersionFixed in Version 
Summary0007544: Video timeline does not work in Windows
DescriptionApologies for the length of this report and sorry if there's already an outstanding issue...

Over on the Ardour forum a user called Drazen Gara has reported being unable to see videos when running Ardour under Windows 8:-

https://community.ardour.org/node/15434 [^]

I decided to take a look and realised that on my system, I can't see videos on either Windows 7 or Windows 8 (if I try to load a video I end up with a blank preview window and a blank video timeline).
Steps To ReproduceSimply attempt to load a video from 'Session->Open Video...'
Additional InformationThe video preview seems to get handled via curl somehow. I'm assuming that some 3rd party app (harvid maybe?) is listening on a port and responding to curl requests. Here's the relevant code from function 'HttpGet::get()' (it's at line 214 in gtk2_ardour/ardour_http.cc). Note that it gets passed a URL:-

    cc = curl_easy_setopt (_curl, CURLOPT_URL, url);
    CCERR ("CURLOPT_URL");
    _result = curl_easy_perform (_curl);
    cc = curl_easy_getinfo (_curl, CURLINFO_RESPONSE_CODE, &_status);
    CCERR ("CURLINFO_RESPONSE_CODE,");

When trying to open a video, the first curl message seems to be a general status request - with the URL being:-

    http://127.0.0.1:1554/status [^]

this completes successfully and the http status returned from curl is 200 (status OK). The next stage seems to be a request to get some general info about the selected video file (duration / frame rate / aspect ratio etc.) - with the relevant URL being:-

    http://127.0.0.1:1554/info/?file=N%3A%2Fvideosample.avi&format=csv [^]

This also completes successfully and returns status 200. But after that, things start to go wrong...

The final stage is an attempt to load a sample for the preview window. In this case the URL is:-

    http://127.0.0.1:1554/?sample=2&w=240&h=135i&file=N%3A%2Fvideosample.avi&format=rgb [^]

However... this request fails (on Windows) with the returned status being 400 (Bad Request status). So I'm assuming that the above request is malformed somehow. Here's the code which forms it at line 695 in 'gtk2_ardour/add_video_dialog.cc' (function 'AddVideoDialog::request_preview()'):-

    char url[2048];
    snprintf(url, sizeof(url), "%s%s?sample=%lli&w=%d&h=%di&file=%s&format=rgb"
        , video_server_url.c_str()
        , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
        , (long long) (video_duration * seek_slider.get_value() / 1000.0)
        , clip_width, clip_height, u.c_str());

    char* data = ArdourCurl::http_get (url, NULL);

Maybe someone can take a look and see if there's anything wrong...
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0020122)
johne53 (reporter)
2018-01-20 10:26

The video track still isn't working but I managed to fix the preview issue... Here's the code that's causing the preview problem (at line 696 in 'gtk2_ardour/add_video_dialog.cc' - function 'AddVideoDialog::request_preview()'):-

    snprintf(url, sizeof(url), "%s%s?sample=%lli&w=%d&h=%di&file=%s&format=rgb"

Changing it to this at least partially fixes the problem:-

    snprintf(url, sizeof(url), "%s%s?frame=%lli&w=%d&h=%di&file=%s&format=rgb"

See the git commit from 18th Sep 2017 (commit #30b087ab3d)

I now see a preview image if I select a video file but when I press OK (to launch the Transcode dialog) it still shows no path for the output file and the Import Settings still say "Do Not Import Video".

Any hints at where to look next?
(0020123)
x42 (administrator)
2018-01-20 10:45

Works for me on Windows 7 (en_us) with drive C:\

...file=N%3A%2Fvideosample.avi... Is this drive N:\ ? does it work on C:\ ?
(0020124)
x42 (administrator)
2018-01-20 10:48

PS. the videotimeline sample->frame is already fixed in 2e9fcceb1e3
(0020125)
johne53 (reporter)
2018-01-21 00:29

I moved both the session and the video file to my C:\ drive and tried again on Windows 7 but it didn't make any difference. A few things might be significant here...

1) This DID work briefly when I first installed harvid and xjadeo (a couple of days ago) but since re-booting I've never been able to make it work in either Windows 7 or Windows 8.1

2) A couple of days ago there was one session which I saved with a working video timeline. That session still works if I open it. What doesn't work is trying to import video to any other session

3) This section (in the TranscodeVideoDialog c'tor) might be contributing to the problem:-

        if (w > 0 && h > 0 && transcoder->get_fps() > 0 && transcoder->get_duration() > 0) {
            ffok = true;
        }

'w' and 'h' both have valid values when this line gets reached - but 'transcoder->get_fps()' and 'transcoder->get_duration()' both return zero
(0020126)
johne53 (reporter)
2018-01-21 00:36

From x42:-
" PS. the videotimeline sample->frame is already fixed in 2e9fcceb1e3 "

Sorry, I meant to add - #2e9fcceb1e3 only fixes it in video_image_frame.cc (the problem I found was in add_video_dialog.cc)

I've a horrible feeling there might be more of these sample->frame issues lurking around... :-(
(0020127)
johne53 (reporter)
2018-01-21 02:11
edited on: 2018-01-21 02:12

From johne53:-
" 'transcoder->get_fps()' and 'transcoder->get_duration()' both return zero "

In fact if I change that section to look like this, it works again:-

        if (w > 0 && h > 0) {
             ffok = true;
         }

AFAICT those various fields (duration / width / height / fps etc.) all seem to get calculated by an external helper app (ffprobe.exe?) So my guess is that there's some problem with the helper app (in some situations it isn't calculating the duration and fps correctly).

(0020128)
x42 (administrator)
2018-01-21 02:36

I've started to roll back various Frame->Sample changes.

The issue with the "ok" flag is not the external tool, but rather ardour parsing its output (another frame/sample) issue.
(0020133)
johne53 (reporter)
2018-01-23 10:20

Yes Robin, you're right. I made a few sample->frame reversions in 'gtk2_ardour/transcode_ffmpeg.cc' and I now have visible pictures again on my video timeline. There could easily be more needed elsewhere though...
(0020135)
johne53 (reporter)
2018-01-25 05:31

Working in git master now (25th Jan 2018)

- Issue History
Date Modified Username Field Change
2018-01-20 05:01 johne53 New Issue
2018-01-20 10:26 johne53 Note Added: 0020122
2018-01-20 10:45 x42 Note Added: 0020123
2018-01-20 10:48 x42 Note Added: 0020124
2018-01-21 00:29 johne53 Note Added: 0020125
2018-01-21 00:36 johne53 Note Added: 0020126
2018-01-21 02:11 johne53 Note Added: 0020127
2018-01-21 02:12 johne53 Note Edited: 0020127 View Revisions
2018-01-21 02:36 x42 Note Added: 0020128
2018-01-23 10:20 johne53 Note Added: 0020133
2018-01-25 05:30 johne53 Note Added: 0020134
2018-01-25 05:30 johne53 Note Deleted: 0020134
2018-01-25 05:31 johne53 Note Added: 0020135
2018-01-25 05:31 johne53 Status new => resolved
2018-01-25 05:31 johne53 Resolution open => fixed
2018-01-25 05:31 johne53 Assigned To => johne53


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker