Actually I have an device that record the audio and video. when the recording is started the video file also started to persist into the hard drive.

But if device goes off unfortunately between the recording. The video file get corrupted and gives an error: This file not contain playable stream

I am using the Ubuntu system and record the video using ffmpeg

Any one can help me..!!!

I am using the webcam for recording the video and bluetooth mic for audio using the ffmpeg. Following are the command that I am using to store the audio and video recording on other device(hard drive):

ffmpeg -loglevel warning -y  -i /home/prakash/../../output/2013-10-07T22-39-05/right_cam.mp4 -i /home/prakash/../.. output/2013-10-07T22-39-05/left_cam.mp4 -filter_complex '[1:0] pad=108:28:5:2:black [padvidleft]; [0:0] setpts=PTS+0.8786787543577881/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 /home/prakash/../../output/combos/combo-2013-10-07T22-39-05_dgrt6546533w471567f880abf287a855c_1088x288.mp4

If the recording is started and in the middle we turns off the recording device the recorded video and audio get persisted on hard drive but it is not able to play. When we try to play this recording the vlc gives the error this files contains no playable stream

  • Did you try to read your file using vlc? – Sylvain Pineau Mar 12 '14 at 10:27
  • Yes I tried to read the video using vlc. But in vlc also getting the same error. – Prakash V Holkar Mar 12 '14 at 11:32
  • Could you add to your question what exact device you're using (webcam?) and the ffmpeg command please? – Sylvain Pineau Mar 12 '14 at 11:36
  • @ Sylvain Pineau. I have added the ffmpeg command on question that I used. – Prakash V Holkar Mar 12 '14 at 12:38

You should try a different output container format such as MKV.

Your -f mp4 seems superfluous (unless this is part of a script where the output name is or part of a variable), but if you wanted to continue using this option the change it to -f matroska and give your output the mkv extension instead of mp4.

MP4 requires additional information to be written to the file, but this can only occur after encoding is completed properly. If the encoding does not complete properly then the information may not be present resulting in a non-playable output.


There is another great solution I got. It don't corrupt the audio and video files in any how. You can use -f mpegts instead of -f mp4 in ffmpeg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.