openatv / enigma2

openatv-gui
GNU General Public License v2.0
200 stars 314 forks source link

Stream recordings in the movie list #2864

Closed Dima73 closed 4 months ago

Dima73 commented 1 year ago

When I record a stream (via gstreamer, 4097), it creates an MPEG-TS file with a .stream extension. There is also an .eit file (if EPG data was available), and a .stream.meta file.

So far pretty standard.

However, in the movie list, it displays the name of the file, so "20230502 - Some Channel - Some file.stream". I can rename the file using the blue button, and I can see in the meta file the name is changed.

But when I reload the movie list, I don't see the name from the meta file, I till see the name of the file.

Case of a hardcoded "if file is .ts then" somewhere?

Please help.

jbleyel commented 1 year ago

There is another issue in movie list for .stream files. The name looks odd.

The date and the channel should not displayed as name. The date and channel in filename is ok, like .ts

I think you right because .ts and .stream files are handled differently in eServiceReference and/or MovieList.

Dima73 commented 1 year ago

Thanks

Dima73 commented 1 year ago

Next question. How to create a file (gstreamer, 4097).ap in order to use the plugin "MovieCut"?

jbleyel commented 1 year ago

int eMPEGStreamInformationWriter::stopSave(void)

creates the ap file.

Dima73 commented 1 year ago

Yes, I know about this(stopSave), but

Anyone ever tried using the cut list editor on a recorded stream?

First it complains that it doesn't know the extension.

After renaming .stream to .ts, it complains that the .ap file is missing.

Reconstructapsc plugin not help.

jbleyel commented 1 year ago

Do we need the ap in Cutlisteditor or is it also possible to define cuts without the ap data?

jbleyel commented 1 year ago

The stream recording may have a similar information like the transporter stream accesspoints. But do we really need that?

Dima73 commented 1 year ago

Cutlisteditor not need .ap,but necessary [reconstructapsc] add option "Change type '.stream' to '.ts'" MovieCut plugin need .ap

jbleyel commented 1 year ago

What is this plugin doing in addition to changing the extension of the files?

Dima73 commented 1 year ago

What is this plugin doing in addition to changing the extension of the files?

Reconstruct AP/SC files for *.ts

Dima73 commented 1 year ago

I think you should check it yourself. Record .stream and .ts Use Cutlisteditor and run MovieCut

jbleyel commented 1 year ago

I don’t use these plugins.

Dima73 commented 1 year ago

Moreover, you should check it yourself. You are the only one who can help. This is the only way to edit video through the Enigma2 shell. Many users use Cutlisteditor/MovieCut. And the stream takes first place in the modern world. The possibility of timeshift is also necessary.

Dima73 commented 1 year ago

I will try to make the timeshift myself in Python, through a fake record.

jbleyel commented 1 year ago

I think we should do this differently.

https://github.com/oe-alliance/enigma2-plugins/commit/ce1e67935df65aa0b0f3cfc8b7159c2d0eb11c9d

jbleyel commented 1 year ago

Do you have tested the mcut binary for a renamed stream file? Is this working?

jbleyel commented 1 year ago

please try this:

https://github.com/oe-alliance/enigma2-plugins/commit/b2678f41f3ce5d79dc13b1dd0454377e791c9949

Dima73 commented 1 year ago

Thank you, I can check only tomorrow.

WanWizard commented 1 year ago

Do you have tested the mcut binary for a renamed stream file? Is this working?

No, the mcut binary returns exit code 4: "failed to open input ap file", which is correct, this does not exist, it is not created during recording of the stream (using servicemp3, gstreamer), and can also not be recreated by the reconstructapsc plugin (that only creates the sc file).

Details of the test recording I tried to cut:

General
ID                                       : 1 (0x1)
Complete name                            : 20231007_1620_-_Test.stream
Format                                   : MPEG-TS
File size                                : 5.79 GiB
Duration                                 : 2 h 5 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 6 612 kb/s
FileExtension_Invalid                    : ts m2t m2s m4t m4s tmf ts tp trp ty

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Codec ID                                 : 27
Duration                                 : 2 h 5 min
Bit rate mode                            : Variable
Maximum bit rate                         : 7 500 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Format version                           : Version 4
Muxing mode                              : ADTS
Codec ID                                 : 15-2
Duration                                 : 2 h 5 min
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : 13 ms
jbleyel commented 1 year ago

https://github.com/openatv/enigma2/commit/373468268515b312577fc911166aee2ee85f0236

WanWizard commented 1 year ago

If the reconstructapsc plugin can be believed, there are no accesspoints in the stream, as it runs fine, recreates the .sc file, but doesn't recreate the .ap file.

Unfortunately, I lack the technical knowledge of MPEG to comment further on it.

From what I can see in the code, it uses the accesspoints in the ap file to read blocks of data from the ts file, so it looks like a list of pointers of some sort.

But nothing else in E2 seems to be missing the .ap file, I can watch it, wind of rewind it, skip through it, ...

jbleyel commented 1 year ago

You can create the ap and sc with "createapscfiles".

jbleyel commented 1 year ago

root@vuultimo4k:/media/hdd/movie/1# ls -l -rw-r--r-- 1 root root 90270268 Oct 7 18:22 1.ts -rw-r--r-- 1 root root 0 Oct 7 18:24 1.ts.ap -rw-r--r-- 1 root root 72192 Oct 7 18:24 1.ts.sc

The sc was created but the ap is empty.

Dima73 commented 1 year ago

It is necessary to write a code that creates a .ap file with the correct data at the end of the recording servicemp3.cpp

jbleyel commented 1 year ago

It is necessary to write a code that creates a .ap file with the correct data at the end of the recording servicemp3.cpp

I have no idea why the createapscfiles don't work for stream files. It looks like that the stream file have no pts infos and you cannot create the ap file.

This means you probably not need the ap file for moviecut of stream files.

betacentauri commented 1 year ago

"When I record a stream (via gstreamer, 4097), it creates an MPEG-TS file with a .stream extension" This is in general wrong. A .stream file can contain all sorts of data. It can be a MPEG-transport stream, but it can also be a MKV or mp3 or wmv or what else gstreamer supports. E2 don't know what is in the .stream file. Gstreamer handles it. Gstreamer chooses the demuxers/decoders according to the recognized file format. So if you want to know what is in the file use e.g. mediainfo.

It depends on the source which format is send and whether it's an e2/MovieCut compatible MPEG TS stream or not. And as you see even MPEG-TS streams can be different so that some are compatible and some not. I didn't wrote MovieCut, but I guess it was build ONLY to be able to cut MPEG-TS streams broadcasted via SAT/cable and stored by e2 and not every MPEG-TS, MKV or whatever stream.

It might be possible to improve e2 (ap creation) or Moviecut, but it will never be a cutting program which will support all kinds of codecs I guess. I don't believe that somebody will build this.

betacentauri commented 1 year ago

https://github.com/openatv/enigma2/commit/373468268515b312577fc911166aee2ee85f0236 I don't know whether this is a good idea. As said createapscfiles expects MPEG-TS streams, but .stream files can also contain other data. This MIGHT lead to crashes. Maybe.

WanWizard commented 1 year ago

This is in general wrong. A .stream file can contain all sorts of data. It can be a MPEG-transport stream..

True, but the statement was "When I", so not generally speaking, but in his specific case. As you can see above, the recording I tried to cut is also an MPEG-TS file. I understand that moviecut is only about TS file, so perhaps that could be checked to prevent users doing stupid things?

From what I can see in analysis, the MPEG-TS was created by ffmpeg, so if it was originally broadcasted, it has been processed / compressed.

jbleyel commented 4 months ago

I will close this because createapscfiles won't work.

Dima73 commented 4 months ago

ok