aboutsummaryrefslogtreecommitdiff
path: root/rtc_tools
diff options
context:
space:
mode:
authorMagnus Jedvert <magjed@webrtc.org>2018-08-24 17:34:11 +0200
committerCommit Bot <commit-bot@chromium.org>2018-08-24 15:36:46 +0000
commit5c2de6b3ce079cff52c411a2c02ce6553a38dc79 (patch)
treec68d263887f5389358248cbc5262217f5728b742 /rtc_tools
parent85f20cbe4a536255c0bf5ec436a5f795ce14569c (diff)
downloadwebrtc-5c2de6b3ce079cff52c411a2c02ce6553a38dc79.tar.gz
Fix a bug in barcode_decoder.py
When converting from a .y4m file, it's illegal to pass a video_size option since the resolution is already contained in the .y4m file. TBR=phoglund@webrtc.org NOTRY=TRUE Bug: webrtc:9642 Change-Id: Iee7d2ba1332c45a1669af0fba43b0c3e7ce5846b Reviewed-on: https://webrtc-review.googlesource.com/95949 Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24431}
Diffstat (limited to 'rtc_tools')
-rwxr-xr-xrtc_tools/barcode_tools/barcode_decoder.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/rtc_tools/barcode_tools/barcode_decoder.py b/rtc_tools/barcode_tools/barcode_decoder.py
index 2abd677b4b..6be0f5d350 100755
--- a/rtc_tools/barcode_tools/barcode_decoder.py
+++ b/rtc_tools/barcode_tools/barcode_decoder.py
@@ -44,9 +44,13 @@ def ConvertYuvToPngFiles(yuv_file_name, yuv_frame_width, yuv_frame_height,
output_files_pattern = os.path.join(output_directory, 'frame_%04d.png')
if not ffmpeg_path:
ffmpeg_path = 'ffmpeg.exe' if sys.platform == 'win32' else 'ffmpeg'
- command = [ffmpeg_path, '-s', '%s' % size_string, '-i', '%s'
- % yuv_file_name, '-f', 'image2', '-vcodec', 'png',
- '%s' % output_files_pattern]
+ if yuv_file_name.endswith('.yuv'):
+ command = [ffmpeg_path, '-s', '%s' % size_string, '-i', '%s'
+ % yuv_file_name, '-f', 'image2', '-vcodec', 'png',
+ '%s' % output_files_pattern]
+ else:
+ command = [ffmpeg_path, '-i', '%s' % yuv_file_name, '-f', 'image2',
+ '-vcodec', 'png', '%s' % output_files_pattern]
try:
print 'Converting YUV file to PNG images (may take a while)...'
print ' '.join(command)