Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video-JS and mobile #125

Closed
bbushong opened this issue May 11, 2017 · 20 comments
Closed

Video-JS and mobile #125

bbushong opened this issue May 11, 2017 · 20 comments
Assignees
Labels
bug Malfunction or crash

Comments

@bbushong
Copy link

bbushong commented May 11, 2017

I feel like I'm missing something obvious. Using IOS and Piwigo Mobile 2.0.2(17). I'm trying to upload a .MOV file, but instead, only a small .jpg get uploaded instead. It appears that this "conversion" is happening at the client side. I've enabled everything in local/config/config.inc.php:
$conf['upload_form_all_types'] = true;
$conf['file_ext'] = array('jpg','JPG','jpeg','JPEG','png','PNG','gif','GIF','mpg','zip','avi','mp3','ogg','mov','MOV');

When I upload using a browser on a computer, videos upload, and playback works on both IOS and desktop. Just can't upload video from IOS. From tcpdump, here is header showing the content type being uploaded:

POST /ws.php?format=json&method=pwg.images.upload HTTP/1.1
Host:
Content-Type: multipart/form-data; boundary=Boundary+DF3C0F0AE091BB22
Cookie: pwg_id=3e6mupc42ovjgnddc1pgk8is27
Connection: keep-alive
Accept: /
User-Agent: piwigo/2.0.2 (iPhone; iOS 10.3.1; Scale/2.00)
Accept-Language: en-US;q=1, de-DE;q=0.9
Content-Length: 141544
Accept-Encoding: gzip, deflate
Via: HTTP/1.1 nycnz0231msp1ts10.wnsnet.attws.com

--Boundary+DF3C0F0AE091BB22
Content-Disposition: form-data; name="file"; filename="IMG_8371.MOV"
Content-Type: image/jpeg

(BOLD added).

Also, when I go to upload, it is clear it is uploading only an image due to the speed at which it does it.

Is this not a supported feature? I get the impression it is from the documentation.

@EddyLB
Copy link
Collaborator

EddyLB commented May 11, 2017

Thanks for reporting.
Yes, there are several issues (see also issues #119 and #120) which I would like to fix so that videos can finally be uploaded/downloaded to a Piwigo server. Following your post and several tests, I've discovered that replacing .MOV with .MP4 on iOS looks fine. I shall therefore try to fix these issues in version 2.0.4 (2.0.3 is out and being tested).

@EddyLB EddyLB self-assigned this May 11, 2017
@EddyLB EddyLB added this to the Release 2.0.4 — AFNetworking migration & bug fixes milestone May 11, 2017
@bbushong
Copy link
Author

I REALLY appreciate you taking a look at this, and I had seen those other posts, but I'm still a little confused. I get the impression from other locations on here (https://github.com/Piwigo/Piwigo-Mobile/wiki/How-to-Upload-and-Stream-Video) that you can upload video from the iPhone/iPad... if not the native videos, what/how can you upload video in general? I have a GoPro, which does record in MP4 format, and I tried uploading something that I had saved to the camera role using that... same issue (here is the capture):

POST /ws.php?format=json&method=pwg.images.upload HTTP/1.1
Host:
Content-Type: multipart/form-data; boundary=Boundary+E1F565A5B64A79F7
Cookie: pwg_id=mhucce2g4icvj94n2k6tsu09m6
Accept: /
User-Agent: piwigo/2.0.2 (iPhone; iOS 10.3.1; Scale/2.00)
Accept-Language: en-US;q=1, de-DE;q=0.9
Content-Length: 34575
Accept-Encoding: gzip, deflate
CUDA_CLIIP: 192.168.53.136
X-Forwarded-For: 192.168.53.136
Cache-Control: max-age=259200
Connection: keep-alive

--Boundary+E1F565A5B64A79F7
Content-Disposition: form-data; name="file"; filename="515370963.980961.MP4"
Content-Type: image/jpeg

e...I}m....}....L.,2.w
--truncated--


Thank you again for all your work! If you ever need a tester, let me know!
Thanks,
Bill

@EddyLB
Copy link
Collaborator

EddyLB commented May 11, 2017

I understand why you thought the iOS app should work with videos. The wiki page has been written in 2015 and that was surely working fine at that time. I should update it...

I've started working on this project recently and discovered many bugs, some of them due to the evolution of the iOS SDK. So I fix them step by step whilst migrating deprecated libraries.

I will be pleased to add you to the list of beta testers. Just send me your name/email using my email address.

@EddyLB
Copy link
Collaborator

EddyLB commented May 12, 2017

You are now added to the list of TestFlight testers. Thank you for your willing to help.

@EddyLB EddyLB added the bug Malfunction or crash label May 27, 2017
@EddyLB EddyLB closed this as completed May 28, 2017
@plegall
Copy link
Member

plegall commented Jun 2, 2017

I just made a test with TestFlight version 2.0.4(25) and I get quite an unexpected result.

Piwigo-VideoJS is activated and I have this in my local configuration:

$conf['upload_form_all_types'] = true;
$conf['file_ext'] = array_merge(
  $conf['picture_ext'],
  array('mov', 'MOV')
  );

The iOS app let me upload a video. And at the very end of the upload, I get "Video Upload Error - You need to add the extension "VideoJS"....".

img_1734

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 2, 2017

VideoJS only accepts these formats: mp4, ogg, webm or MP4, OGG, WEBM as explained here. So the app replaces the .MOV extension with .MP4 as suggested. When downloading, it does the reverse to allow storing the video file in the Photos app.

The iOS app checks that VideoJS is installed at start if the user has admin rights but cannot check the web config. I guess I should update the alert and invite to check the configuration.

@EddyLB EddyLB reopened this Jun 2, 2017
@EddyLB
Copy link
Collaborator

EddyLB commented Jun 2, 2017

@plegall, could you please tell me which formats are accepted by your server as shown here ?

screen shot 2017-06-02 at 23 00 58

@plegall
Copy link
Member

plegall commented Jun 2, 2017

jpg, jpeg, png, gif, mov, ogg, ogv, mp4, m4v, webm, webmv

{ogg, ogv, mp4, m4v, webm, webmv} are automatically added by Piwigo-VideoJS

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 2, 2017

To my understanding, you should have "jpg, jpeg, png, gif" provided by Piwigo and "ogg, ogv, mp4, m4v, webm, webmv" added by Piwigo-VideoJS. mov is added by your local configuration and should not because it won't be managed by Piwigo-VideoJS

My configuration is: $conf['upload_form_all_types'] = true;

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 3, 2017

I encounter the issue with the demo server (but not mine) and hope to get a fix soon.
I shall then submit a new build.

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 3, 2017

@plegall, here is the error I get at the end of the upload with the demo server:
NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set."

In fact, the demo server returns an empty message:

<NSHTTPURLResponse: 0x608000233d60>
{ URL: https://piwigo.us/dev/eddy//ws.php?format=json&method=pwg.images.upload }
{ status code: 200, headers {
    "Cache-Control" = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
    Connection = "Keep-Alive";
    "Content-Encoding" = gzip;
    "Content-Length" = 40;
    "Content-Type" = "text/html";
    Date = "Sat, 03 Jun 2017 11:51:52 GMT";
    Expires = "Thu, 19 Nov 1981 08:52:00 GMT";
    "Keep-Alive" = "timeout=5, max=100";
    Pragma = "no-cache";
    Server = Apache;
    Vary = "Accept-Encoding";
} }
(null)

While my server returns a JSON object:

<NSHTTPURLResponse: 0x600000233b80>
{ URL: https://lelievre-berna.net/Eddy/ws.php?format=json&method=pwg.images.upload }
{ status code: 200, headers {
    "Cache-Control" = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
    Connection = "Keep-Alive";
    "Content-Encoding" = gzip;
    "Content-Length" = 186;
    "Content-Type" = "text/plain; charset=utf-8";
    Date = "Sat, 03 Jun 2017 11:57:25 GMT";
    Expires = "Thu, 19 Nov 1981 08:52:00 GMT";
    "Keep-Alive" = "timeout=5, max=100";
    Pragma = "no-cache";
    Server = "Apache/2.4.10 (Debian)";
    Vary = "Accept-Encoding";
} }
{
    result =     {
        category =         {
            id = 449;
            label = "Test Album";
            "nb_photos" = 1;
        };
        "image_id" = 34314;
        name = "IMG 0006";
        src = "https://lelievre-berna.net/Eddy/plugins/piwigo-videojs/mimetypes/mp4.png";
    };
    stat = ok;
}

In both cases, the upload is successful (status code 200) but the absence of response from the demo server leads to an error. Could you please have a look at the logs ?

The only significative difference I see between the servers is that mediainfo and ffmpeg are not installed on the demo server.

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 15, 2017

@plegall, have you had a chance to look into this?

@plegall
Copy link
Member

plegall commented Jun 15, 2017

Hi @EddyLB

  1. I just installed mediainfo and ffmpeg
  2. In the log file (from June 3rd 2017) I find many errors like:

identify.im6: Not a JPEG file: starts with 0x2f 0x39 `/home/sys/var/www/piwigo.us/dev/eddy/upload/2017/06/03/20170603112112-ed6661e6.jpg' @ error/jpeg.c/JPEGErrorHandler/316.

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 15, 2017

@plegall,

  • Can I access the logs on the Dev server? How?
  • What are the paths of mediainfo/ffmpeg ? I still get warnings in Plugins / VideoJS / Synchronize.

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 18, 2017

@plegall I get the following error on the dev server: Please use at least MediaInfo version 0.7.64 or higher, not 0.7.58.
Can you please update mediainfo on the dev server?

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 22, 2017

@plegall, can you please update MediaInfo 0.7.58 to version 0.7.64 or higher? That is requested for using VideoJS and probably the reason for which the uploads fail.

@plegall
Copy link
Member

plegall commented Jun 22, 2017

I just deactivated this test in piwigo-videojs (as far as I know, this test is useless)

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 22, 2017

Same result with the iOS app. With regard the web interface, the uploaded video has no icon (an image of 0x0 pixels) and I get the message: Trying to get property of non-object in /home/sys/var/www/piwigo.us/dev/eddy/plugins/piwigo-videojs/admin/admin_photo.php on line 128
I suspect that the function does not complete its task and that is why I get no HTTP answer on the iOS app (leading to an error message).

@EddyLB
Copy link
Collaborator

EddyLB commented Jun 28, 2017

@plegall, the iOS app v2.0.4 build 40 has now been tested successfully with two Piwigo servers on which MediaInfo and ffmpeg are correctly installed. If you could update MediaInfo 0.7.58 on the dev server, I am pretty sure that will work with that one too.

@EddyLB
Copy link
Collaborator

EddyLB commented Jul 26, 2017

This is fixed according to several TestFlight testers so I close this issue.

@EddyLB EddyLB closed this as completed Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Malfunction or crash
Projects
None yet
Development

No branches or pull requests

3 participants