[GRASS-dev] [GRASS GIS] #3851: r.out.mpeg always fails because the output file name is empty

#3851: 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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3851&gt;
GRASS GIS <https://grass.osgeo.org>

#3851: 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
Resolution: | Keywords: mpeg animation
       CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------
Changes (by paoloz):

* Attachment "r_out_mpeg.diff" added.

r.out.mpeg

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3851&gt;
GRASS GIS <https://grass.osgeo.org>

#3851: 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
Resolution: | Keywords: mpeg animation
       CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------

Comment (by neteler):

Would you mind to submit your fix as a pull request here?
https://github.com/OSGeo/grass/pulls

We recently mirated to !GitHub for the code management and we could handle
your contribution much easier. Thanks!

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3851#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3851: 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
Resolution: | Keywords: mpeg animation
       CPU: Unspecified | Platform: Unspecified
--------------------------+----------------------------

Comment (by mmetz):

Replying to [comment:1 neteler]:
> Would you mind to submit your fix as a pull request here?
> https://github.com/OSGeo/grass/pulls

For the time being; i would regard a patch as a pull request. If people
are more comfortable providing a patch, that's fine.

I have applied the patch to master, relbr76, and relbr74:

https://github.com/OSGeo/grass/commit/78e9da1af300035ab1dbe4135ab79d1068aadd58

https://github.com/OSGeo/grass/commit/2340b9dc9612535a6f249557a6175c98128a7451

https://github.com/OSGeo/grass/commit/3ab95ff7a1781317dcca969c13cfe4fc6cb024df

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3851#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>