如何处理flowplayer使用的.ts文件?

时间:2019-08-07 17:23:32

标签: ffmpeg flowplayer mpeg2-ts

jove.com似乎在使用Flowplay

https://www.jove.com/video/59612/3d-kinematic-gait-analysis-for-preclinical-studies-in-rodents

以上述网址为例,它将使用这样的.ts文件(通过Google Chrome devtools)

https://cloudflare2.jove.com/CDNSource/hls/59612/59612_3.ts

但是我不确定如何使.ts文件在本地可见。

https://askubuntu.com/questions/3645/how-do-i-convert-ts-files-into-something-useful

我尝试过这样的事情。但是我总是会出错。

$ ffmpeg -i 50191_1.ts -c:v libx264 -crf 0 -c:a copy output.mp4
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
50191_1.ts: Invalid data found when processing input

有人知道如何转换.ts文件吗?

编辑:我得到了类似的东西。

$ cat 59612_.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:17
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="https://cloudflare2.jove.com/CDNSource/hls/59612/59612.key"
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_0.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_1.ts
#EXTINF:6.606600,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_2.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_3.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_4.ts
#EXTINF:10.877533,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_5.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_6.ts
#EXTINF:7.907900,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_7.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_8.ts
#EXTINF:10.910900,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_9.ts
#EXTINF:9.676333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_10.ts
#EXTINF:8.375033,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_11.ts
#EXTINF:12.645967,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_12.ts
#EXTINF:13.146467,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_13.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_14.ts
#EXTINF:6.840167,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_15.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_16.ts
#EXTINF:10.877533,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_17.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_18.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_19.ts
#EXTINF:6.706700,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_20.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_21.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_22.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_23.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_24.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_25.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_26.ts
#EXTINF:16.649967,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_27.ts
#EXTINF:8.308300,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_28.ts
#EXTINF:8.308300,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_29.ts
#EXTINF:5.672333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_30.ts
#EXTINF:10.677333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_31.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_32.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_33.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_34.ts
#EXTINF:7.507500,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_35.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_36.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_37.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_38.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_39.ts
#EXTINF:7.273933,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_40.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_41.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_42.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_43.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_44.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_45.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_46.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_47.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_48.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_49.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_50.ts
#EXTINF:16.683333,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_51.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_52.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_53.ts
#EXTINF:13.079733,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_54.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_55.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_56.ts
#EXTINF:13.113100,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_57.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_58.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_59.ts
#EXTINF:8.341667,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_60.ts
#EXTINF:6.573233,
https://cloudflare2.jove.com/CDNSource/hls/59612/59612_61.ts
#EXT-X-ENDLIST

1 个答案:

答案 0 :(得分:1)

简单的方法是只打开HLS视频流(然后由FFmpeg解密)并剪切所需的片段:

ffmpeg -ss 32 -i https://cloudflare2.jove.com/CDNSource/hls/59612/59612_.m3u8 -t 17 -c copy output.mp4

否则,您将需要hexdumpopenssl,' 59612.key ',' 59612_3.ts ',并再次{{1 }}:

ffmpeg
hexdump -e '16/1 "%02x"' 59612.key
41e61c18aa7efdf7f88ea9fddb4faef8

({openssl aes-128-cbc -in 59612_3.ts -out 59612_3-decrypted.ts -d -iv 3 -K 41e61c18aa7efdf7f88ea9fddb4faef8

-iv <segment-number>