I converted the 1.flv file using the tool on https://convertio.co/ and still created a normal .mp4 file. However, when I use the python code, I get the error below.
import os
import subprocess
def convert_flv_to_mp4(input_file, output_file):
try:
subprocess.run(["ffmpeg", "-i", input_file, "-c:v", "libx264", "-c:a", "aac", "-preset", "medium", "-crf", "23", output_file], check=True)
except subprocess.CalledProcessError as e:
print(f"error {input_file} to {output_file}: {e}")
if __name__ == "__main__":
input_file = r"C:Usersvann4OneDriveDesktopflv1.flv"
output_file = r"C:Usersvann4OneDriveDesktopflv1.mp4"
convert_flv_to_mp4(input_file, output_file)
[flv @ 0000016342270d80] Video codec (c) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[flv @ 0000016342270d80] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. ([email protected])
[flv @ 0000016342270d80] Could not find codec parameters for stream 1 (Video: none ([12][0][0][0] / 0x000C), none, 1150 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, flv, from 'C:Usersvann4OneDriveDesktopflv1.flv':
Metadata:
start_time : 1723543887483
fp_coderate : 1150000
sdk_version : 16.8.1.2
old_link_info : (push-rtmp-f5-sg01.tiktokcdn.com:stage:stream-2133275252817395781)n.vn-lts55c.7qmt_34825,n.my-93iclg.4epc_3521416
default_bitrate : 1700
fp_vmode : 1
max_bitrate : 2700
fp_amode : 0
push_protocol : rtmpq
fp_dispatch_expr_tag:
e_id : 0
stream_id : push-rtmp-f5-sg01.tiktokcdn.com:stage:stream-2133275252817395781_uhd5b
s_id : 8
h_id : 4
interval : 2
publish_time_stamp: 1723543887
encoder : Lavf58.45.100
min_bitrate : 1000
link_info : n.my-93iclg.4epc_3521416,n.my-93iclg.hebn_3413106,n.sg-awn1ns.n4qb_644528,n.sg-awn1ns.kq7p_4176740,n.sg-elmss9.00jt_909,n.sg-elmss9.d4b4_59676,n.vn-6tkh26.ntnt_2987,n.vn-6tkh26.vuv7_56190
is_hardware_encode: 1
model : iPhone XR
hit_node_optimize: 0
fp_nb : 0
ab : 0
p_id : 0
os_version : 17.5.1
platform : iOS
qId : {"newbitrate_ios_bT":1,"ByteAudioAUUnsplit+new_session_api+with_aec_sw_true+framesize_10ms":true,"rc_bwe_ios":4,"ios_70742354_2":2,"not_rc_bwe_ios":1,"ios_fix_low_enc_bit_vpaas_4":4,"default_config_bugfix":1,"newbitrate_ios_resolution_no480p":1}
Duration: 00:02:26.09, start: 0.000000, bitrate: 958 kb/s
Stream #0:0: Audio: aac (HE-AAC), 44100 Hz, stereo, fltp, 64 kb/s
Stream #0:1: Video: none ([12][0][0][0] / 0x000C), none, 1150 kb/s, 25 fps, 25 tbr, 1k tbn
[vist#0:1/none @ 0000016343d38c00] Decoding requested, but no decoder found for: none
Error opening output file C:Usersvann4OneDriveDesktopflv1.mp4.
Error opening output files: Invalid argument
error C:Usersvann4OneDriveDesktopflv1.flv to C:Usersvann4OneDriveDesktopflv1.mp4: Command '['ffmpeg', '-i', 'C:\Users\vann4\OneDrive\Desktop\flv\1.flv', '-c:v', 'libx264', '-c:a', 'aac', '-preset', 'medium', '-crf', '23', 'C:\Users\vann4\OneDrive\Desktop\flv\1.mp4']' returned non-zero exit status 4294967274.
I tried converting the .mp4 file to .avi and it’s completely normal.
hope everyone can help me. Thanks for reading