Hello,

I have a video created with Magic Lantern on a Canon's reflex. The fps is 
50 images per second alternated at 1600 and 400 iso for doing hdr video.

I use the script hdr.sh to :
- extract each image of the video, using ffmpeg, to a tiff file : it works
- align images by pairs using align_image_stack : it does not work
- make an exposure fusion using enfuse : not tested yet

After ffmpeg has extracted all the pictures of the video, I have :
Could not decode image: HDRb-000001.tifUnsupported image file format
Could not decode image: HDRb-000002.tifUnsupported image file format
Could not decode image: HDRb-000003.tifUnsupported image file format
Could not decode image: HDRb-000004.tifUnsupported image file format
Could not decode image: HDRb-000005.tifUnsupported image file format
Could not decode image: HDRb-000006.tifUnsupported image file format
Could not decode image: HDRb-000007.tifUnsupported image file format
Could not decode image: HDRb-000008.tifUnsupported image file format
Could not decode image: HDRb-000009.tifUnsupported image file format
Could not decode image: HDRb-000010.tifUnsupported image file format
...

I have to stop it with CTRL C

You can download two example pictures files 
on https://app.box.com/s/dww6i9qa0wdf0n5zp1on9ynlm10wpbtp


Could you please help me to solve it ?


Regards,


Olivier

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/8c83ebb0-1f3d-4b9b-aaff-ae0ff6d9bb34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/bin/sh
# Exposure fusion (a.k.a. "Fake HDR") workflow for Magic Lantern
# 2012-11-28 17:20:30
# Martin Müller <[email protected]>
#
# REQUIREMENTS:
# ffmpeg
# enfuse
# hugin (for align_image_stack)
#
# TO DO:
# - check for existing (and working) commands
# - option for cleaning up to save disk space
# - GUI (Graphical User Interface)

# SETTINGS:
# Where to search for the movie clips (set to . for current directory)
SEARCHPATH=.
# Resulting frame rate
FPS=25
# Path to align_image_stack executable
#AIS=/Applications/Hugin/HuginTools/align_image_stack
AIS=/usr/bin/align_image_stack
EXT=tif

for VIDEO in $(ls "$SEARCHPATH/"*".MOV")
do
	# Extract filename without extension from whole path to file
	FILE=$(basename "$VIDEO")
	FILENAME=${FILE%.*}

	# Check if directory exists
	if [ ! -d "$FILENAME" ]
	then
		# Create directory with video name
		mkdir "$FILENAME"

		# Split odd frames from video to image sequence with ffmpeg
		ffmpeg -i "$FILE" -filter:v select="not(mod(n\,2))",setpts="N/($FPS*TB)" -pix_fmt rgb24 "$FILENAME/HDRa-%06d.$EXT"
		# Split even frames from video to image sequence with ffmpeg
		ffmpeg -i "$FILE" -filter:v select="mod(n\,2)",setpts="N/($FPS*TB)" -pix_fmt rgb24 "$FILENAME/HDRb-%06d.$EXT"
	fi

	if [ ! -d "$FILENAME/aligned" ]
	then
		mkdir "$FILENAME/aligned"

		for f in $(ls "$FILENAME/HDRa-"*".$EXT")
		do
			NUMBER=${f##*-}
			#NUMBER=${f##*-+([^0-9])
			#exiftool -TagsFromFile "$FILE" "$f"
			#exiftool -TagsFromFile "$FILE" "HDRb-$NUMBER"
			#$AIS --gpu -a "$FILENAME-HDRb-aligned-" -o "$FILENAME/aligned/$FILENAME-aligned-$NUMBER" "$f" "$FILENAME-HDRb-$NUMBER"
			$AIS -a "HDRb-aligned-" -o "$FILENAME/aligned/aligned-$NUMBER" "$f" "HDRb-$NUMBER"
		done
	fi  

	if [ ! -d "$FILENAME/HDR" ]
	then
		mkdir "$FILENAME/HDR"

		# Merge HDRa and HDRb image sequences to single image sequence with exposure fusion
		for f in $(ls "$FILENAME/aligned/$FILENAME-HDRa-"*".$EXT")
		do
			NUMBER=${f##*-}
			#echo "$f (+) $FILENAME/aligned/$FILENAME-HDRb-$NUMBER => $FILENAME/HDR/HDR-$NUMBER"
			echo "$f (+) $FILENAME/aligned/aligned-$NUMBER => $FILENAME/HDR/HDR-$NUMBER"
			#enfuse -o "$FILENAME/HDR/$FILENAME-HDR-$NUMBER" "$f" "$FILENAME/aligned/$FILENAME-HDRb-$NUMBER"
			enfuse -o "$FILENAME/HDR/HDR-$NUMBER" "$f" "$FILENAME/aligned/aligned-$NUMBER"
		done
	fi

	# Merge enfused image sequence to ProRes 422 QuickTime video
	ffmpeg -r 25 -i "$FILENAME/HDR/$FILENAME-HDR-%06d.$EXT" -r 25 -vcodec prores -profile:v 2 "$FILENAME/HDR/$FILENAME-HDR.mov"
done

Reply via email to