[FFmpeg-user] How to decrypt .ts files into separate .ts files with ffmpeg without using a playlist?

Crazy Red Elephant crazyredelephant at protonmail.com
Wed Feb 12 15:30:01 EET 2020


Yes, Micael, EXT-X-MEDIA-SEQUENCE is the same and there was no IV originally. The only change I did was downloading the key file from the remote server because originally m3u8 had URI={url}. But I believe it doesn't matter anyway because even if I let ffmpeg download everything rather than using files on my computer, the DTS warnings are still there.

Also, I don't think the DTS issue is a result of this because I have another example where m3u8's structure is exactly the same but no DTS warnings appear and there are no dropping frames in the result file either.

You can find the files from this example [here](https://www.mediafire.com/file/dg2f4l0hdaczq6z/test3.zip/file). I tried to compare these files to the files that give me the DTS warnings in DVBinspector but haven't found anything suspicious, however I'm by no means an expert in this and more likely missed something...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, February 12, 2020 1:31 AM, Micael Silva micaelsilva at gmail.com wrote:

>> On Tuesday, February 11, 2020 12:26 AM, Moritz Barsnick barsnick at gmx.net
>> wrote:
>>
>>> Well, ffmpeg parses the individual decrpypted segments just fine, so
>>> shrug. I can only guess that when segmenting, they weren't segmented
>>> at MPEG-TS packet boundaries, or something like that.
>>
>> I tried what Micael suggested for the IV values and it worked. I used the
>> next command for part1 file for example:
>> "openssl aes-128-cbc -d -nosalt -K 5e5852fab5eedf7c6b7a367b1fc140a1 -iv
>> 00000000000000000000000000000001 -in part1.ts -out part1.dec.ts"
>> By the way, when I mux the decrypted .ts parts into one .ts or .mp4 I get
>> lots of "Non-monotonous DTS in output stream 0:0" errors which is another
>> issue I still can't figure out a solution for... But since it's kinda
>> off-topic, I think I will ask it in a new thread :-)
>
> The IV, when not right, in reality doesn't prevent decryption but makes the
> output file loop arround itself with parts of the end of the file ending up
> on the beginning. The "Non-monotonous DTS" on MPEGTS usually happens when
> the streams starts without some keyframe, makes me think that somehow the
> IV is wrong therefore the file maybe is looping arround. Did you copy the
> M3U8 list right? EXT-X-MEDIA-SEQUENCE is the same and there is no IV on the
> EXT-X-KEY tag?
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list