0
votes

I am complete newbie to video encoding. I am trying to encode a series of .dpx files into one single encoded video O/P file in any of the following format. ( .mp4,.avi,.h264,.mkv etc)

I have tried 2 different approaches. The first one works and the second one does not. I would like to know the difference between the two. Any help / input would be much appreciated.

1) using FFMPEG along with x264 library and it works well. I am able to produce desired output

ffmpeg -start_number 0 -i frame%4d.dpx -pix_fmt yuv420p -c:v libx264 -crf 28 
-profile:v baseline fromdpx.h264

2) I first try to concatenate all the dpx files into a single file using concate protocol in ffmpeg and then use x264 to encode the concatenated file. Here I see that the size of the concatenated file is the sum of all the files concatenated. But when I use x264 command to encode the concatenated file, I get a green screen (basically not the desired output) .

ffmpeg -i "concat:frame0.dpx|frame01.dpx|frame2.dpx etc" -c copy output.dpx

then

x264 --crf 28 --profile baseline -o encoded.mp4 --input-res 1920x1080 --demuxer raw 
output.dpx

I also tried to encoded the concatenated file using ffmpeg as follows

ffmpeg -i output.dpx -pix_fmt yuv420p -c:v libx264 -crf 28 -profile:v baseline fromdpx.h264

This also gives me a blank video.

Could someone please point out to me what is going on here? Why does the first method work and the second does not?

Thank you.

1

1 Answers

0
votes

In the second approach you specify DPX-file as raw input for x264 (--demuxer raw) but DPX is not raw format (it is more container which have headers, metadata and optionally RLE compression) and so need decoding. x264 supports only this raw formats (--input-csp): i420, yv12, nv12, i422, yv16, nv16, i444, yv24, bgr, bgra, rgb. All this formats can have 8..16 bits per component (--input-depth).

Also I doubt DPX format supports concating at all because it is image format not video format. So probably your result after concat is already broken.