microshow/RxFFmpeg

關閉APP後再進行FFMPEG操作會無法讀取檔案

CiaShangLin opened this issue · 1 comments

我先對一個mp4輸出成m3u8且加密
ffmpeg -i ${mp4FilePath} -codec: copy -start_number 0 -hls_time 10 -hls_key_info_file ${keyInfoFilePath} -hls_list_size 0 -f hls ${m3u8FilePath}
然後m3u8轉回mp4
ffmpeg -allowed_extensions ALL -i ${m3u8FilePath} -codec copy ${decryptMp4Path}
錄完影片當下做上面兩個操作都沒問
但是把APP關掉後再做m3u8追回mp4操作時就會報錯
看起來是沒辦法讀取output0.ts,實在沒什麼頭緒所以上來問一下

錯誤訊息
Opening 'crypto:/data/user/0/com.shang.encryptedcamera/files/1698302494661/2023-10-26-14-41-40-238/output0.ts' for reading
Error when loading first segment '/data/user/0/com.shang.encryptedcamera/files/1698302494661/2023-10-26-14-41-40-238/output0.ts'
Statistics: 216 bytes read, 0 seeks
/data/user/0/com.shang.encryptedcamera/files/1698302494661/2023-10-26-14-41-40-238/output.m3u8: Invalid data found when processing input
Statistics: 606864 bytes read, 0 seeks
Error when loading first segment '/data/user/0/com.shang.encryptedcamera/files/1698302494661/2023-10-26-14-41-40-238/output0.ts'
Statistics: 216 bytes read, 0 seeks
/data/user/0/com.shang.encryptedcamera/files/1698302494661/2023-10-26-14-41-40-238/output.m3u8: Invalid data found when processing input

E/TAG_FFMPEG: Error when loading first segment '/data/data/com.shang.encryptedcamera/files/1698303485465/test/output0.ts'
D/TAG_FFMPEG: Statistics: 278 bytes read, 0 seeks
E/TAG_FFMPEG: /data/user/0/com.shang.encryptedcamera/files/1698303485465/test/output.m3u8: Invalid data found when processing input
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2c in tid 14032 (androidx.work-1), pid 13982 (encryptedcamera)

自己解決了是我這邊key產出問題sorry