-stdin option crashes with mp4 file #222

Closed
opened 2026-01-29 16:38:25 +00:00 by claunia · 1 comment
Owner

Originally created by @Izaron on GitHub (Dec 18, 2016).

In both Windows and Linux -stdin crashes on all MP4 files
Because in these lines the program closes the input stream and passes control to the GPAC library, which tries to open the input file only, but we have no file name, so ctx->inputfile equals to NULL.
This can be corrected by recording the stream into a temporary file and then deleting it after GPAC work, but it's brute force.

Originally created by @Izaron on GitHub (Dec 18, 2016). In both Windows and Linux -stdin crashes on all MP4 files Because in these [lines](https://github.com/CCExtractor/ccextractor/blob/master/src/ccextractor.c#L228) the program closes the input stream and passes control to the GPAC library, which tries to open the input file only, but we have no file name, so `ctx->inputfile` equals to NULL. This can be corrected by recording the stream into a temporary file and then deleting it after GPAC work, but it's brute force.
Author
Owner

@cfsmp3 commented on GitHub (Dec 19, 2016):

"Solution" is to not allow stdin on mp4. The fundamental reason to use stdin is to process a real time stream - so saving it to disk in the first place is not really an option.

Since GPAC requires access to a file (I don't know if this has changed in the current GPAC though) we can't do anything except require a file ourselves to process .mp4.

But if we do change this in GPAC (not sure if it's possible at all) let's make sure to send them a patch :-)

Anyway, our task here is to make -stdin and -in:mp4 incompatible.

@cfsmp3 commented on GitHub (Dec 19, 2016): "Solution" is to not allow stdin on mp4. The fundamental reason to use stdin is to process a real time stream - so saving it to disk in the first place is not really an option. Since GPAC requires access to a file (I don't know if this has changed in the current GPAC though) we can't do anything except require a file ourselves to process .mp4. But if we do change this in GPAC (not sure if it's possible at all) let's make sure to send them a patch :-) Anyway, our task here is to make -stdin and -in:mp4 incompatible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#222