From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 2FC434F02D for ; Fri, 16 May 2025 00:54:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id CFA1D68C4B1; Fri, 16 May 2025 03:54:29 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 5F47268C201 for ; Fri, 16 May 2025 03:54:23 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9764B4397E for ; Fri, 16 May 2025 00:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1747356862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UDbe7lj94VDm95rk7cB9ClD1cGaRXd9ujf/2d8nuUQ0=; b=NtWxC9LH0FNQ6BzHAfm2DN2OcgZ8YfFoEBBjH1Mmhng3HSV8vCh23JIVOIZHGbu9c7/YJk unCGY/8oeRkkHf7hRV2PS1u8w3SmwuSCxeQkFRAsNvOICru/zKHS1VG0S6js7rJkUNoa+H xUO/mBvxxWqr6j8Oh09hH7/+alQcTCs/zRe4bAV9ptTsxcdkYFIfrjFb6RK9Fap3XBRtDU SiUW59bhrUtA23n9RNOtmWJ4MnudfR1jjE6Kjxk/oVL30avwgzqlWhiqBbksmCo7vq0Z4x P66Wd3B+4Ht94msSNRkCnmFsgQm16rk+z1hJO/TMXNNsYr0fL98C0I9GaEgc4A== Date: Fri, 16 May 2025 02:54:21 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250516005421.GX29660@pb2> References: <20250515211148.6C91C4128B8@natalya.videolan.org> <7080a655-035e-e56f-a97c-5579edb2e760@passwd.hu> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefuddufeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeelkeeggfffiedufeejueffjeduhedttdduledtheevveevtdeiueelhfdtuedtkeenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] fftools/graphprint: Now, make it a Killer-Feature! X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============1012514746260876127==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1012514746260876127== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dZWXK6sTLcF/iWTw" Content-Disposition: inline --dZWXK6sTLcF/iWTw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Fri, May 16, 2025 at 12:17:14AM +0000, softworkz . wrote: >=20 >=20 > > -----Original Message----- > > From: ffmpeg-devel On Behalf Of Marton > > Balint > > Sent: Freitag, 16. Mai 2025 02:00 > > To: FFmpeg development discussions and patches > > Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] fftools/graphprint: Now, ma= ke it a > > Killer-Feature! > >=20 > >=20 > >=20 > > On Thu, 15 May 2025, softworkz . wrote: > >=20 > > > > > > > > >> -----Original Message----- > > >> From: ffmpeg-devel On Behalf Of Ra= miro > > Polla > > >> Sent: Donnerstag, 15. Mai 2025 23:50 > > >> To: ffmpeg-devel@ffmpeg.org > > >> Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] fftools/graphprint: Now,= make > > it a > > >> Killer-Feature! > > >> > > >> Hi, > > >> > > >> On Thu, May 15, 2025 at 11:11=E2=80=AFPM softworkz wrote: > > >> [...] > > >>> diff --git a/fftools/graph/filelauncher.c b/fftools/graph/filelaunc= her.c > > >>> new file mode 100644 > > >>> index 0000000000..45514ca599 > > >>> --- /dev/null > > >>> +++ b/fftools/graph/filelauncher.c > > >> [...] > > >>> +int ff_open_html_in_browser(const char *html_path) > > >>> +{ > > >>> + if (!html_path || !*html_path) > > >>> + return -1; > > >>> + > > >>> +#if defined(_WIN32) > > >>> + > > >>> + // --- Windows --------------------------------- > > >>> + { > > >>> + HINSTANCE rc =3D ShellExecuteA(NULL, "open", html_path, NU= LL, NULL, > > >> SW_SHOWNORMAL); > > >>> + if ((UINT_PTR)rc <=3D 32) { > > >>> + // Fallback: system("start ...") > > >>> + char cmd[1024]; > > >>> + _snprintf_s(cmd, sizeof(cmd), _TRUNCATE, "start \"\" \= "%s\"", > > >> html_path); > > >>> + if (system(cmd) !=3D 0) > > >>> + return -1; > > >>> + } > > >>> + return 0; > > >>> + } > > >>> + > > >>> +#elif defined(__APPLE__) > > >>> + > > >>> + // --- macOS ----------------------------------- > > >>> + { > > >>> + // "open" is the macOS command to open a file/URL with the > > default > > >> application > > >>> + char cmd[1024]; > > >>> + snprintf(cmd, sizeof(cmd), "open '%s' 1>/dev/null 2>&1 &", > > >> html_path); > > >>> + if (system(cmd) !=3D 0) > > >>> + return -1; > > >>> + return 0; > > >>> + } > > >>> + > > >>> +#else > > >>> + > > >>> + // --- Linux / Unix-like ----------------------- > > >>> + // We'll try xdg-open, then gnome-open, then kfmclient > > >>> + { > > >>> + // Helper macro to try one browser command > > >>> + // Returns 0 on success, -1 on failure > > >>> + #define TRY_CMD(prog) do { = \ > > >>> + char buf[1024]; = \ > > >>> + snprintf(buf, sizeof(buf), "%s '%s' 1>/dev/null 2>&1 &= ", \ > > >>> + (prog), html_path); = \ > > >>> + int ret =3D system(buf); = \ > > >>> + /* On Unix: system() returns -1 if the shell can't run= =2E */\ > > >>> + /* Otherwise, check exit code in lower 8 bits. = */\ > > >>> + if (ret !=3D -1 && WIFEXITED(ret) && WEXITSTATUS(ret) = =3D=3D 0) \ > > >>> + return 0; = \ > > >>> + } while (0) > > >>> + > > >>> + TRY_CMD("xdg-open"); > > >>> + TRY_CMD("gnome-open"); > > >>> + TRY_CMD("kfmclient exec"); > > >>> + > > >>> + fprintf(stderr, "Could not open '%s' in a browser.\n", > > html_path); > > >>> + return -1; > > >>> + } > > >>> + > > >>> +#endif > > >>> +} > > >> [...] > > >> > > >> Sorry I didn't have a closer look at the patchset while it was under > > >> review, but system(cmd) is a big no-no. We could create a file with = an > > >> explicit path passed by the user, but then it's up to the user to op= en > > >> it. > > > > > > What's bad about opening a file in the browser when that's the docume= nted > > > behavior of the cli parameter? > >=20 > > Because ffmpeg is not a browser opener tool, but a transcoding tool. An > > argument can be made for every feature you can think of (Why not add an > > option which shuts down a computer when the transcoding is done? Why not > > add a playable DOOM implementation so the user will not be bored when > > waiting for the transcode to finish). > >=20 > > Let's just revert this. The many ffmpeg cli frontends can open browsers= if > > they want. >=20 > Many good arguments can be found for both sides. >=20 > > Because ffmpeg is not a browser opener tool >=20 > By all respect, this isn't one. >=20 >=20 > Anyway, I will let the TC decide about this, then. Not speaking as a TC member here but IMHO 1. lets all calm down, so far we have a civil and productive discussion maybe we can simply find a solution everyone is happy with! 2. all security issues must be fixed if there are some 3. there should be a configure flag to enable/disable the browser opening f= eature if it remains 4. can system() be replaced by fork()+exec*() ? is that something people wo= uld prefer ? 5. this is a cool feature, i would use this if its available, that said if i had to manually open a browser with a given URL that would work for me too. 6. everyone who unconditionally hates this, please try it 7. as long as the discussion is nice and productive i think the TC is not t= he best path forward. If things degenerate into some mess then pas it to teh TC, yes 8. I think one part people should agree on first is if this should be disab= led while it is being discussed (maybe a disabled by default configure switch would work?) Anyway, iam a little sleepy maybe i have some better view after sleeping ov= er this :) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship: All citizens are under surveillance, all their steps and actions recorded, for the politicians to enforce control. Democracy: All politicians are under surveillance, all their steps and actions recorded, for the citizens to enforce control. --dZWXK6sTLcF/iWTw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaCaMqwAKCRBhHseHBAsP q8I0AJ9m/pGcO5Hh+l0HIgJ1PpEj5tcczQCfVcH7Tv/CdBlhwWZ20+UQn6wXDWM= =Ja+8 -----END PGP SIGNATURE----- --dZWXK6sTLcF/iWTw-- --===============1012514746260876127== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============1012514746260876127==--