anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
1.9k stars 182 forks source link

interested in a snap version? #54

Closed michaelpeeters closed 4 years ago

michaelpeeters commented 4 years ago

Hi, I used the Dockerfile as a basis to create a snapcraft.yaml for your untrunc version.

snaps offer the advantage that they are automatically updated to the latest version.

As an added benefit, snapcraft.io can automatically build new snap versions on their infrastructure whenever there is a change on the github repo.

anthwlock commented 4 years ago

Thank you. I have added a snapcrat.yaml in d7e047d575c9, based on your snapcraft.yaml.

Do you know of a way to cache a partial result, so it doesn't need to be rebuild every time? In this case, ~90% of the time is spent building ffmpeg.. which never changes.

michaelpeeters commented 4 years ago

Hi, unfortunately, my Makefile experience is a bit dusty from 20 years ago...

But I went the lazy route and created the webhook to git & let snapcraft build the snap on every change.

https://snapcraft.io/blog/we-are-changing-the-way-you-build-snaps-from-github-repos

On Sun, Jun 21, 2020 at 9:40 AM Anthon Lockwood notifications@github.com wrote:

Thank you. I have added a snapcrat.yaml in d7e047d https://github.com/anthwlock/untrunc/commit/d7e047d575c9f7f896b19514531caad76be83fd9, based on your snapcraft.yaml.

Do you know of a way to cache a partial result, so it doesn't need to be rebuild every time? In this case, ~90% of the time is spent building ffmpeg.. which never changes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/54#issuecomment-647092043, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDTUFHE5FMEJ4B6AC7L3FLRXW2NPANCNFSM4N5C74MA .

anthwlock commented 4 years ago

Yes, I also meant the snapcraft build service, the Makefile is fine. I thought maybe if one adds a separate 'part' for ffmpeg (in the snapcraft.yaml), with correct parts.<part-name>.source, it would be smart enough to cache the result.

Does your webhook use 'build.snapcraft.io' or just 'snapcraft.io'?

michaelpeeters commented 4 years ago

in my git history, my first attempt was to use the default ffmpeg as a dynamic dependency: https://github.com/michaelpeeters/untrunc/commit/3ebf1386b4f679e34e4d68b5b29f1c0872478432?diff=split#diff-184032a532406b07009403e26f4fc62f

This seemed to work, but I was puzzled with the remark in the readme that ffmeg 3.3.9 works best. That's why the latest version of snapcraft.yaml downloads ffmpeg3.3.9 & builds it back again.

I just followed the instructions on snapcraft.io for building: [image: Screenshot_2020-06-21_19-18-51.png]

this creates a webhook on github: [image: Screenshot_2020-06-21_19-29-00.png] I only have to manage the release after a build on snapcraft.io

On Sun, Jun 21, 2020 at 7:11 PM Anthon Lockwood notifications@github.com wrote:

Yes, I also meant the snapcraft build service, the Makefile is fine. I thought maybe if one adds a separate 'part' for ffmpeg (in the snapcraft.yaml), with correct parts..source, it would be smart enough to cache the result.

Does your webhook use 'build.snapcraft.io' or just 'snapcraft.io'?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/54#issuecomment-647155561, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDTUFBFA5K6PQQ5QRMFEU3RXY5L5ANCNFSM4N5C74MA .

anthwlock commented 4 years ago

ffmpeg > 3.3 doesn't report video frame boundaries, see here.

The screenshots are not visible, it's just text. I also followed the instructions, and it automatically created a webhook to 'build.snapcraft.io', while the blog recommends just 'snapcraft.io'. But since it works, I think I will leave it.

You don't know of a way to automatically promote edge releases to stable, do you?

michaelpeeters commented 4 years ago

I tried to find a solution for the "autopromote" to edge, but there doesn't seem to be a simple solution.

It is possible to script the snapcraft release command, but that's not that straightforward. : https://ubuntu.com/blog/controlling-snap-releases-with-channels-tracks-and-branches-part-2

On Mon, Jun 22, 2020 at 1:00 PM Anthon Lockwood notifications@github.com wrote:

ffmpeg > 3.3 doesn't report video frame boundaries, see here https://github.com/anthwlock/untrunc/issues/37#issuecomment-576028249.

The screenshots are not visible, it's just text. I also followed the instructions, and it automatically created a webhook to 'build.snapcraft.io', while the blog recommends just 'snapcraft.io'. But since it works, I think I will leave it.

You don't know of a way to automatically promote edge releases to stable, do you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/54#issuecomment-647445083, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDTUFEQKN74MOMW7R3EWQTRX42VPANCNFSM4N5C74MA .

anthwlock commented 4 years ago

It looks like the link describes how to use an external build-service. So it's not really applicable when using their 'build.snapcraft.io' service, right?

michaelpeeters commented 4 years ago

Hi, I was looking to the "Architecture" parameter of snapcraft release, but in fact I just realized that every revision number is unique over architectures:

e.g.:

snapcraft status michaelp-anthwlock-untrunc Track Arch Channel Version Revision latest amd64 stable 1.0-git 14 candidate 1.0-git 14 beta 1.0-git 14 edge 1.0-git 14 arm64 stable 1.0-git 9 candidate 1.0-git 9 beta 1.0-git 9 edge 1.0-git 19 armhf stable 1.0-git 8 candidate 1.0-git 8 beta 1.0-git 8 edge 1.0-git 18 i386 stable 1.0-git 16 candidate 1.0-git 16 beta 1.0-git 16 edge 1.0-git 16 ppc64el stable 1.0-git 17 candidate 1.0-git 6 beta 1.0-git 6 edge 1.0-git 17 s390x stable 1.0-git 15 candidate 1.0-git 15 beta 1.0-git 15 edge 1.0-git 15

revision 19 is unique to arm64

so i can promote it: snapcraft release michaelp-anthwlock-untrunc 19 stable Track Arch Channel Version Revision latest arm64 stable 1.0-git 19 candidate 1.0-git 9 beta 1.0-git 9 edge 1.0-git 19

Now, If I understand snapcraft correctly, the idea would be to use "channels" sparsely only when it makes sense, so closing irrelevant channels might be more logical:

snapcraft close michaelp-anthwlock-untrunc candidate Track Arch Channel Version Revision latest amd64 stable 1.0-git 14 candidate ↑ ↑ beta 1.0-git 14 edge 1.0-git 14 arm64 stable 1.0-git 19 candidate ↑ ↑ beta 1.0-git 9 edge 1.0-git 19 armhf stable 1.0-git 8 candidate ↑ ↑ beta 1.0-git 8 edge 1.0-git 18 i386 stable 1.0-git 16 candidate ↑ ↑ beta 1.0-git 16 edge 1.0-git 20 ppc64el stable 1.0-git 17 candidate ↑ ↑ beta 1.0-git 6 edge 1.0-git 17 s390x stable 1.0-git 15 candidate ↑ ↑ beta 1.0-git 15 edge 1.0-git 21

The candidate channel is now closed.

If you have more recent builds on edge for example and you close the channel, that version is lost:

snapcraft close michaelp-anthwlock-untrunc edge beta Track Arch Channel Version Revision latest amd64 stable 1.0-git 14 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ arm64 stable 1.0-git 19 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ armhf stable 1.0-git 8 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ i386 stable 1.0-git 16 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ ppc64el stable 1.0-git 17 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ s390x stable 1.0-git 15 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑

I put it all into a gist: https://gist.github.com/michaelpeeters/edc1c521d823d4d734552b76af7535ad

it' a bit blunt without any checks but it does move all edge versions to stable and closes all other channels:

./promote_snap_edge_to_release.sh michaelp-anthwlock-untrunc Track Arch Channel Version Revision latest amd64 stable 1.0-git 24 candidate ↑ ↑ beta ↑ ↑ edge 1.0-git 24 Track Arch Channel Version Revision latest arm64 stable 1.0-git 29 candidate ↑ ↑ beta ↑ ↑ edge 1.0-git 29 Track Arch Channel Version Revision latest armhf stable 1.0-git 28 candidate ↑ ↑ beta ↑ ↑ edge 1.0-git 28 Track Arch Channel Version Revision latest i386 stable 1.0-git 25 candidate ↑ ↑ beta ↑ ↑ edge 1.0-git 25 Track Arch Channel Version Revision latest ppc64el stable 1.0-git 27 candidate ↑ ↑ beta ↑ ↑ edge 1.0-git 27 Track Arch Channel Version Revision latest s390x stable 1.0-git 26 candidate ↑ ↑ beta ↑ ↑ edge 1.0-git 26 Track Arch Channel Version Revision latest amd64 stable 1.0-git 24 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ arm64 stable 1.0-git 29 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ armhf stable 1.0-git 28 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ i386 stable 1.0-git 25 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ ppc64el stable 1.0-git 27 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑ s390x stable 1.0-git 26 candidate ↑ ↑ beta ↑ ↑ edge ↑ ↑

The candidate, edge and beta channels are now closed.

Not sure if this script can be scheduled on snapcraft.io, but it surely makes it easier to promote the snap version.

to be complete, I found a script that does the same but requires a bit more input & does more validation: https://github.com/kenvandine/snapcraft-utils/blob/master/snapcraft-promote.sh

Sorry for the loooong answer, but I hope this helps ,

Michaêl

On Tue, Jun 23, 2020 at 6:15 PM Anthon Lockwood notifications@github.com wrote:

It looks like the link describes how to use an external build-service. So it's not really applicable when using their 'build.snapcraft.io' service, right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/54#issuecomment-648266672, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDTUFBL55QZO3YMPD7ORFTRYDIKJANCNFSM4N5C74MA .

anthwlock commented 4 years ago

Not sure if this script can be scheduled on snapcraft.io, but it surely makes it easier to promote the snap version.

That's my main concern, just a commit should be enough. Is there any downside to not having a stable release, other than having to type --edge?

michaelpeeters commented 4 years ago

I'm not sure you can install a snap from the gui that is not on stable. I will have to check it out later...

On Fri, Jun 26, 2020, 09:59 Anthon Lockwood notifications@github.com wrote:

Not sure if this script can be scheduled on snapcraft.io, but it surely makes it easier to promote the snap version.

That's my main concern, just a commit should be enough. Is there any downside to not having a stable release, other than having to type --edge?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/54#issuecomment-650040620, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDTUFF235XSD6XIFP7SQWTRYRIMNANCNFSM4N5C74MA .

anthwlock commented 4 years ago

For testing that you can use: https://snapcraft.io/untrunc-anthwlock

michaelpeeters commented 4 years ago

Hi Anthon, You're right, the edge-channel-only approach doesn't seem to make a difference in the Ubuntu Softwarecenter it installed without warning & runs just fine [image: Screenshot_2020-06-30_17-37-51.png]

On Mon, Jun 29, 2020 at 9:25 PM Anthon Lockwood notifications@github.com wrote:

For testing you can use: https://snapcraft.io/untrunc-anthwlock

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/54#issuecomment-651312833, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDTUFEXVWDX4GICHZULETDRZDTDTANCNFSM4N5C74MA .

anthwlock commented 4 years ago

Ok, thanks for testing.

Unless you plan on updating 'michaelp-anthwlock-untrunc' regularly, It would probably be best to shut it down. People might think it is more stable (stable channel + '1.0' version), and it would cause confusion..