0

this is my first question on the site.

Currently I am working on one application which captures the video and store it in the system hard drive. Both the functionality is working fine.We are storing the videos in two different files as left.mp4 and right.mp4 and then we are combining them to one main.mp4 file.

But while recording the video if accidentally the system gets down the both the videos are gets corrupting. How can I do such that though system is down, video before shutdown gets secured or how can make secure while recording the video or can we store the video in different format to resolve this error

I am using following ffmpeg command for this

 ffmpeg -loglevel warning -y  -i /base_dir/right.mp4 -i /base_dir/left.mp4 -filter_complex '[1:0] pad=1088:288:0:0:black [padvidleft]; [0:0] setpts=PTS+0.5519998073577881/TB [right_cam_pts]; [padvidleft][right_cam_pts] overlay=544:0 [mergedvid] ; [1:2] channelsplit [ll][lr]; [ll][lr] amix [leftmix]; [1:3] channelsplit [rl][rr]; [rl][rr] amix [rightmix];
[leftmix][rightmix] amix [cam_all];[1:4] channelsplit [btl][btr] ; [btl][btr] amix [btmix] ;
[btmix][cam_all] join [bt_mixcam]' -f mp4 -crf 20 -r 24 -pix_fmt yuv420p -vcodec libx264 -vprofile baseline -map [mergedvid] -map [bt_mixcam] -map 1:2 -map 1:3 -map 1:4 /video-output/combos/combo-2013-10-07T22-39-05_1186300d3a8f6e08c67339f6871567f880abf287a855c_1088x288.mp4

Is there any command for this or anyone can give me suggestion for resolving this? I am using ubunutu for this Thanks in advance.

11
  • 1
    I think you should use mpeg2ts, it fits better when you have some problems during encoding.
    – ptQa
    Commented Mar 11, 2014 at 16:39
  • is not possible using ffmpeg? Commented Mar 11, 2014 at 16:46
  • or we can modify the above command? Commented Mar 11, 2014 at 16:56
  • can we store the video in different format to resolve this error Commented Mar 12, 2014 at 8:34
  • Yes, it's possible with ffmpeg. To use mpeg2ts you should specify "-f mpegts" for output file.
    – ptQa
    Commented Mar 12, 2014 at 10:24

1 Answer 1

0

To resolve this issue I changed the encoding format from .mp4 to mpegts and it works fine. and in the command we just replace "-f mp4" with "-f mpegts".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .