Hello All!
I've downloaded .m4s files from a live video streaming site. I've managed to get the keys, concatenate with the init file and decrypt. My problem is I'd really like to convert the files to .ts and be able to just use the filesystem to 'cat' them. If I convert to .ts (with ffmpeg -i video.mp4 -codec copy -f mpegts video.ts) and cat them, I get a file that plays good for the first 6 seconds (segment time), and then the video freezes and audio continues.
I've tried a bunch of different things: ffmpeg concat works - but you need to concat ALL of the segments, and I'm trying to deliver them real time. I've tried concatenating them and re-splitting but I still have the issue. If I build a m3u8 file and add '#EXT-X-DISCONTINUITY' before each segment, it seems to work, but my processing is lagging behind and I get buffering.
I haven't seen an error message from vlc or other tool that tells we exactly what my problem is - so I don't even know what to try next.
Has anyone seen this issue ? Is there a way to fix it?
Any help you can give me would be greatly appreciated - I've been stuck on this issue for 2 months.
Thanks in advance!
+ Reply to Thread
Results 1 to 25 of 25
-
-
-
wow - don't know how that happened. Encoding on a different machine and I usually have it muted so I never noticed.
attached are new files -
Thanks - I having trouble getting tsmuxer running.
I did also attache the MP4 files
It sounds like your recommended usage of tsmuxer is concatenating all of the m4s files - and what I'm looking for is something to 'fix' the mp4 / ts files so that they could be 'cat'ed (I'll actually have some php code to stream the bytes back to the client - similar to cat). -
I didn't use it but it's recommended for corrupted mp4 https://github.com/anthwlock/untrunc No clue if the prog can handle your m4s
-
You can use mkvToolnix to combine your files into one as it recognizes these m4s: add the first file, select it, right mouse click and hit append files. After then TSMuxer to change mkv into transport stream.
[Attachment 83868 - Click to enlarge] -
I think your solutions are just different ways to do what I can do with ffmpeg. What I'm looking for is something that makes my video (mp4 or ts) capable of being cat'ed together to give a smooth, seamless video. Ultimately I'd like to deliver individual files, one right after the other, somewhat real time to have 'live' video.
For some reason m4s files aren't that way - I'm trying to figure out how to make them be able to run one right after the other without actually merging them.
Don't get me wrong - I appreciate your help. I'm learning a lot about other tools. But I still don't know what my actual problem is - why does the video freeze and audio continue when cat'ing the ts files? -
Thanks autodidact - I was very hopeful of your suggestion - I think that's probably the only flag I have tried. Unfortunately it's still not working.
-
I don't understand what is your problem. All the above works, as well as the following code:
Code:ffmpeg -f concat -safe 0 -i mylist.txt -c copy joined.ts
-
I was hoping that this would make .ts files that could be cat'ed together and have no stuttering. Do you think it does that (aka - did I do something wrong) ?
This
Code:ffmpeg -f concat -safe 0 -i mylist.txt -c copy joined.ts
Last edited by bigdealfred; 4th Dec 2024 at 20:15.
-
This example run on linux in a folder of sequential segments generates a list on-the-fly, sends to stdout and pipes to vlc:
Code:ffmpeg -f concat -safe 0 -i <(for f in ./*.m4s; do echo "file '$PWD/$f'"; done) -c copy -f mpegts - | vlc -
https://trac.ffmpeg.org/wiki/Concatenate
I don't think the standard cat is going to do what you need. There are various ways to use the concat function in ffmpeg and creating an output file may not be necessary. The files are not corrupt but stream segments so a muxer that can handle that is needed.PB -
bigdealfred - I individually change format from m4s (from post #6) to ts, and then concatenating them, using command lines from above, no freezing after concat, it is ok. Can you describe what "trying to deliver them real time" means?
Last edited by _Al_; 4th Dec 2024 at 23:30.
-
Attached are example segments - I was hoping to be able to convert .m4s into these type of .ts.
For systems that deliver encrypted .ts files, I have some php code that downloads the m3u8, download the ts files inside, decrypts them and then 'echo's the data back to the client - and then starts over - giving real time video.
The ffmpeg concat works well. I'm having issues with the 'looping' concat (adding files to the merge list as they're being downloaded and decrypted) and outputting to the pipe. I can't tell if it's a sync issue with adding the new files or if my processing can't keep up with 'real-time'. Not only is video crappy, VLC is throwing errors
[Attachment 83959 - Click to enlarge]
I thought if I could find out the cause of the freeze - or what ffmpeg does to fix that during a merge, I could do 'that' the m4s to make it a clean .ts.
I appreciate everyone's help. -
-
-
Error says, that it cannot load file, why it would be configuration issue?
Source of freezing might be, as always is at the beginning if starting a stream, where audio and video might not start at the same time. vlc tries to start with audio and there is no video, so it stutters. mpv might start with audio and jumps into audio. That is just a guess. Cutting the beginning might work of fixing the ts video by some transport stream fixer. But really I have no idea what you are doing, the more I read about this, the more lost I am. Now you say you wish m4s would be ok to concat, but ffmpeg does not allow to copy to m4s, only to mp4.
If I copy all ts to mp4 and concat them, in ubuntu, it plays without glitch at the beginning in VLC, it plays ok.
Similar Threads
-
Converting iPlayer audio dash+m4s and video dash+m4s to mp4
By Kim_ in forum Video ConversionReplies: 1Last Post: 5th Nov 2021, 12:42 -
How to convert this video to 1080p(clean+sharp) with avisynth
By ningnong132 in forum Video ConversionReplies: 0Last Post: 4th Feb 2021, 20:59 -
Need Help To Convert M4s To MP4,
By Daringbaaz in forum Video ConversionReplies: 2Last Post: 15th Sep 2020, 06:47 -
Convert .m4s
By leoglez29 in forum Video ConversionReplies: 2Last Post: 20th Jul 2020, 22:35 -
Trouble M4S to MP4
By tob3 in forum Video ConversionReplies: 1Last Post: 14th Jul 2020, 23:08