How to specify a path for output file in ffmpeg?

21,667

Solution 1

The command is not able to understand the output file type. Try -f mp4 option to specify that you want output to be in mp4 format.

One more point is first try to create the file in the same directory from where you are executing the command, so the out_path would be,

$out_path = "video.mp4";

Solution 2

Run the code in python file , and use concatenation process

cmd='ffmpeg -i C:/streaming/sample_videos/'+x+' -i logo.png -filter_complex "overlay=10:10" -preset slow -g 48 -sc_threshold 48  -map 0:0 -map 0:1  -s:v:0 640x360 -c:v:0 libx264 -b:v:0  800k -c:a:0 aac -b:a:0 96k   -c:a copy -var_stream_map "v:0,a:0" -profile:v main  -master_pl_name master.m3u8 -f hls -hls_time 20 -hls_list_size 0 -hls_playlist_type vod -hls_segment_filename "'+y+'/stream_%v/file_%03d.ts" '+y+'/stream_%v/playlist.m3u8'
subprocess.call(cmd,shell=True)
Share:
21,667
Karthikeya Vaidya
Author by

Karthikeya Vaidya

Updated on January 30, 2020

Comments

  • Karthikeya Vaidya
    Karthikeya Vaidya over 4 years

    I am trying to give a path for the output file, but ffmpeg is giving an error stating

    Unable to find a suitable output format for '/kcs/eng/: Invalid argument.

    Whereas it is accepting the full path of the input file.

    $in_path = "D:/kcs/kan/video.vob";
    $out_path = "E:/kcs/eng/video.mp4";
    
    ffmpeg -i $in_path -loglevel error -c:v libx264 -c:a aac -strict experimental $out_Path 
    

    How to specify the path of the output file?