#3850: r.out.mpeg always fails because the output file name is empty
----------------------------+-------------------------
Reporter: paoloz | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone:
Component: Raster | Version: svn-trunk
Keywords: mpeg animation | CPU: Unspecified
Platform: Unspecified |
----------------------------+-------------------------
Testing r.out.mpeg using North Carolina data set, smaller subset NC
location (nc_basic_spm_grass7)
g.region rast=elevation
r.out.mpeg view1=elevation@PERMANENT,elevation_shade@PERMANENT
output=./test.mpg
always fails with
r.out.mpeg view1=elevation@PERMANENT,elevation_shade@PERMANENT
output=./test.mpg
Reading raster map <elevation@PERMANENT>...\\
Reading raster map <elevation_shade@PERMANENT>...\\
ERROR: Could not open output file! \\
WARNING: mpeg_encode ERROR
the reason is that the name of the output mpeg fie is not copied in the
"outfile" variable, which is used to write the name of the output mpeg in
the configuration file for "ppmtompeg"|"mpeg_encode" encoder. Therefore
the name of the output mpeg is blank and the encoding always fail with
"ERROR: Could not open output file!".
Tested with GRASS: 7.0.0, 7.4 svn (12/01/2018), 7.6.0, 7.6.1.
Works in 6.4.6 because the variable is not empty, see lines 442-445 of
grass-6.4.6/raster/r.out.mpeg/main.c.
A patch to solve the problem is attached.
Index: raster/r.out.mpeg/main.c
--- raster/r.out.mpeg/main.c (revisione 74509)
+++ raster/r.out.mpeg/main.c (copia di lavoro)
@@ -6,6 +6,8 @@
* Brad Douglas <rez touchofmadness.com>, Markus Neteler
<neteler itc.it>,
* Glynn Clements <glynn gclements.plus.com>, Hamish Bowman
<hamish_b yahoo.com>,
* Jan-Oliver Wagner <jan intevation.de>, Paul Kelly <paul-
grass stjohnspoint.co.uk>
+ * Paolo Zatelli <paolo.zatelli unitn.it>
+ *
* PURPOSE: combines a series of GRASS raster maps into a single
MPEG-1
* COPYRIGHT: (C) 1999-2006, 2011 by the GRASS Development Team
*
@@ -142,6 +144,9 @@
parse_command(viewopts, vfiles, &numviews, &frames);
+ /* output file */
+ strcpy(outfile, out->answer);
+
r_out = 0;
if (conv->answer)
r_out = 1;
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3850>
GRASS GIS <https://grass.osgeo.org>